1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00

* Removed the boot.isLiveCD option. Moved the code for mounting a

tmpfs on top of the CD to iso-image.nix.

svn path=/nixos/trunk/; revision=19318
This commit is contained in:
Eelco Dolstra 2010-01-09 15:13:06 +00:00
parent b59cfde311
commit 39796e26b4
3 changed files with 17 additions and 32 deletions

View file

@ -131,11 +131,22 @@ in
boot.initrd.availableKernelModules = [ "aufs" "squashfs" "iso9660" ];
boot.initrd.kernelModules = [ "loop" ];
# Tell stage 1 of the boot to mount a tmpfs on top of the CD using
# AUFS. !!! It would be nicer to make the stage 1 init pluggable
# and move that bit of code here.
boot.isLiveCD = true;
# In stage 1, mount a tmpfs on top of / (the ISO image) and
# /nix/store (the squashfs image) to make this a live CD.
boot.initrd.postMountCommands =
''
mkdir /mnt-root-tmpfs
mount -t tmpfs -o "mode=755" none /mnt-root-tmpfs
mkdir /mnt-root-union
mount -t aufs -o dirs=/mnt-root-tmpfs=rw:$targetRoot=ro none /mnt-root-union
targetRoot=/mnt-root-union
mkdir /mnt-store-tmpfs
mount -t tmpfs -o "mode=755" none /mnt-store-tmpfs
mkdir -p $targetRoot/nix/store
mount -t aufs -o dirs=/mnt-store-tmpfs=rw:/mnt-root/nix/store=ro none /mnt-root-union/nix/store
'';
# AUFS 2 support (currently unused).
/*

View file

@ -272,22 +272,6 @@ for ((n = 0; n < ${#mountPoints[*]}; n++)); do
done
# If this is a live-CD/DVD, then union-mount a tmpfs on top of the
# original root.
if test -n "@isLiveCD@"; then
mkdir /mnt-root-tmpfs
mount -t tmpfs -o "mode=755" none /mnt-root-tmpfs
mkdir /mnt-root-union
mount -t aufs -o dirs=/mnt-root-tmpfs=rw:$targetRoot=ro none /mnt-root-union
targetRoot=/mnt-root-union
mkdir /mnt-store-tmpfs
mount -t tmpfs -o "mode=755" none /mnt-store-tmpfs
mkdir -p $targetRoot/nix/store
mount -t aufs -o dirs=/mnt-store-tmpfs=rw:/mnt-root/nix/store=ro none /mnt-root-union/nix/store
fi
@postMountCommands@

View file

@ -11,16 +11,6 @@ let
options = {
boot.isLiveCD = mkOption {
default = false;
description = "
If set to true, the root device will be mounted read-only and
a ramdisk will be mounted on top of it using unionfs to
provide a writable root. This is used for the NixOS
Live-CD/DVD.
";
};
boot.resumeDevice = mkOption {
default = "";
example = "0:0";
@ -277,7 +267,7 @@ let
inherit udevConf extraUtils;
inherit (config.boot) isLiveCD resumeDevice;
inherit (config.boot) resumeDevice;
inherit (config.boot.initrd) checkJournalingFS
postDeviceCommands postMountCommands kernelModules;