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

176 Commits

Author SHA1 Message Date
Samuel Dionne-Riel
1c29d2d643 boot/init: Disable device wait when set to 0 2024-03-27 20:31:10 -04:00
Samuel Dionne-Riel
1e06638c17 boot/init: SwitchRoot: prep for stage-0 deprecation
For now, only moves the code to make it obvious which parts are for
stage-0.
2024-03-06 21:25:42 -05:00
Samuel Dionne-Riel
cbc35593db boot/init: Make generation facts and paths easier to work with
Mainly, this aims to reduce the impedance mismatch between path
as-seen-in-stage-1 and paths-according-to-stage-2.

Now, two helpers, one using the other, are used to properly telegraph
the intent when using a file path.

With this, reading `nixos-version` was also fixed.
2024-03-06 21:25:42 -05:00
Samuel Dionne-Riel
e6c87f4d8f boot/init: Make symlink handling easier to grok 2024-02-28 22:51:39 -05:00
Samuel Dionne-Riel
c98de5f525 boot/init: Simplify generation listing code
This still needs more, but it's coming...
2024-02-28 22:34:21 -05:00
Samuel Dionne-Riel
26bff46678 boot/init: Be more verbose about selected generation
Also improve the comment
2024-02-28 22:23:01 -05:00
Samuel Dionne-Riel
489b89e980 boot/init: Drop "Mobile" from generation button labels 2024-02-28 21:34:36 -05:00
Samuel Dionne-Riel
7f2aa84982 boot/init: Drop largely unused @target member in SwitchRoot 2024-02-28 21:14:29 -05:00
Samuel Dionne-Riel
d734a57aa5
Merge pull request #613 from samueldr-wip/feature/kernel-logo-as-early-splash
Use the kernel logo feature as early splash
2023-05-05 16:11:08 -04:00
Samuel Dionne-Riel
f5d45fb35f
Merge pull request #583 from samueldr-wip/feature/misc-cleanups
boot: Misc. cleanups
2023-05-05 15:51:33 -04:00
Samuel Dionne-Riel
ffdc031b2c boot/init: Make FBDev a no-op
... this way, the framebuffer content is not evicted by a needless mode
change.

AFAIK none of our targets will be affected by this change. The
framebuffer should already be setup with the correct mode. This was
holdover from early early cargo-culting about the framebuffer.

I have verified on a few devices, it does not worsen their behaviour.
2023-05-03 21:51:19 -04:00
Samuel Dionne-Riel
3959529d85 boot/init: Fix mount regression from option added for systemd-boot
A NixOS change for systemd-stage-1 added an `x-` mount option, which is
not handled well by busybox mount.

 - 1b39491326

The same option was not an issue for the shell-script stage-1 as it
already stripped `x-` mount options

 - 8be838254b/nixos/modules/system/boot/stage-1-init.sh (L365-L366)

Thus it's assumed safe to strip the options the same way.
2023-03-22 16:21:22 -04:00
Samuel Dionne-Riel
9a0c317a02
Merge pull request #587 from samueldr-wip/feature/crypsetup-args
boot/init: Honor some cryptsetup arguments
2023-03-03 16:39:24 -05:00
Samuel Dionne-Riel
bf43312242 boot/init: Add support for bypassWorkqueues 2023-03-03 13:55:04 -05:00
Samuel Dionne-Riel
5945a7e957 boot/init: Add support for allowDiscards
Fixes #578
2023-03-03 13:55:04 -05:00
Samuel Dionne-Riel
a66bd290fe boot/init: Handle additional cryptsetup arguments 2023-03-03 13:55:04 -05:00
Samuel Dionne-Riel
2d3a3d67dc boot/init: Pass down luks device arguments 2023-03-03 13:55:04 -05:00
Samuel Dionne-Riel
ea12a06e01 boot/init: Add a quirk to wait on USB devices to settle
This is useful for devices with USB, where input devices may take a
short while before showing up.

With this, external USB keyboard passphrase input is reliable in the
limited testing I did.
2023-03-03 10:32:47 -05:00
Samuel Dionne-Riel
50bd07f404 boot/init: Tear down udevd
This fixes amdgpu suspend/resume on Steam Deck.
2023-03-02 14:05:55 -05:00
Samuel Dionne-Riel
518d22bbf3 boot/init: Use a private procfs mount for mount points
Better than doing the wildly weird thing of mounting/unmounting to peek,
and it doesn't leave a stray mountpoint after switch_root.

Why not depend on `/proc` or keep it mounted? Mainly because of the
mount options. I don't want to deal with it when it is being handled
through the mount tasks.
2023-03-02 00:23:00 -05:00
Samuel Dionne-Riel
bc8ccc2424 boot/init: Prefer System.symlink
This one is logged.
2023-03-01 21:56:03 -05:00
Samuel Dionne-Riel
f3ac03097c boot/init: Include backtrace in exception failure 2022-10-21 16:53:55 -04:00
Samuel Dionne-Riel
45802604c9 boot/init: Always build with backtrace info 2022-10-21 16:53:05 -04:00
Samuel Dionne-Riel
135c063420 boot: switch_root: Ensure /run/boot exists before writing to it 2022-10-16 01:20:44 -04:00
Samuel Dionne-Riel
59e3d0386d boot: Don't fail if we can't tell the kernel about modprobe
(cherry picked from commit 8db27e0c56b3934ebced48a10d749bf24d8cb6e1)
2022-10-16 01:11:37 -04:00
Samuel Dionne-Riel
2f0095af8a boot: switch_root: Explain how generation was selected
(cherry picked from commit f508a8df1daba81f689db7c6f181d223ea2d60c7)
2022-10-16 01:11:37 -04:00
Samuel Dionne-Riel
e4414042bc boot: switch_root: Ignore bogus init parameter
These will be provided by proprietary bootloader (e.g. google-blueline),
and cannot be removed.

