only add the device tree files if the loader directory exists
Some checks failed
Hydra nixosConfigurations.container-default-aarch64-linux Hydra build #22543 of nixos-config:pr618:nixosConfigurations.container-default-aarch64-linux
Hydra checks.x86_64-linux.containers-default Hydra build #22542 of nixos-config:pr618:checks.x86_64-linux.containers-default
Hydra nixosConfigurations.container-default-x86_64-linux Hydra build #22545 of nixos-config:pr618:nixosConfigurations.container-default-x86_64-linux
Hydra nixosConfigurations.not522-installer Hydra build #22547 of nixos-config:pr618:nixosConfigurations.not522-installer
Hydra nixosConfigurations.container-default-riscv64-linux Hydra build #22544 of nixos-config:pr618:nixosConfigurations.container-default-riscv64-linux
Hydra nixosConfigurations.not522 Hydra build #22546 of nixos-config:pr618:nixosConfigurations.not522

This commit is contained in:
Charlotte 🦝 Delenk 2024-10-31 09:05:51 +01:00
parent 8efe0d5149
commit 94172cfb81

View file

@ -10,11 +10,13 @@
boot.loader.systemd-boot.extraInstallCommands = ''
set -euo pipefail
${pkgs.coreutils}/bin/cp --no-preserve=mode -r ${config.hardware.deviceTree.package} ${config.boot.loader.efi.efiSysMountPoint}/
for filename in ${config.boot.loader.efi.efiSysMountPoint}/loader/entries/nixos*-generation-[1-9]*.conf; do
if ! ${pkgs.gnugrep}/bin/grep -q 'devicetree' $filename; then
${pkgs.coreutils}/bin/echo "devicetree /dtbs/${config.hardware.deviceTree.name}" >> $filename
fi
done
if [ -d ${config.boot.loader.efi.efiSysMountPoint} /loader/entries ]; then
for filename in ${config.boot.loader.efi.efiSysMountPoint}/loader/entries/nixos*-generation-[1-9]*.conf; do
if ! ${pkgs.gnugrep}/bin/grep -q 'devicetree' $filename; then
${pkgs.coreutils}/bin/echo "devicetree /dtbs/${config.hardware.deviceTree.name}" >> $filename
fi
done
fi
'';
hardware.deviceTree.name = "starfive/jh7110-starfive-visionfive-2-v1.3b.dtb";
boot.initrd.kernelModules = [