1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-11 09:04:01 +03:00
Commit Graph

390 Commits

Author SHA1 Message Date
Samuel Dionne-Riel
b4c603bc56 boot/init: Tear down usb gadget on kexec
Yikes, specialized code in the kexec codepath... though this is okay for
now. Let's not over-generalize when we don't know what will be required
in the future for abstraction.
2021-01-03 20:23:44 -05:00
Samuel Dionne-Riel
2d3ba8d21d boot/init: Add System.delete() to delete files or directories 2021-01-03 20:23:44 -05:00
Samuel Dionne-Riel
19ff65e821 boot/lib: Remove accidentally left puts 2021-01-02 00:55:21 -05:00
Samuel Dionne-Riel
2fefc0ae5b boot/splash: Fixes for extracted libs
And additionally review how it's built.
2021-01-01 21:37:30 -05:00
Samuel Dionne-Riel
dc809d47bd boot/lib: Import splash components in lvgui 2021-01-01 21:37:30 -05:00
Samuel Dionne-Riel
7cd9acd991 boot/splash: Remove useless var 2021-01-01 21:37:30 -05:00
Samuel Dionne-Riel
966f000c5d boot/error: Use extracted reboot mode hal 2021-01-01 21:37:30 -05:00
Samuel Dionne-Riel
562ddc1272 boot/recovery-menu: Use extracted reboot mode hal 2021-01-01 21:37:30 -05:00
Samuel Dionne-Riel
50a2a08e09 boot/lib: Extract reboot modes lib 2021-01-01 21:37:30 -05:00
Samuel Dionne-Riel
a12e4314dc boot/recovery-menu: Use extracted configuration lib 2021-01-01 21:37:30 -05:00
Samuel Dionne-Riel
d0ad7a8a20 boot/init: Use extracted configuration lib 2021-01-01 21:37:30 -05:00
Samuel Dionne-Riel
af9912ef81 boot/lib: Import init configuration lib 2021-01-01 21:37:30 -05:00
Samuel Dionne-Riel
3cde402440 boot/init: Use extracted monkey patches 2021-01-01 21:37:30 -05:00
Samuel Dionne-Riel
e6e4e228a4 boot/lib: Move init monkey patches 2021-01-01 21:37:30 -05:00
Samuel Dionne-Riel
b50024f29b boot/error: describe libraries used 2021-01-01 21:37:30 -05:00
Samuel Dionne-Riel
45a4835ebe boot/recovery-menu: describe libraries used 2021-01-01 21:37:30 -05:00
Samuel Dionne-Riel
bec41be25b boot/splash: describe libraries used 2021-01-01 21:37:30 -05:00
Samuel Dionne-Riel
6ca59e8cfb boot/init: Describe specific libraries to include 2021-01-01 21:37:29 -05:00
Samuel Dionne-Riel
4b0a275cc1 boot/splash: Fixes for script-loader changes 2021-01-01 21:37:29 -05:00
Samuel Dionne-Riel
74498792ee boot/recovery-menu: Fixes for script-loader changes 2021-01-01 21:37:29 -05:00
Samuel Dionne-Riel
d18d3615e6 boot/script-loader: Use the mruby-lvgui-native-fragment 2021-01-01 21:37:29 -05:00
Samuel Dionne-Riel
447d8d59e7 boot/script-loader: Add mruby-lvgui-native-fragment 2021-01-01 21:37:29 -05:00
Samuel Dionne-Riel
ffc4a12fa1 boot/lib: Import lvgui ruby implementation 2021-01-01 21:37:29 -05:00
Samuel Dionne-Riel
b88d2565ee boot/lib: Stash evdev lib in a folder 2021-01-01 21:37:29 -05:00
Samuel Dionne-Riel
b33afce1a0 boot/init: Re-format mrbc invocation 2021-01-01 21:37:29 -05:00
Samuel Dionne-Riel
e88ace2a3e boot/init: switch_root keeps selected generation in stage-0 2020-12-29 17:59:09 -05:00
Samuel Dionne-Riel
e9dba7afb9 boot/init: Fix logic in symlink resolution 2020-12-27 17:50:30 -05:00
Samuel Dionne-Riel
ebd095e019 boot/init: AutoResize only if needed 2020-12-27 17:50:30 -05:00
Samuel Dionne-Riel
22ba517ac8 boot/init: Control the splash fades for kexec 2020-12-27 17:50:30 -05:00
Samuel Dionne-Riel
fa4804e67d boot/init: Add kernel cmdline helper 2020-12-27 17:50:30 -05:00
Samuel Dionne-Riel
cb0d21d2fc boot/init: booting from kexec communicated using cmdline 2020-12-27 17:50:30 -05:00
Samuel Dionne-Riel
200e5aac1b boot/init: Kexecing keeps the splash as-is 2020-12-27 17:50:30 -05:00
Samuel Dionne-Riel
b82492a565 boot/init: Use kexec only in stage-0. 2020-12-27 17:50:30 -05:00
Samuel Dionne-Riel
eed796865e boot/init: Use configurable stage value 2020-12-27 17:50:30 -05:00
Samuel Dionne-Riel
6ad92214da boot/init: switch_root can and will kexec
This is partly complete; we need to handle the situation where **only**
stage-0 should kexec into the next system.