Thus we'll ignore any bogus parameter.

(cherry picked from commit c961ca142650fead3c3b565cfc59f8ae0662d771)
2022-10-16 01:11:37 -04:00
Samuel Dionne-Riel
cc0385dd9c boot/init: Autoresize wait for graphics
This way this time-consuming step is guaranteed to be properly shown to
the end-user.
2022-10-13 15:28:51 -04:00
Samuel Dionne-Riel
67ab49a2cb boot/init: Add debug info flag to mrbc 2022-10-12 22:00:56 -04:00
Samuel Dionne-Riel
5bd7e6bbfc init: Fix kexec condition in SwitchRoot
In #300 I "fixed" stage-0 by adding a switch to toggle between it being
enabled and disabled in the recovery menu. *That* works as expected.

In 2a46962d76 one can observe that the
`#will_kexec?` method will use data that will only come from the
`choice` made from the recovery interface. The `@use_generation_kernel`
member is not set at any other point.

With ruby semantics, this means that the `if` is false, so *unless* you
choose to boot using the recovery menu, it will never trigger `kexec`.

Why has this gone through this way? Most likely because my main testing
target was configured so it *always* went to the recovery menu at the
time, meaning that I never saw the default behaviour.
2022-07-31 16:08:39 -04:00
Samuel Dionne-Riel
badf9239e7 boot/init: Kill splash after 10 seconds without it exiting 2022-05-29 22:39:11 -04:00
Samuel Dionne-Riel
ba3ee779d0 boot/init: Make switch_root depend on Splash 2022-05-29 22:39:11 -04:00
Samuel Dionne-Riel
dc63801179 boot/init: Fix System.which logic
- A missing program in a single directory shouldn't error out
 - A program missing from all directories should return nil
2022-05-29 22:39:11 -04:00
Samuel Dionne-Riel
e3c0bf815d boot/init: Mount is fulfilled if anything is mounted at target
It's extremely unlikely something wrong is mounted at the target.
2022-05-29 22:39:11 -04:00
Samuel Dionne-Riel
a10ae8ac24 boot/init: Add Mounting.mountpoint?
It checks whether a specified path is a mountpoint.
2022-05-29 22:39:11 -04:00
Samuel Dionne-Riel
4cde41159e boot/init: Improve failed tasks printout
Dependencies count is now only for the failed dependencies.

List tasks with their dependencies, instead of context-free
dependencies.
2022-05-29 22:39:11 -04:00
Samuel Dionne-Riel
84891e4d55 boot/init: Respect init= for upstream NixOS compatibility
We're stripping `init` to add it back next... A bit wasteful, but this
keeps things compatible.
2022-05-29 22:39:11 -04:00
Samuel Dionne-Riel
7f5bf77865 boot/init: Fix Splash#quit when splash is not running 2022-05-29 22:39:11 -04:00
Samuel Dionne-Riel
4724762ca6 boot/init: Refresh LVM for mount task
Devices may have appeared.
2022-05-29 22:39:11 -04:00
Samuel Dionne-Riel
63ef32769f boot/init: LUKS task depends on splash
This is needed for passphrase input.
2022-05-29 22:39:11 -04:00
Samuel Dionne-Riel
ee151c8cd5 boot/init: Mark udev as required for graphics
With modular kernels, it may be that kernel modules need to be loaded
"automatically" by udev for things to work correctly, like input.
2022-05-29 22:39:11 -04:00
Samuel Dionne-Riel
a97c094f65 boot/init: Make Graphics target depend on Modules
This ensures any modules needed for the splash are loaded beforehand.

Also notify the kernel about the modprobe binary.
2022-05-29 22:39:11 -04:00
Samuel Dionne-Riel
a87672b761 boot/init: Try probing kernel module for filesystem
This is needed for modular kernels, unless we want to load all
filesystem modules all the time!
2022-05-29 22:39:11 -04:00
Samuel Dionne-Riel
32f86364a1 boot/init: Make udev a dependency for the switch root target
In some instances, e.g. really slow CPU, udev might not have run, and
libinput will not be able to work appropriately.

That is because uevent files will be missing.
2021-02-20 16:40:38 -05:00
Samuel Dionne-Riel
f0a7e33767 boot/init: switch root forwards FDT properties as needed 2021-02-11 18:15:34 -05:00
Samuel Dionne-Riel
b667d2298f boot/init: kexec now uses generation DTB if possible
Fixes #264
2021-02-11 18:15:23 -05:00
Samuel Dionne-Riel
2a46962d76 boot/init: Honor skipping kexec 2021-02-11 18:14:30 -05:00
Samuel Dionne-Riel
5d50144468 boot/recovery-menu: Pass data around using JSON 2021-02-11 18:14:30 -05:00
Samuel Dionne-Riel
225ed39dad Fix stdenv.lib being removed
Deals with https://github.com/NixOS/nixpkgs/pull/111284
2021-02-02 05:51:18 -05:00
Samuel Dionne-Riel
76b5e79ca5 boot/init: Add System.umount() 2021-01-27 19:09:07 -05:00