| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Rather than #defining _GNU_SOURCE in our .c files, we can define this
from config.h instead.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
| |
We're seeing the following in the boot editor:
image: (null)ftp://...
the (null) is due to the sep in conditional_prefix, which should be
blank, not NULL.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
We have a few instances where we check for a 'select' action (enter or
space key event), and some are inconsistent. Unify these with a
key_is_select() function.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
Use wrefresh(curscr) to clean and repaint the entire screen.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
We're not currently drawing the window title correctly; we need to draw
the main_ncw for this to hit the terminal.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
After we've called on_exit, we can no longer use the boot editor. This
change moves individual button callbacks into process_key, which returns
to the main loop.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
We may start a boot editor (via 'New') before we have the sysinfo. To
allow this, we redraw the device select.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
We want to be able to re-set the options in a select widget.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Now that we can calculate the focus within a field, ensure that the
focussed-element remains scrolled.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
| |
When we have widgets that are larger than the screen, we'd like to
scroll to the currently-focussed component of that widget.
This change introduces a widget_focus_y function, which returns the y
offset of the field's focus.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
Like the config editor, draw the boot editor into a pad instead of
directly into the sub window. This means that long device lists will be
handled correctly.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
Rather than expecting users to enter full (prefixed) mount paths, add a
select widget to pick a device, and we automatically add the prefix when
the form is submitted.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
We want to make the boot editor dynamic later, so split the widget
layout from the widget creation.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The boot-editor API is a little more exposed than it needs to be: the
boot_editor struct does not need to be available to other files, and the
init function and on_exit functions differ from those provided for the
config and sysinfo screens.
This change unifies the boot_editor API with those for the other
screens.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
The widgetset code handles these attributes now.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
We need the y-coord, not x.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
The discover_client_boot call is asynchronous, so setting and resetting
prog_mode doesn't gain us anything.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
To keep consistent with buttons, which also accept space.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
This change adds:
- 'seconds' to the timeout text entry
- examples to the ip/mask, gateway and DNS text entries
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
| |
Currently, when the config form is larger than the screen size, the form
fails to draw.
This change draws the config screen onto a pad instead, which we can
scroll.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
We may receive configuration (or sysinfo) data after the configuration
screen has been displayed. Implement config_screen_update and redraw the
widgetset when new config data arrives.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
It's not obvious why it's there when we're configuring DHCP.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Sets the default values of configuration widgets to the values found in
t he current config.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
This change implements the configuration save action, when the user
submits the nc-config form.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Add network configuration parameters. This requires a somewhat-dynamic
layout, as the fields shown depend on earlier configuration.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
This change adds a simple configuration editor to the ncurses UI.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
We just store the config in the cui for now.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Now that we have a simple widget set available, use this for the boot
editor.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
| |
We're doing a lot of the same stuff with forms, and we'll to implement a
lot of fields with the upcoming configuration interface.
This change introduces a simple ncurses widget set.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
| |
Add a simple screen for displaying the struct system_info. We add this
to the main menu as a selectable option, and separate it from the boot
option list with an unselectable blank entry.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, we talloc_free() the sysinfo and status messages in the
discover client, right after performing the ui's callback.
However, the client may wish to keep a reference to this information
beyond the callback invocation. This change introduces a per-message
talloc context, which these structures are allocated under. This allows
the callbacks to talloc_steal() anything they wish to keep a reference
to.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
We may have nc_scrs that aren't interested in post/unpost information,
so create helper functions that allow a NULL callback.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
| |
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
On client connect, send a PB_PROTOCOL_ACTION_CONFIG message.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
We have quite a few pb_logs which should be pb_debug. This change moves
developer-specific info to pb_debug.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Rather than using enter to complete a boot_editor session, add OK and
Cancel buttons. Enter will move between fields.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
| |
Because terminals will send escape-sequences starting with escape,
ncurses will pause after receiving a signle escape, to detect
these sequences. This introduces a 1-second delay when exiting the
petitboot UI.
Instead, use 'x'.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Currently, we can't boot user-created boot options, as they have no
option ID associated. This change removes the check for option ID.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, when creating new menu entries, we create an empty item, add
it to the menu, then run the boot editor. This means that cancelling the
edit will leave an empty item in the menu.
This change defers the creation until the boot editor is done. To do
this, we modify the on_open callback to take a menu rather than an item,
and pass NULL boot data to the editor.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
| |
"Open" is ambiguous in the context of the boot menu; use "new" instead.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|
|
|
|
|
|
|
| |
Hook into the sysinfo updates to display the type & id at the top of the
petitboot main menu.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
|