extlinux-conf-builder: Make it work on non-DTB systems

With this, boot.loader.generic-extlinux-compatible can be used with
linuxPackages_rpi on the Raspberry Pi.
This commit is contained in:
Tuomas Tynkkynen 2015-06-18 00:45:46 +03:00
parent 6147909f8e
commit 8496f71e92
2 changed files with 9 additions and 4 deletions

View File

@ -3,6 +3,7 @@
pkgs.substituteAll {
src = ./extlinux-conf-builder.sh;
isExecutable = true;
inherit (pkgs) bash;
path = [pkgs.coreutils pkgs.gnused pkgs.gnugrep];
inherit (pkgs) bash;
kernelDTB = pkgs.stdenv.platform.kernelDTB or false;
}

View File

@ -75,8 +75,10 @@ addEntry() {
copyToKernelsDir "$path/kernel"; kernel=$result
copyToKernelsDir "$path/initrd"; initrd=$result
if [ -n "@kernelDTB@" ]; then
# XXX UGLY: maybe the system config should have a top-level "dtbs" entry?
copyToKernelsDir $(readlink -m "$path/kernel/../dtbs"); dtbs=$result
fi
timestampEpoch=$(stat -L -c '%Z' $path)
@ -93,7 +95,9 @@ addEntry() {
fi
echo " LINUX ../nixos/$(basename $kernel)"
echo " INITRD ../nixos/$(basename $initrd)"
if [ -n "@kernelDTB@" ]; then
echo " FDTDIR ../nixos/$(basename $dtbs)"
fi
echo " APPEND systemConfig=$path init=$path/init $extraParams"
}