package gen_init_cpio, tool for making an initramfs

This commit is contained in:
Daniel Barlow 2023-04-04 22:47:59 +01:00
parent f02efa3fe3
commit aa1a2e5d75
2 changed files with 19 additions and 0 deletions

View file

@ -22,6 +22,8 @@
netlink-lua = callPackage ./netlink-lua {};
ifwait = callPackage ./ifwait {};
gen_init_cpio = callPackage ./gen_init_cpio {};
serviceFns = callPackage ./service-fns {};
# these are packages for the build system not the host/target

View file

@ -0,0 +1,17 @@
{
stdenv
, fetchurl
}:
stdenv.mkDerivation rec {
name = "gen_init_cpio";
src = fetchurl {
url = "https://raw.githubusercontent.com/torvalds/linux/462cd7724e2341472c9f9670ac88e250788d4c82/usr/gen_init_cpio.c";
hash = "sha256-gwKSJGiCS4v98EArNryr/sdYAfDqnGsZ1erfGMNVjpw=";
};
unpackPhase = "cp ${src} ./gen_init_cpio.c";
buildPhase = "gcc -o gen_init_cpio gen_init_cpio.c";
installPhase = ''
mkdir -p $out/bin
cp gen_init_cpio $out/bin
'';
}