diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-05-21 14:06:31 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-05-21 15:55:50 +0200 |
commit | 5e364503d5b219e81c54e3616e3bf8e61a2cf1c7 (patch) | |
tree | 4c903180223a9fe4f5f43ac5389fddd0ba978a02 /nixos/modules/installer | |
parent | 48601269a94456ae61b187ab48e5ba2d98d2ea0b (diff) | |
download | nixlib-5e364503d5b219e81c54e3616e3bf8e61a2cf1c7.tar nixlib-5e364503d5b219e81c54e3616e3bf8e61a2cf1c7.tar.gz nixlib-5e364503d5b219e81c54e3616e3bf8e61a2cf1c7.tar.bz2 nixlib-5e364503d5b219e81c54e3616e3bf8e61a2cf1c7.tar.lz nixlib-5e364503d5b219e81c54e3616e3bf8e61a2cf1c7.tar.xz nixlib-5e364503d5b219e81c54e3616e3bf8e61a2cf1c7.tar.zst nixlib-5e364503d5b219e81c54e3616e3bf8e61a2cf1c7.zip |
NixOS ISO: Don't use a unionfs for /
We don't need a unionfs on /, we only need a tmpfs.
Diffstat (limited to 'nixos/modules/installer')
-rw-r--r-- | nixos/modules/installer/cd-dvd/iso-image.nix | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/nixos/modules/installer/cd-dvd/iso-image.nix b/nixos/modules/installer/cd-dvd/iso-image.nix index 00f5fae84342..28c42d64f6fb 100644 --- a/nixos/modules/installer/cd-dvd/iso-image.nix +++ b/nixos/modules/installer/cd-dvd/iso-image.nix @@ -67,7 +67,7 @@ let ${config.boot.kernelPackages.kernel}/bzImage ::boot/bzImage mcopy -v -i "$out" \ ${config.system.build.initialRamdisk}/initrd ::boot/initrd - ''; + ''; # */ targetArch = if pkgs.stdenv.isi686 then "ia32" @@ -177,39 +177,45 @@ in # recognise that. boot.kernelParams = [ "root=LABEL=${config.isoImage.volumeID}" ]; + fileSystems."/" = + { fsType = "tmpfs"; + device = "none"; + options = "mode=0755"; + }; + # Note that /dev/root is a symlink to the actual root device - # specified on the kernel command line, created in the stage 1 init - # script. - fileSystems."/".device = "/dev/root"; + # specified on the kernel command line, created in the stage 1 + # init script. + fileSystems."/iso" = + { device = "/dev/root"; + neededForBoot = true; + noCheck = true; + }; - fileSystems."/nix/store" = + fileSystems."/nix/.ro-store" = { fsType = "squashfs"; - device = "/nix-store.squashfs"; + device = "/iso/nix-store.squashfs"; options = "loop"; + neededForBoot = true; + }; + + fileSystems."/nix/.rw-store" = + { fsType = "tmpfs"; + device = "none"; + options = "mode=0755"; + neededForBoot = true; }; boot.initrd.availableKernelModules = [ "squashfs" "iso9660" ]; boot.initrd.kernelModules = [ "loop" ]; - # In stage 1, mount a tmpfs on top of / (the ISO image) and - # /nix/store (the squashfs image) to make this a live CD. + # In stage 1, mount a tmpfs on top of /nix/store (the squashfs + # image) to make this a live CD. boot.initrd.postMountCommands = '' - mkdir -p /unionfs-chroot/ro-root - mount --rbind $targetRoot /unionfs-chroot/ro-root - - mkdir /unionfs-chroot/rw-root - mount -t tmpfs -o "mode=755" none /unionfs-chroot/rw-root - mkdir /mnt-root-union - unionfs -o allow_other,cow,chroot=/unionfs-chroot,max_files=32768 /rw-root=RW:/ro-root=RO /mnt-root-union - oldTargetRoot=$targetRoot - targetRoot=/mnt-root-union - - mkdir /unionfs-chroot/rw-store - mount -t tmpfs -o "mode=755" none /unionfs-chroot/rw-store - mkdir -p $oldTargetRoot/nix/store - unionfs -o allow_other,cow,nonempty,chroot=/unionfs-chroot,max_files=32768 /rw-store=RW:/ro-root/nix/store=RO /mnt-root-union/nix/store + mkdir -p $targetRoot/nix/store + unionfs -o allow_other,cow,nonempty,chroot=$targetRoot,max_files=32768 /nix/.rw-store=RW:/nix/.ro-store=RO $targetRoot/nix/store ''; # Closures to be copied to the Nix store on the CD, namely the init @@ -253,10 +259,6 @@ in { source = config.system.build.squashfsStore; target = "/nix-store.squashfs"; } - { # Quick hack: need a mount point for the store. - source = pkgs.runCommand "empty" {} "mkdir -p $out"; - target = "/nix/store"; - } ] ++ optionals config.isoImage.makeEfiBootable [ { source = efiImg; target = "/boot/efi.img"; |