makeInitrd: Support prepending other initrds
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
# `contents = {object = ...; symlink = /init;}' is a typical
|
||||
# argument.
|
||||
|
||||
{stdenv, perl, perlArchiveCpio, cpio, contents, ubootChooser, compressor}:
|
||||
{ stdenv, perl, perlArchiveCpio, cpio, contents, ubootChooser, compressor, prepend }:
|
||||
|
||||
let
|
||||
inputsFun = ubootName : [perl cpio perlArchiveCpio ]
|
||||
@@ -41,5 +41,5 @@ stdenv.mkDerivation {
|
||||
nativeBuildInputs = inputsFun stdenv.cross.platform.uboot;
|
||||
makeUInitrd = makeUInitrdFun stdenv.cross.platform.uboot;
|
||||
};
|
||||
inherit compressor;
|
||||
inherit compressor prepend;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,10 @@ storePaths=$(perl $pathsFromGraph closure-*)
|
||||
|
||||
# Put the closure in a gzipped cpio archive.
|
||||
mkdir -p $out
|
||||
(cd root && find * -print0 | cpio -o -H newc --null | perl $cpioClean | $compressor > $out/initrd)
|
||||
for PREP in $prepend; do
|
||||
cat $PREP >> $out/initrd
|
||||
done
|
||||
(cd root && find * -print0 | cpio -o -H newc --null | perl $cpioClean | $compressor >> $out/initrd)
|
||||
|
||||
if [ -n "$makeUInitrd" ]; then
|
||||
mv $out/initrd $out/initrd.gz
|
||||
|
||||
Reference in New Issue
Block a user