summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaito Bezarius <masterancpp@gmail.com>2023-05-05 16:13:30 +0200
committerRaito Bezarius <masterancpp@gmail.com>2024-02-11 17:50:37 +0100
commit95582ade4c1cbb8861cd1f117ad689edce156722 (patch)
tree1a0e361b30be5d53441b392de9de8fa6a8927712
parentnixos/tests/netboot: add directBoot test (diff)
downloadnixpkgs-origin/netboot-tests.tar.gz
nixos/netboot: use `config.system.boot.loader.initrdFile` instead of hardcoding `initrd`, disable compression for initrdorigin/netboot-tests
-rw-r--r--nixos/modules/installer/netboot/netboot.nix13
1 files changed, 6 insertions, 7 deletions
diff --git a/nixos/modules/installer/netboot/netboot.nix b/nixos/modules/installer/netboot/netboot.nix
index fb9b6541853c..f19d3c8a4c54 100644
--- a/nixos/modules/installer/netboot/netboot.nix
+++ b/nixos/modules/installer/netboot/netboot.nix
@@ -123,8 +123,7 @@ with lib;
# Create the initrd
system.build.netbootRamdisk = pkgs.makeInitrdNG {
- inherit (config.boot.initrd) compressor;
- prepend = [ "${config.system.build.initialRamdisk}/initrd" ];
+ prepend = [ "${config.system.build.initialRamdisk}/${config.system.boot.loader.initrdFile}" ];
contents =
[ { object = config.system.build.squashfsStore;
@@ -137,8 +136,8 @@ with lib;
#!ipxe
# Use the cmdline variable to allow the user to specify custom kernel params
# when chainloading this script from other iPXE scripts like netboot.xyz
- kernel ${pkgs.stdenv.hostPlatform.linux-kernel.target} init=${config.system.build.toplevel}/init initrd=initrd ${toString config.boot.kernelParams} ''${cmdline}
- initrd initrd
+ kernel ${pkgs.stdenv.hostPlatform.linux-kernel.target} init=${config.system.build.toplevel}/init initrd=${config.system.boot.loader.initrdFile} ${toString config.boot.kernelParams} ''${cmdline}
+ initrd ${config.system.boot.loader.initrdFile}
boot
'';
@@ -152,7 +151,7 @@ with lib;
fi
SCRIPT_DIR=$( cd -- "$( dirname -- "''${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
kexec --load ''${SCRIPT_DIR}/bzImage \
- --initrd=''${SCRIPT_DIR}/initrd.gz \
+ --initrd=''${SCRIPT_DIR}/${config.system.boot.loader.initrdFile} \
--command-line "init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams}"
kexec -e
'';
@@ -160,8 +159,8 @@ with lib;
# A tree containing initrd.gz, bzImage and a kexec-boot script.
system.build.kexecTree = pkgs.linkFarm "kexec-tree" [
{
- name = "initrd.gz";
- path = "${config.system.build.netbootRamdisk}/initrd";
+ name = "${config.system.boot.loader.initrdFile}";
+ path = "${config.system.build.netbootRamdisk}/${config.system.boot.loader.initrdFile}";
}
{
name = "bzImage";