1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-16 20:21:32 +03:00
Commit Graph

152 Commits

Author SHA1 Message Date
Samuel Dionne-Riel
2ab969db37 boot: LUKS errors are "controlled"
This means that we shouldn't raise an exception, but rather fail
outright. The background being black means that things *failed
successfully*, as expected.
2020-11-30 20:45:03 -05:00
Samuel Dionne-Riel
fd0a9856bd boot/init: publish desire for recovery mode 2020-11-22 16:53:03 -05:00
Samuel Dionne-Riel
67957f4972 boot/init: Move recovery detection to an abstraction layer 2020-11-22 16:53:03 -05:00
Samuel Dionne-Riel
ff9d66713e boot/splash: Update UI before executing commands
Otherwise we might miss the last message, which may include things to
present to the user, e.g. the label "Continuing to ..."
2020-11-22 16:53:03 -05:00
Samuel Dionne-Riel
cfba499677 boot/splash: Add recovery notification support
To be shown, the publisher has to publish the `recovery` value.
2020-11-22 16:53:03 -05:00
Samuel Dionne-Riel
841b835b05 boot/init: update comments in switch_root
It better describes the reasoning for the keys than the previous
"off-the-cuff" comment I left myself.
2020-11-22 16:48:32 -05:00
Samuel Dionne-Riel
ae9ce35a90 boot/lib: Implement evdev query through FFI 2020-11-22 16:48:32 -05:00
Samuel Dionne-Riel
5928902108 boot/lib: add generated linux input event codes
This could be done a build-time, but it's not like we actually need it
to be the freshest ever.

We're free to update it whenever.
2020-11-22 16:48:32 -05:00
Samuel Dionne-Riel
65d570144f boot/misc: Add script to generate linux input event codes 2020-11-22 16:48:32 -05:00
Samuel Dionne-Riel
0037614821 boot/init: Use the new evdev library
It still uses evdev internally, but first let's change the interface,
*then* change the implementation details.
2020-11-22 16:48:32 -05:00
Samuel Dionne-Riel
f2d1cf95b2 boot/applets: Remove last applet (key-held)
It'll be, at first, bundled-in as-is in a library, then re-done through
evdev ffi.
2020-11-22 16:48:32 -05:00
Samuel Dionne-Riel
b2a54941de boot/splash: Focus on the text area
This allows keyboard input to be sent to it, thus supporting passphrase
input using a physical keyboard.

Additionally, don't show the focus ring on the only element.
2020-11-22 16:45:25 -05:00
Samuel Dionne-Riel
263d6713c9 boot/error: Give a choice for the next action to the end-user 2020-11-13 19:46:44 -05:00
Samuel Dionne-Riel
8d182d07d2 boot/error: Rework UI for better reporting
First, right now we're putting the full error message front and center,
rather than the sad phone.

We're keeping the sad face though, but only as an accent icon.

Finally, not part of this PR, we'll add actions to abort a total crash.
2020-11-13 19:46:44 -05:00
Samuel Dionne-Riel
dbfbdf385b boot/init: Add error title in addition to code 2020-11-12 23:13:20 -05:00
Samuel Dionne-Riel
889ebd4700 boot/error: Add time left for the delay 2020-11-12 23:13:20 -05:00
Samuel Dionne-Riel
bb6a7ddc5f boot/error: Add a tangible derivation
This also allows us to add library files.
2020-11-12 23:13:20 -05:00
Samuel Dionne-Riel
407ff11b26 boot/error: Minimal viable changes for structured data
The applet isn't any more graceful yet, but this is where things can
finally get interesting.
2020-11-12 23:13:20 -05:00
Samuel Dionne-Riel
03022f2745 boot/init: Pass structured data through a file to crash handler
The command-line arguments are not great for structured data.
2020-11-12 23:13:20 -05:00
Samuel Dionne-Riel
aa1c2f3744 boot/init: Harmonized failure methods
- Code is now more of a title
 - Only one code path exists to the applet
2020-11-12 23:13:20 -05:00
Samuel Dionne-Riel
e6778f8370 boot/recovery-menu: extract reboot modes 2020-11-12 23:13:20 -05:00
Samuel Dionne-Riel
00f81fa95c boot/init: Handle hung tasks
The way we're handling them is to have a global timer that is reset at
any point a task is ran.

This gives a maximum amount of chances to any task to have its
dependencies resolve.

A minimum of 60s is given, but in reality the chances are the conditions
for trying to resolve were already present before the timeout started
counting towards that particular dependency.

Note that a long running task, when successfully ran, does not cause the
timeout to be reached.

E.g. at 10s of timeout a task is started, the loop is not executed until
the task exits. When it exits the branch followed is for a task that
ran, which means that even if the task took 70s total (which gives us 80
seconds) a timeout of 60s wouldn't apply here.

Though, please, don't make your tasks take that much time to run!
2020-11-07 20:13:31 -05:00
Samuel Dionne-Riel
d41c454514 boot/init: Add Devices dependency type
It's a Files dependency, but with just a bit more user friendliness when
used in an error message.
2020-11-07 20:13:31 -05:00
Samuel Dionne-Riel
31f45c5baa boot/init: Add user-friendlier names to dependencies 2020-11-07 20:13:31 -05:00
Samuel Dionne-Riel
a819a8930e boot/init: Cleanup failure
- exit after everything happened, just in case
 - exit the progress display
 - allow a custom delay to be set
