aboutsummaryrefslogtreecommitdiff
path: root/nix/initramfs.nix
blob: 48039dfb0c5dc747b7cccc64022a369d6166cf19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{ stdenv, kernel, busybox, cpio }:

stdenv.mkDerivation {
  name = "initramfs-yerba";
  src = ./.;
  buildInputs = [ cpio ];
  buildPhase = ''
    mkdir -p $out
    mkdir -p initramfs/bin
    cp -a ${busybox}/bin/* initramfs/bin/
    cp ${../initramfs_init} initramfs/init
    chmod +x initramfs/init
    cd initramfs
    find . | cpio -o -H newc | gzip > $out/initramfs.cpio.gz
  '';
  installPhase = ''
    echo "initramfs built"
  '';
}