New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Graphical boot selection #80
Merged
samueldr
merged 38 commits into
NixOS:master
from
samueldr-wip:feature/boot-selection-gui
Mar 1, 2020
Merged
Graphical boot selection #80
samueldr
merged 38 commits into
NixOS:master
from
samueldr-wip:feature/boot-selection-gui
Mar 1, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This will be used by `makeBin` so that using mrbgems requiring external dependencies stays ergonomic.
This ensures no dependencies for a gem end up after `mruby-require`. This is important since anything after `mruby-require` is implicitly built as a shared library.
See the patch for more context.
Useful for development purposes, mainly.
This needs the following commits where the init script will now tell the loader to load init.mrb
samueldr
force-pushed
the
feature/boot-selection-gui
branch
from
February 29, 2020 05:16
96a3c7a
to
6258e64
Compare
It can be a recovery image after all!
That recovery image unconditionally assumes it's running as recovery
samueldr
force-pushed
the
feature/boot-selection-gui
branch
from
February 29, 2020 21:10
6258e64
to
20f2cbc
Compare
samueldr
force-pushed
the
feature/boot-selection-gui
branch
from
February 29, 2020 22:39
296ac1b
to
e7e28fa
Compare
This was referenced Mar 1, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds a GUI allowing the user to select a generation.
The current GUI is expected to be run as the "recovery" image.
This is only the most basic implementation. It does not allow
kexec
ing another kernel. It only allows selecting a generation. Though, as basic as it is, it allows further on-device tinkering to be done much more safely.This even gives a pseudo-AB system for non-AB systems. The user can flash a new boot.img on top of their boot partition, and if it fails to boot, boot to the system using the recovery menu.
Implementation notes
To reduce the footprint of the init, this splits the
init
"script" from the interpreter, as previously implemented. This means we now unconditionally use the wrapper script to exec the init.Splitting the interpreter does allow us to add more "applets". Those "applets", in turn, allow us to add more in-depth applications implemented using the same scripting environment.
The GUI is implemented using mruby-lvgui, a set of bindings for LittlevGL.
Other notable changes
The mruby builder infrastructure is a bit sturdier. Rather than rely on a user-provided list of flags, for the final "stub" build, it uses saved information from the actual build. No flags should be missing.
Additionally, the stub now documents
ARGV
and$PROGRAM_NAME
. This, in turn, allows scripts written using mruby to parse arguments. Quite necessary.To implement later:
Async boot selection with multiple agentsDefine the "agents" speckexec
into another kernel+initrdKeyboard control for Boot GUIThis will be required for pinebook-pro usage (which is a goal). It could also be nice with volume up/down + power for phones with broken digitizers. This can be merged without keyboard control support as it's not causing a regression.
Mouse control for Boot GUIIn theory it's supported, in practice it's not. LVGL supports mouse input. It seems the evdev driver only supports touch input, though this is unverified. This would be required for QEMU, and helpful for laptop use.
To implement quickly:
This is to be used on e.g. chromeos tablets, or non-android systems (e.g. pinephone, pinebook pro). Holding one of [volume up, volume down, right control, left control] should act as if recovery was requested.
Better split init from script loaderRight now they still live in the same folder. A small mark of their past.
Fix and make available the "simulator"There is a "simulator" for the boot GUI. This is how it was developed, not on-device, but in a window. It seems something happened and it doesn't work quite right anymore. This needs to be investigated, and fixed. Then, once fixed, be made available for easier development/testing.
Future somewhat related improvements
lvgui
use lvgui exclusivelyRemove
ply-image
dependency, and use lvgui exclusively to show splash, and to show error states.Benefits: