Conversation
|
Wow😃 Expect merge day middle of next week |
|
I tested all these with qemu-fbwhiptail, so only really scratched the surface. I'll be testing on the L14 tomorrow/next week and may have a few additional fixes/commits based on how that goes |
a76c02e to
1c3f2f7
Compare
|
@MrChromebox any plan on moving gui functions to /etc/gui_functions ? |
|
I suppose that's an option. Where would we draw the line between what goes in gui_functions and gui_init? |
|
Well, the way you are heading would permit calling . /etc/gui_functions if whiptail is present and permit to do a lot without leaving GUI and needing To go into authenticated recovery shell. Then maybe even unifying them with /etc/functions later. This would remove redundancy (mount_boot, verify_global_checkums and others ) while permitting other scripts to reuse what is there and cleaner code in the long run? If the main scripts (policies) were calling only functions which are doing what they are supposed to be doing, Heads would become way more flexible, which seems to be the desire of the community with forks like @hardenedvault with its own autoboot script now, tpm2 included and system76 systems interest from the community that seems to be present out there. More reusability means more collaboration and endorsement which is somehow a really good thing for a project like this to move faster. |
of course, that's certainly one of the goals of this effort. Moving things into /etc/gui-functions only makes sense IMO if we're going to split things up such that the same function names can be used with or without whiptail, and the versions in /etc/gui_functions mirror those in /etc/functions just with whiptail. We'd need to split the common stuff out so it could be included in both cases. Primarily though, my goal here is to improve the reliability and UX of the gui-based boards, since that's what's of concern to Purism's users. Refactoring to improve readability, reuse, and ease of future enhancements is a close 2nd though :) |
1c3f2f7 to
89f3ed8
Compare
|
@tlaurion ok, done adding to this, should be ready for review/testing |
Name better reflects function purpose, allows 'update_totp' to be used to actually update the TOTP code. Signed-off-by: Matt DeVillier <matt.devillier@puri.sm>
Signed-off-by: Matt DeVillier <matt.devillier@puri.sm>
Break menus and menu items into functions where possible. Improves readability of code / functional flow, and makes future refactoring easier. Signed-off-by: Matt DeVillier <matt.devillier@puri.sm>
Now that all menu options are encapsulated in shell functions, move menu handling from the main loop to inside the menu/submenu function itself. Signed-off-by: Matt DeVillier <matt.devillier@puri.sm>
Checking the keyring for a GPG and updating the TOTP/HTOP status need only happen once at initial boot; the latter can be updated at any later time from the main menu itself. Having them repeated each loop of the main menu is unnecessary (and often annoying). Likewise, the default auto boot can be moved and the first_pass (and unused MAIN_MENU_OPTIONS) variable dropped. Signed-off-by: Matt DeVillier <matt.devillier@puri.sm>
Persist the background color (and error state) through the main menu and all submenus. Use warning background color for destructive operations, error color for errors. Signed-off-by: Matt DeVillier <matt.devillier@puri.sm>
Currently, if no disks on system, selection of a new /boot device will silently fail and simply return the user to the previous screen. Add an error dialog if no disks found. Signed-off-by: Matt DeVillier <matt.devillier@puri.sm>
Signed-off-by: Matt DeVillier <matt.devillier@puri.sm>
Modify update_checksums() to return 0/1 on success/failure, and modify callers to notify the user on error with a GUI msg. Set background color as appropriate in gui-init. Signed-off-by: Matt DeVillier <matt.devillier@puri.sm>
Allow user to cancel HOTPKEY check, set BG color appropriately Signed-off-by: Matt DeVillier <matt.devillier@puri.sm>
If user selects to manually update the TOTP via the menu, we should do it regardless of elapsed time from previous check. Otherwise, HOTP will be checked regardless of validity of TOTP. Signed-off-by: Matt DeVillier <matt.devillier@puri.sm>
After updating/flashing a new ROM, a new TOTP secret must be generated, but the $TOTP variable needs to be updated afterwards, otherwise it will show the previous failure which led to the new secret being created. Fix this by re-calling update_totp() after generating a new secret or resetting the TPM. Signed-off-by: Matt DeVillier <matt.devillier@puri.sm>
465fc95 to
06cf43a
Compare
|
Oupsies everyone. This is merged as per #955 having been merged first. |
|
closing since #955, which was rebased on this PR, got merged out of order - so commits are already in |
Signed-off-by: Matt DeVillier matt.devillier@puri.sm