don't hardcode mtd0 initramfs->second stage

This commit is contained in:
Daniel Barlow 2023-04-10 22:53:56 +01:00
parent 0a2881914b
commit 0ad7b0e48b

View file

@ -47,9 +47,18 @@ in
slashinit = pkgs.writeScript "init" '' slashinit = pkgs.writeScript "init" ''
#!/bin/sh #!/bin/sh
exec >/dev/console exec >/dev/console
echo IT MOVES echo Running in initramfs
mount -t proc none /proc mount -t proc none /proc
mount -t jffs2 mtd0 /target/persist set -- $(cat /proc/cmdline)
for i in "$@" ; do
case "''${i}" in
root=*)
rootdevice="''${i#root=}"
;;
esac
done
echo mount -t jffs2 ''${rootdevice} /target/persist
mount -t jffs2 ''${rootdevice} /target/persist
mount -o bind /target/persist/nix /target/nix mount -o bind /target/persist/nix /target/nix
sh /target/persist/activate /target sh /target/persist/activate /target
cd /target cd /target