]> git.ozlabs.org Git - petitboot/commit
ui/ncurses: Reset console options on boot
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>
Tue, 6 Nov 2018 04:34:51 +0000 (15:34 +1100)
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>
Fri, 16 Nov 2018 02:55:29 +0000 (13:55 +1100)
commit2bc0df4aa35a89c5af7e54f459e2bbde20ca6a7e
treea66664ea5f4d51c8c1b92033843d5d75f50d7cef
parent646d77d8156ad72da1c24f734a029a525ba4bed9
ui/ncurses: Reset console options on boot

The ncurses UI sets a few console options at startup that are needed for
ncurses to work properly. These aren't reset however and can lead to
quirks like the cursor being invisible after kexecing to the next
kernel.
The UI process doesn't have time to reset these when it is killed by
kexec, so instead add a 'boot_active' field to status updates. This is
set by boot.c's update handler so the UI can assume it is about to boot
if it receives a status update with this field, and resets the console
options. If the boot is cancelled for any reason the status update will
reflect that and the console options are restored.

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
discover/boot.c
discover/device-handler.c
lib/pb-protocol/pb-protocol.c
lib/types/types.h
ui/ncurses/nc-cui.c
ui/ncurses/nc-cui.h