aboutsummaryrefslogtreecommitdiff
path: root/nix/rootfs.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nix/rootfs.nix')
-rw-r--r--nix/rootfs.nix8
1 files changed, 5 insertions, 3 deletions
diff --git a/nix/rootfs.nix b/nix/rootfs.nix
index fc5d321..d463af7 100644
--- a/nix/rootfs.nix
+++ b/nix/rootfs.nix
@@ -1,15 +1,17 @@
-{ stdenv, fetchgit, busybox, squashfsTools }:
+{ stdenv, fetchgit, busybox, squashfsTools, linuxHeaders }:
stdenv.mkDerivation {
name = "rootfs-yerba";
src = ./.;
buildInputs = [ squashfsTools ];
- nativeBuildInputs = [ squashfsTools ];
+ nativeBuildInputs = [ squashfsTools linuxHeaders ];
buildPhase = ''
mkdir -p rootfs
mkdir -p rootfs/{bin,sbin,etc,proc,sys,dev,home,var,usr,root,mnt,tmp}
cp -a ${busybox}/_install/. rootfs/
- # this says permission denied, cant be bothered to debug, let's just hope we can chroot to /sbin/init in the initramfs and it works?
+ chmod -R u+w rootfs
+ ln -sf bin/busybox rootfs/init
+ ln -sf bin/busybox rootfs/sbin/init
# ln -sf sbin/init rootfs/init
echo "proc /proc proc defaults 0 0" > rootfs/etc/fstab
echo "sysfs /sys sysfs defaults 0 0" >> rootfs/etc/fstab