This is yet to be implemented, but will be done through a configuration
that transforms the current bootloader-launched stage-1 into a stage-0,
while keeping the on-disk stage-1 stage-1.
2020-12-27 17:50:30 -05:00
Samuel Dionne-Riel
812b02dd32 boot/init: Fix partial teardown for splash
`#quit` would leave the `@pid` variable around, which in turn meant that
calling `#kill` after would fail since the process was already gone.
2020-12-27 17:50:30 -05:00
Samuel Dionne-Riel
ad4efeff2f boot/splash: Allow skipping fade-out (sticky) 2020-12-27 17:50:30 -05:00
Samuel Dionne-Riel
bece0564d8 boot/splash: Allow skipping fade-in 2020-12-27 17:50:30 -05:00
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
Samuel Dionne-Riel
1c720aa1b1 boot/gui: Use HAL configs for reboot options
This way we can clean up the recovery menu from useless options.

Furthermore, if a device in the future gives us more option, we can
implement them.
2020-10-15 22:08:25 -04:00
Samuel Dionne-Riel
b42063fe70 boot/gui: Fix for new back button implementation 2020-07-25 21:56:50 -04:00
Samuel Dionne-Riel
55938bab90 boot/gui: Rely on the GUI builder 2020-07-23 19:21:50 -04:00
Samuel Dionne-Riel
659b627d6e script-loader: ensure anything lvgui needs is provided...
...by loading it last
2020-07-23 18:07:45 -04:00
Samuel Dionne-Riel
9f50617ba7 boot/gui: Fix cross-compilation breakage
Turns out that `mruby`'s require looks at the actual file name (not the
link) when deciding between loading bytecode or ruby code.

Cross-compilation appends the system to derivation names.

Fun ensues.

