liminix/pkgs/preinit
Raito Bezarius 17355c3911 fix(preinit): scan multiple times the cmdline and rename altroot in rootalt
The way the parsing works is examining one character at a time.

First, if we had `rootfstype=... root=...`, the parsing would jump and
ignore `root=...`, which sucks.

To fix this, we scan multiple times a copy of the cmdline.

Now, we have a new problem: `root=... altroot=...` lead to opts.device
being equal to the altroot as we are looking one char at a time, so we
will arrive at a moment looking at `root=...` for `altroot=...`.

To avoid this, we rename `altroot` in `rootalt`, cheap, I know.

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-01 17:48:54 +02:00
..
default.nix preinit: parse rootfstype from kernel command line 2023-10-19 18:56:09 +01:00
Makefile preinit: fix compiler warnings 2023-11-05 11:27:43 +00:00
opts.h feat(preinit): support alternative roots 2024-04-21 17:26:37 +02:00
parseopts.c fix(preinit): scan multiple times the cmdline and rename altroot in rootalt 2024-09-01 17:48:54 +02:00
preinit.c feat(preinit): support alternative roots 2024-04-21 17:26:37 +02:00
shell.nix preinit: parse rootfstype from kernel command line 2023-10-19 18:56:09 +01:00