mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-20 04:19:00 +02:00
Merge pull request #209964 from Majiir/fix-initrd-systemd-closure
nixos/systemd/initrd: follow init param symlinks
This commit is contained in:
commit
99587a3411
|
@ -518,7 +518,7 @@ in {
|
||||||
case $o in
|
case $o in
|
||||||
init=*)
|
init=*)
|
||||||
IFS== read -r -a initParam <<< "$o"
|
IFS== read -r -a initParam <<< "$o"
|
||||||
closure="$(dirname "''${initParam[1]}")"
|
closure="''${initParam[1]}"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
@ -529,6 +529,13 @@ in {
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Resolve symlinks in the init parameter. We need this for some boot loaders
|
||||||
|
# (e.g. boot.loader.generationsDir).
|
||||||
|
closure="$(chroot /sysroot ${pkgs.coreutils}/bin/realpath "$closure")"
|
||||||
|
|
||||||
|
# Assume the directory containing the init script is the closure.
|
||||||
|
closure="$(dirname "$closure")"
|
||||||
|
|
||||||
# If we are not booting a NixOS closure (e.g. init=/bin/sh),
|
# If we are not booting a NixOS closure (e.g. init=/bin/sh),
|
||||||
# we don't know what root to prepare so we don't do anything
|
# we don't know what root to prepare so we don't do anything
|
||||||
if ! [ -x "/sysroot$(readlink "/sysroot$closure/prepare-root" || echo "$closure/prepare-root")" ]; then
|
if ! [ -x "/sysroot$(readlink "/sysroot$closure/prepare-root" || echo "$closure/prepare-root")" ]; then
|
||||||
|
|
Loading…
Reference in a new issue