[Nix-dev] Prepending files to initrd

Roger Qiu roger.qiu at matrix.ai
Sat Jan 30 11:39:22 CET 2016


Is there a way to detect the current CPIO format being used? Will it 
always be `newc`?

On 30/01/2016 9:33 PM, Shea Levy wrote:
> This may not be the case any more, but in the past at least you had to explicitly specify the newc cpio format (with -H newc) when calling cpio to make initrds.
>
>> On Jan 30, 2016, at 5:26 AM, Roger Qiu <roger.qiu at matrix.ai> wrote:
>>
>> 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
>>
>> _______________________________________________
>> nix-dev mailing list
>> nix-dev at lists.science.uu.nl
>> http://lists.science.uu.nl/mailman/listinfo/nix-dev

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



More information about the nix-dev mailing list