From 4638092d3d46df05dd00f7ff75ae6a453528827e Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Mon, 10 Apr 2023 20:35:06 +0100 Subject: [PATCH] build initramfs into kernel this doesn't matter for qemu, but there's no other way of getting a hardware device to find it if the bootloader won't co-operate --- modules/initramfs.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/initramfs.nix b/modules/initramfs.nix index d0668de..fe19134 100644 --- a/modules/initramfs.nix +++ b/modules/initramfs.nix @@ -17,6 +17,7 @@ in }; config = mkIf config.boot.initramfs.enable { kernel.config.BLK_DEV_INITRD = "y"; + kernel.config.INITRAMFS_SOURCE = builtins.toJSON "${config.outputs.initramfs}"; outputs = { initramfs = @@ -57,7 +58,7 @@ in ''; refs = pkgs.writeReferencesToFile bb; gen_init_cpio = pkgs.pkgsBuildBuild.gen_init_cpio; - in runCommand "initramfs" {} '' + in runCommand "initramfs.cpio" {} '' cat << SPECIALS | ${gen_init_cpio}/bin/gen_init_cpio /dev/stdin > $out dir /proc 0755 0 0 dir /dev 0755 0 0