Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e43f2fc868f0
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 69e0740baa7b
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Nov 29, 2016

  1. Copy the full SHA
    e710ede View commit details
  2. Merge pull request #20795 from cleverca22/netboot

    make the /nix/store writable under netboot images
    domenkozar authored Nov 29, 2016

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    69e0740 View commit details
Showing with 22 additions and 6 deletions.
  1. +22 −6 nixos/modules/installer/netboot/netboot.nix
28 changes: 22 additions & 6 deletions nixos/modules/installer/netboot/netboot.nix
Original file line number Diff line number Diff line change
@@ -26,11 +26,6 @@ with lib;
# here and it causes a cyclic dependency.
boot.loader.grub.enable = false;

boot.initrd.postMountCommands = ''
mkdir -p /mnt-root/nix/store
mount -t squashfs /nix-store.squashfs /mnt-root/nix/store
'';

# !!! Hack - attributes expected by other modules.
system.boot.loader.kernelFile = "bzImage";
environment.systemPackages = [ pkgs.grub2 pkgs.grub2_efi pkgs.syslinux ];
@@ -42,13 +37,34 @@ with lib;
options = [ "mode=0755" ];
};

# In stage 1, mount a tmpfs on top of /nix/store (the squashfs
# image) to make this a live CD.
fileSystems."/nix/.ro-store" =
{ fsType = "squashfs";
device = "../nix-store.squashfs";
options = [ "loop" ];
neededForBoot = true;
};

fileSystems."/nix/.rw-store" =
{ fsType = "tmpfs";
options = [ "mode=0755" ];
neededForBoot = true;
};

fileSystems."/nix/store" =
{ fsType = "unionfs-fuse";
device = "unionfs";
options = [ "allow_other" "cow" "nonempty" "chroot=/mnt-root" "max_files=32768" "hide_meta_files" "dirs=/nix/.rw-store=rw:/nix/.ro-store=ro" ];
};

boot.initrd.availableKernelModules = [ "squashfs" ];

boot.initrd.kernelModules = [ "loop" ];

# Closures to be copied to the Nix store, namely the init
# script and the top-level system configuration directory.
netboot.storeContents =
netboot.storeContents =
[ config.system.build.toplevel ];

# Create the squashfs image that contains the Nix store.