summaryrefslogtreecommitdiffstats
path: root/ui/ncurses/nc-boot-editor.c
Commit message (Collapse)AuthorAgeFilesLines
* ui/ncurses: Update LOCKDOWN_FILE check to reflect generic SIGNED_BOOTBrett Grandbois2018-05-301-1/+1
| | | | | Signed-off-by: Brett Grandbois <brett.grandbois@opengear.com> Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* ui/ncurses: Fix boot editor segfault on updateSamuel Mendoza-Jonas2018-02-271-37/+71
| | | | | | | | | | | | | The boot option editor screen segfaults on a system info update since it loses track of which fields actually exist. The boot editor screen's setup and drawing logic is a bit different from other screens, so to fix this bug and preserve the maintainer's sanity, bring the screen setup and redraw into line with other screens. This includes a full teardown of the widgets on update, so save the content of any textboxes on update so the user's changes are not lost. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* ui/ncurses: Increase height of boot-editor padv1.5.1Samuel Mendoza-Jonas2017-07-261-1/+1
| | | | | | | | Similarly to nc-subset, extend the maximum height of the boot-editor pad to account for the fields of the device select potentially wrapping due to long device names. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* ui/ncurses: Fix adding unnecessary leading slashes to pathsSamuel Mendoza-Jonas2017-03-151-1/+2
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* Add support for GPG signature enforcement on bootedtpearson@raptorengineering.com2016-08-261-4/+62
| | | | | | | | | | | | | kernels and related blobs This can be used to implement a form of organization-controlled secure boot, whereby kernels may be loaded from a variety of sources but they will only boot if a valid signature file is found for each component, and only if the signature is listed in the /etc/pb-lockdown file. Signed-off-by: Timothy Pearson <tpearson@raptorengineering.com> Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com> (Minor build fixes and gpgme.m4, comment on secure boot in gpg.c)
* ui/ncurses: Improve update handling in nested screensSamuel Mendoza-Jonas2015-09-071-1/+15
| | | | | | | | | | | | | | | | Several screens in petitboot-nc require an update if a config or sysinfo update is received. However if those screens exist but are not the current screen they will incorrectly try to draw to the screen. Where the currently active screen is a textscreen (eg. a help screen) the update is delayed until after the screen is exited. In the particular case of nc-config where the current screen can be an nc-subset screen, the nc-subset screen is exited immediately so the update can be performed, since the nc-subset screen depends on the information in the previous screen. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Resize & adjust OK/Help/Cancel buttonsSamuel Mendoza-Jonas2015-09-071-4/+7
| | | | | | | | The localisation of 'OK' is cut short in a few languages by a character or two - adjust the buttons in each affected screen slightly to accommodate. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* lib/i18n: Move strncols to i18n.cSamuel Mendoza-Jonas2015-08-311-31/+0
| | | | | | Make the strncols() helper available generally to i18n-concerned code. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Reduce unnecessary calls to redrawwinSamuel Mendoza-Jonas2015-02-161-1/+7
| | | | | | | | | | | | | | | | | | | | | | | All current *_post() methods in ui/ncurses call redrawwin() and wrefresh() together. wrefresh() updates any lines on the screen that have been marked as changed or invalid. However redrawwin() marks the entire screen as invalid unconditionally. We can reduce the amount of data written to the screen by avoiding calls to redrawwin(). Screen transitions are the primary use case of redrawwin(), where the whole screen must be invalidated to avoid stale data remaining on screen. All other 'in-screen' updates such as changes to widgets or changing focus do not require a call to redrawwin(). The most noticeable performance improvement is in nc-menu, which makes an unnecssary call to redrawwin() after every addition to the boot option menu. eg. The number of bytes written to STDOUT in the main menu: # Boot options | Before | After -------------------------------- 8 | 5488 | 1149 133 | 422454 | 4652 Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Prevent creation of empty boot entrySamuel Mendoza-Jonas2015-02-161-0/+9
| | | | | | | | | A boot option requires an image path at minimum. If an option is created without an image, trying to edit the resulting user item causes a segfault. Prevent the user from creating a boot option without at least an image path. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Properly size buttons in boot option editorSamuel Mendoza-Jonas2014-10-131-3/+3
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Dynamically align text fields in nc-configSamuel Mendoza-Jonas2014-10-081-1/+35
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Expand cancel & help button widthSamuel Mendoza-Jonas2014-09-231-3/+3
| | | | Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
* ui/ncurses: Use a separate type for help textJeremy Kerr2014-07-281-2/+2
| | | | | | | | | | | | Because it's initialised statically, help text won't be directly gettext()-ed. Instead, we need to perform the gettext translation at runtime, and pass untranslated strings into the help_screen code. Instead of trusting callers to pass the untranslated strings though, we encapsulate the help text data into struct help_text, so we know we have an unstranslated string. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* i18n: Mark translatable strings for ncurses UIJeremy Kerr2014-07-281-12/+14
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Unify key bindings & key help textJeremy Kerr2014-01-311-1/+1
| | | | | | | | | | This change is a small cleanup of the key bindings; we ensure that the general key bindings are available (and documented) on all screens. In order to keep things consistent, this change adds an initial UI guidelines text file, which documents the general key bindings. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Add help to boot editor screenJeremy Kerr2014-01-311-2/+24
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Use descriptive field labels for boot editorJeremy Kerr2014-01-311-6/+10
| | | | | | | Rather than the brief names for the boot editor field label, expand (and capitalise) for a more-friendly form. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* configure: Use AC_GNU_SOURCEJeremy Kerr2013-12-181-2/+2
| | | | | | | 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>
* ui/ncurses/boot-editor: Fix (null) when non-device resources are shownJeremy Kerr2013-12-031-1/+1
| | | | | | | | | | | 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>
* ui/ncurses: Ensure boot editor window is properly paintedJeremy Kerr2013-11-221-0/+2
| | | | | | | 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>
* ui/ncurses: Fix use-after-free when exiting boot option editorJeremy Kerr2013-11-221-13/+29
| | | | | | | | 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>
* ui/ncurses: Allow boot editor sysinfo updatesJeremy Kerr2013-11-221-64/+94
| | | | | | | 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>
* ui/ncurses: Implement intra-field scrollingJeremy Kerr2013-11-221-6/+5
| | | | | | | 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>
* ui/ncurses: Draw boot editor into a scrollable padJeremy Kerr2013-11-221-5/+51
| | | | | | | | 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>
* ui/ncurses: Make boot editor paths relative to deviceJeremy Kerr2013-11-221-1/+65
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Add device selector to boot editorJeremy Kerr2013-11-221-4/+93
| | | | | | | | 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>
* ui/ncurses: Split boot editor layoutJeremy Kerr2013-11-221-29/+59
| | | | | | | 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>
* ui/ncurses: Make boot editor API consistent with config & sysinfo screensJeremy Kerr2013-11-221-15/+46
| | | | | | | | | | | | 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>
* ui/ncurses: Use nc-widgets for boot editorJeremy Kerr2013-11-131-237/+61
| | | | | | | Now that we have a simple widget set available, use this for the boot editor. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: Use OK & Cancel buttons for boot editor completionJeremy Kerr2013-10-111-6/+46
| | | | | | | 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>
* ui/ncurses: Defer item creation until boot editor is doneJeremy Kerr2013-10-101-16/+20
| | | | | | | | | | | | 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>
* ui/ncurses: Display sysinfo type & identifierJeremy Kerr2013-10-091-1/+2
| | | | | | | 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>
* configure: Update to use AX_WITH_CURSESGeoff Levand2013-07-231-0/+2
| | | | | | | | | | | For a more portable build system convert to using the autoconf-archive AX_WITH_CURSES macros. Allows building on openSUSE, which has a different header file layout than other distros, and fixes menu entries with UTF-8 characters; this causes fedora installs (codename "Schrödinger´s cat") to break the UI. Signed-off-by: Geoff Levand <geoff@infradead.org>
* Add initial dtb supportGeoff Levand2013-06-241-6/+12
| | | | | | | Updates & fixes by Jeremy Kerr <jk@ozlabs.org>. Signed-off-by: Geoff Levand <geoff@infradead.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: move getch() out of process_key callbacksJeremy Kerr2013-05-211-68/+59
| | | | | | | | All process_key callbacks will want to query the key that was pressed, so do the getch() once in cui_process_key, and pass the result to the callback. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui: pb_kexec_data -> pb_boot_dataJeremy Kerr2013-04-151-19/+19
| | | | | | | | find ui/ -type f | xargs sed -i -e s/pb_kexec_data/pb_boot_data/g \ -e 's/\<kd\>/bd/g' Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: ked -> boot-editorJeremy Kerr2013-04-151-0/+365
git mv ui/ncurses/nc-ked.c ui/ncurses/nc-boot-editor.c git mv ui/ncurses/nc-ked.h ui/ncurses/nc-boot-editor.h find ui/ncurses -type f | xargs sed -i -e s/nc-ked\./nc-boot-editor./g \ -e s/ked/boot_editor/g Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
OpenPOWER on IntegriCloud