From aa1a2e5d75794d53b256d969f99872e88b53a8c5 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Tue, 4 Apr 2023 22:47:59 +0100 Subject: [PATCH] package gen_init_cpio, tool for making an initramfs --- pkgs/default.nix | 2 ++ pkgs/gen_init_cpio/default.nix | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 pkgs/gen_init_cpio/default.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index 0eaa5b3..2e62701 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -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 diff --git a/pkgs/gen_init_cpio/default.nix b/pkgs/gen_init_cpio/default.nix new file mode 100644 index 0000000..63440e6 --- /dev/null +++ b/pkgs/gen_init_cpio/default.nix @@ -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 + ''; +}