This fixes the issue by using `runCommand`, for which it doesn't happen.
2020-06-26 17:38:12 -04:00
Samuel Dionne-Riel
b38caeec1a boot/init: Fixup for $PROGRAM_NAME now pointing to the applet
We know that the loader is at "/loader" in our initrd. Use that
knowledge.
2020-05-31 18:54:07 -04:00
Samuel Dionne-Riel
6d6df159ef boot/script-loader: Add environment support to wrapper 2020-05-31 18:54:07 -04:00
Samuel Dionne-Riel
dfedfda949 boot/script-loader: Provide appropriate $0 and $PROGRAM_NAME 2020-05-31 18:54:07 -04:00
Samuel Dionne-Riel
d617424ded boot/gui: review build with a proper derivation
Then, the simulator is re-tooled to use it, and the new wrapper thingy.
2020-05-31 18:54:07 -04:00
Samuel Dionne-Riel
21b17451b2 boot/init: add wrap to script-loader
This allows wrapping an applet into a script that will start it.
2020-05-31 18:54:07 -04:00
Samuel Dionne-Riel
ba9a9852af boot/init: Remove unused variable 2020-05-23 01:43:12 -04:00
Samuel Dionne-Riel
3e50ec600f boot/gui: review simulator build
Can be launched with `DEBUGGER="gdb --args" ./result/bin/simulator`.
2020-05-23 01:43:12 -04:00
Samuel Dionne-Riel
528c8b8bdb boot/gui: Further fix applets for LVNanoSVG namespace change 2020-05-21 18:15:21 -04:00
Samuel Dionne-Riel
aa2deb72b6 boot/gui: Fix with added introspection 2020-05-19 23:27:36 -04:00
Samuel Dionne-Riel
cc1a2e75e5 boot/gui: Moving LVNanoSVG hacks under the hacks namespace 2020-05-18 21:49:04 -04:00
Samuel Dionne-Riel
6692f6d6f4 boot/init: Use the new error reporting applet 2020-03-09 19:45:49 -04:00
Samuel Dionne-Riel
b2f4aecdd4 boot/error: Init error reporting applet 2020-03-09 19:44:27 -04:00
Samuel Dionne-Riel
c35116cdcd boot/init: Use the new boot/splash applet 2020-03-09 17:34:31 -04:00
Samuel Dionne-Riel
426f31113d boot/splash: Init splash applet 2020-03-09 17:31:03 -04:00
Samuel Dionne-Riel
8fad3b296e boot/gui: Use mruby that will splice
Using `loader.mruby` will not splice :(
2020-03-08 17:05:15 -04:00
Samuel Dionne-Riel
9c8e1f7d17 boot/gui: Fix console restoring on exit 2020-03-08 17:05:15 -04:00
Samuel Dionne-Riel
a083acef55 boot/gui: Use newly split script loader in simulator 2020-03-01 23:27:56 -05:00
Samuel Dionne-Riel
12c9d29f58 boot/init: Use the newly split script-loader 2020-03-01 23:27:56 -05:00
Samuel Dionne-Riel
11897bcdb6 boot/script-loader: Split into its distinct package 2020-03-01 22:21:31 -05:00
Samuel Dionne-Riel
8594a19538 boot/gui: Use the loader's mruby build
It doesn't change the mrbc end-result.
2020-03-01 22:02:45 -05:00
Samuel Dionne-Riel
e1e1333669 boot/gui: Workaround unexplained issue
It seems that `mruby-time-strftime` here is causing the garbage
collector to fail in strange ways *only* in the simulator.

It's all fine in QEMU and on hardware.
2020-03-01 22:02:19 -05:00
Samuel Dionne-Riel
804182854a boot/gui: Properly dry run commands on simulator 2020-03-01 17:29:30 -05:00
Samuel Dionne-Riel
660804cdf7 boot-gui-simulator: init package 2020-03-01 17:28:50 -05:00
Samuel Dionne-Riel
5e88e7efcf boot/gui: Allow running without generations file
This should *maybe* remove the Generations tab, as it's empty.
2020-03-01 16:58:39 -05:00
Samuel Dionne-Riel
ac95c64c92 boot/gui: Fix bad arguments handling for simulator 2020-03-01 16:58:07 -05:00
Samuel Dionne-Riel
20f2cbcc56 init: Interrupt boot when some keys are held. 2020-02-29 16:10:00 -05:00
Samuel Dionne-Riel
2b2d2ad7ea boot/applets: Add key-held utility 2020-02-29 16:10:00 -05:00
Samuel Dionne-Riel
d79466747d boot/init: Launch boot GUI when asked 2020-02-29 16:10:00 -05:00
Samuel Dionne-Riel
584c484d0c boot/gui: Init boot GUI 2020-02-28 23:14:09 -05:00
Samuel Dionne-Riel
3b9d04d3bd stage-1: workaround issue with e2fsck successfully failing 2020-02-28 23:14:09 -05:00
Samuel Dionne-Riel
26b4215547 boot/init: Add newly required dependencies 2020-02-28 23:14:09 -05:00
Samuel Dionne-Riel
68e4c2b7f3 boot/init: Split interpreter from script
This needs the following commits where the init script will now tell the
loader to load init.mrb
2020-02-28 23:14:09 -05:00
Samuel Dionne-Riel
95016e1250 boot/init: Add autoResize support 2020-02-03 21:58:22 -05:00
Samuel Dionne-Riel
7e9a7875ac boot/init: Mark as 0.1 2020-02-03 21:58:22 -05:00
Samuel Dionne-Riel
c4f76db65f boot/init: Handle remounting existing mounts
This is used to ensure mount points are mounted with the right options,
if for some reason they were already mounted.

Reasons they could be mounted? They could have been required for things
like logging the boot.
2020-02-03 21:58:21 -05:00
Samuel Dionne-Riel
8962b595f5 boot/init: brown sad phone on main failure 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
d349e66554 boot/init: Use System#shell if available on failure
When it is available, it is assumed it is okay to use.
2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
67f907c952 initrd: System.write for login environment tasks 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
75020873c8 initrd: System.write for graphics tasks 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
462a3ae2e7 boot/init: System.write for hard reboot 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
4f83d41d33 boot/init: Add System.write alias
This does the same thing as `File.write`, but with debug logging.
2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
cd963d2b59 boot/init: Allow crashing to bootloader 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
a1e3d231be boot/init: Handle exception to flush logs
Otherwise, it somehow happened that the messages were truncated before
the kernel panic.
2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
c868bcea46 boot/init: Add network interface dependencies 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
711a521f54 boot/init: Allows dependencies as an OR 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
15964966b6 boot/init: Mounts will only wait for absolute paths 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
e41e35a84b boot/init: Fix mounting special filesystems with devices 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
6354a156dd boot/init: Add Dir.children monkey patch 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
cd74c94fde boot/init: De-hardcode /mnt 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
7dff001d75 boot/init: Prefer running UX tasks first
This ensures graphical progress is shown ASAP when dependencies are
equally likely to run.

Otherwise, when the graphical step was ready, and switchroot about to
run, the shell step could run before the splash. This means that, in
practice, a long running task like e2fsck could have prevented the
splash to show. It doesn't make sense to make the other tasks depend on
a splash task!

There is no intention to implement any other special-cased ordering. If
there is the need to, it might mean that there is a deficiency in the
design.
2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
a3c8cd78e8 boot/init: Sort tasks before running them
This is partly to reduce the amount of loops it needs to run, but mainly
to control the order rather than rely on the order they were added in.

The control of order seems weird in a dependency-based system, but it'll
be used mainly for one thing in the next commit...
2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
bdee7cf0e0 boot/init: Removes SingletonTask special dependency
Instead, rely on targets.

Additionally removes the "Boot" special dependency which only made sense
when it was expected that having no dependency was an error.
2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
046dcdc8ea boot/init: Register singleton tasks only once 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
62b7b47117 boot/init: Add System.spawn porcelain 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
0361ccad00 init: Allow adding tasks to boot/init 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
a81afccbb8 cleanup: Move initrd-fail settings in boot/init 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
a6f2195921 boot/init: Return the symlink itself for the generation
Reading the symlink gives a relative path. That's no good in this case.

There is no actual need to resolve the symlink.
2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
01e298eafc boot/init: Make failure to splash not fatal
That is, some devices, notable google-walleye, fail to show the splash
for yet unknown reasons.
2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
30dd9259af boot/init: Fixup bug with System,pretty_command change
The prettified command ended up missing from the debug log.
2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
b887db59c5 boot/init: Add SwitchRoot task 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
75454e4ba5 boot/init: Add System.exec and System.which 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
962b36ec97 boot/init: Implements Target tasks 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
6234128c00 boot/init: misc cleanups 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
3c9b5057c0 boot/init: Handles generic mounting
This implements reading the configuration to know about mount points.
2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
eb15a159de boot/init: Fixup bug in mount task
Welp, == != = !
2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
b804ca6c5f boot/init: Adds graphical failure
Though, not sure I exactly like the way it's done here.
2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
d4571cf9aa boot/init: Use boot.specialFileSystems
This is an internal configuration from NixOS. This is what is used by
the NixOS stage-1 to mount the special filesystems.

It would be dumb not to rely on the same!
2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
de9ca16934 boot/init: udev depends on /sys too 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
7eb1f81b3e boot/init: Allow passing options to System.mount 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
c54aa77911 boot/init: Add Proc tasks 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
694513d9f0 boot/init: Adds missing dependency on /dev
Though, this is only *incidental* in that for using the framebuffer the
/dev/ mount point needs to exist for /dev/fb0 to exist.

The Graphics step will succeed without that, but users of the Graphics
step might not.
2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
62b48d2077 boot/init: Make udev depend on mounts
Rather than cheating with files inside the mount points
2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
3550d694b3 boot/init: Allow a task to depend on a mount point being mounted 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
741b3f3fa7 boot/init: Minor logging rewording 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
8b4ae5b2fc boot/init: Logger is configurable 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
971a7241f6 boot/init: fulfilled -> fulfilled? 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
555548d3f4 boot/init: Review how configuration is loaded and used
This way it can be used at any time, regardless of execution state, as
long as the Configuration module has been parsed.
2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
83df40bc40 boot/init: Add task to load modules 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
24f99c593b boot/init: Rework of task mount 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
d072e6395c boot/init: Use configuration for mount point 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
dea888833a boot/init: misc. cleanups
Mostly removed useless dirs...

Also fixed the hardcoded mountpoint.
2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
583f555f81 boot/init: Now loads configuration file 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
8353f7ea79 boot/init: Minor rework of udev task 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
a6bb2aa3a7 boot/init: Fix printing debug info for unfulfilled Files 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
5208741f3c boot/init: Fix pretty printing shelled out commands 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
293d949648 boot/init: Print mkdir_p for debug 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
9f416471f7 boot/init: Add udevd task 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
4d0c1218f0 boot/init: Guard against global environment pollution 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
d4123fd3e2 boot/init: Allows a task to depend on a specific instance of Task 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
b3e1f2dbac boot/init: Import all tasks, yet allow adding tasks 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
df8cafe832 boot/init: Better tracing in dependencies 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
60a92acbe8 boot/init: Continuously improving POC 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
39d44bf64c boot/init: Continuing extremly POC 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
9d9700cbaf boot/init: Build interpreter with more gems 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
8f01d54b25 boot/init: Load all libraries 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
6f25c1ee3b boot/init: Import ruby shellwords 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
e48bc514c6 init: Extremely WIP POC 2020-02-03 16:19:10 -05:00