2020-11-07 20:13:31 -05:00
Samuel Dionne-Riel
36aa305f27 boot/init: Add LUKS device support 2020-11-07 19:22:33 -05:00
Samuel Dionne-Riel
f45b5b301c boot/init: Implement asking user 2020-11-07 19:22:33 -05:00
Samuel Dionne-Riel
eaf8fa9dde boot/init: Long running tasks can export a label
With the same tooling we will be able to ask for a throbber or some
other kind of work indicator.
2020-11-07 19:22:33 -05:00
Samuel Dionne-Riel
c80476a047 boot/init: Rework Progress into a "state stash"
This way we really only update the current state bit we want to affect.
2020-11-07 19:22:33 -05:00
Samuel Dionne-Riel
e891e2f752 boot/init: Minimal changes required to continue working
These changes implement the different protocol changes.
2020-11-07 19:22:33 -05:00
Samuel Dionne-Riel
7b477b9ca5 boot/splash: Allow textual questions to be asked
For now, extremely assumed to be passphrase input.
2020-11-07 19:22:33 -05:00
Samuel Dionne-Riel
665d58a7cd boot/splash: Add textarea and keyboard, allowing text input
The following commit will plug it into the messages queue.
2020-11-07 19:22:33 -05:00
Samuel Dionne-Riel
1f93066e89 boot/splash: Ensure no funny business if given bogus progress bar values 2020-11-07 19:22:33 -05:00
Samuel Dionne-Riel
5755438dfa boot/splash: Add wrappers around text area and keyboard
They will, at some point, be promoted into LVGUI. For the time being
they are local as they have only been verified to work in a useful
manner for this limited use case.
2020-11-07 19:22:33 -05:00
Samuel Dionne-Riel
71149eb01d boot/splash: Ensure cover doesn't intercept events 2020-11-07 18:26:47 -05:00
Samuel Dionne-Riel
a50f838e13 boot/recovery-menu: Add missing file 2020-11-06 16:30:22 -05:00
Samuel Dionne-Riel
d929d798fe boot/init: auto-resize task shows a message 2020-11-06 16:30:22 -05:00
Samuel Dionne-Riel
bd030cbe73 boot/init: Add required plumbing to control the forked process 2020-11-06 16:30:22 -05:00
Samuel Dionne-Riel
9b85943be1 boot/init: Add progress tracking 2020-11-06 16:30:22 -05:00
Samuel Dionne-Riel
6cd2985bc1 boot/splash: Implement progress status display
The splash is now an application that should be started and forked from.
Once started, it will listen for messages on a ZeroMQ socket reporting
progress.

The current protocol is extremely simple, reporting (optional) label,
and reporting a progress amount.

Additionally, it responds to a string commant ("quit") to quit as
needed.
2020-11-06 16:30:22 -05:00
Samuel Dionne-Riel
fb4984cb90 s/boot-gui/boot-recovery-menu/g
The applet is specifically written to show what we call the "recovery
menu". Yes, it's also the boot selection, but it will get confusing with
the upcoming boot tracking splash UI that's upcoming.
2020-10-27 15:23:40 -04:00
Samuel Dionne-Riel
16b96cb5fb boot/script-loader: Add mruby-zmq
This will be used by the upcoming progress-tracking feature.
2020-10-27 15:23:40 -04:00
Samuel Dionne-Riel
ef436a64b1 boot/init: More verbose tasks loop in DEBUG 2020-10-27 15:23:40 -04:00
Samuel Dionne-Riel
99a7671769 boot/init: Ensure graphics setup is also a UX priority 2020-10-27 15:23:40 -04:00
Samuel Dionne-Riel
0365079e1f boot/init: Tasks restart the queue
This is to ensure "UX-friendly" tasks gets run ASAP.

Quickly explained, this makes sure that the top tasks (e.g. Splash) gets
ran as soon as possible.

Given the list:

 - Splash
 - Graphics
 - AAA
 - BBB
 - CCC

If `Graphics` ends up running, and AAA, BBB and CCC can too, Splash will
have to wait until all those tasks got ran once!

Not ideal for UX, if e.g. BBB takes time to *run* and we can't show the
progress to users!

The added cost of restarting the queue is minimal with tests I ran. It
was not more than a tenth of a second, and could even be rounding
errors.
2020-10-27 15:23:40 -04:00
Samuel Dionne-Riel
2542487348 boot/init: Improve Task#to_s for better inspection 2020-10-27 15:23:40 -04:00
Samuel Dionne-Riel
cf84880e87 boot/init: clean-up logger initialization 2020-10-27 15:23:40 -04:00
Samuel Dionne-Riel
1cee1c681b boot/init: Log offset from logger init
This gives us a better idea, relatively, when things happen to be
logged.
2020-10-27 15:23:40 -04:00
Samuel Dionne-Riel
cf49659fe3 boot/init: Add CLOCK_MONOTONIC output at boot 2020-10-27 15:23:40 -04:00
Samuel Dionne-Riel
2f87df4121 init: Add mruby-process-clock_gettime to script-loader 2020-10-27 15:23:40 -04:00