[Nix-dev] Prepending files to initrd

Roger Qiu roger.qiu at matrix.ai
Sat Jan 30 11:26:57 CET 2016


Hi,

There's an option called: `boot.initrd.prepend`. I tried to prepend a 
gzipped cpio archive containing 1 single file with no path. But I upon 
rebooting, I received a `Initramfs unpacking failed: junk in compressed 
archive`.

Here was the steps I took:

```
pushd /boot
cpio -o <<< "luks-key.img" >luks-key.cpio
gzip luks-key.cpio
rm luks-key.img
popd
```

Then inside `configuration.nix`: `boot.initrd.prepend = [ 
"/boot/luks-key.cpio.gz" ];`.

I expect the file `luks-key.img` to be available in the initrd at stage 
1. I want to be able to reference this as `/luks-key.img`.

Is there anything I'm doing incorrect here?

Thanks,
Roger

-- 
Founder of Matrix AI
https://matrix.ai/
+61420925975



More information about the nix-dev mailing list