aboutsummaryrefslogtreecommitdiff
path: root/nix/initramfs.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nix/initramfs.nix')
-rw-r--r--nix/initramfs.nix17
1 files changed, 17 insertions, 0 deletions
diff --git a/nix/initramfs.nix b/nix/initramfs.nix
index e69de29..6ca3865 100644
--- a/nix/initramfs.nix
+++ b/nix/initramfs.nix
@@ -0,0 +1,17 @@
+{ stdenv, kernel, busybox, cpio }:
+
+stdenv.mkDerivation {
+ name = "initramfs-yerba";
+ src = ./.;
+ buildInputs = [ cpio ];
+ buildPhase = ''
+ mkdir -p $out
+ # Create initramfs directory structure
+ 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
+ '';
+}