* Create /run in the initrd and bind-mount it into the target root.
This allows Udev to share its database between stage 1 and 2, which in turn is expected by the LVM Udev rules. svn path=/nixos/trunk/; revision=27926
This commit is contained in:
parent
a9f599154a
commit
1e5bd11a53
@ -54,6 +54,8 @@ mount -t proc none /proc
|
|||||||
mkdir -p /sys
|
mkdir -p /sys
|
||||||
mount -t sysfs none /sys
|
mount -t sysfs none /sys
|
||||||
mount -t tmpfs -o "mode=0755,size=@devSize@" none /dev
|
mount -t tmpfs -o "mode=0755,size=@devSize@" none /dev
|
||||||
|
mkdir -p /run
|
||||||
|
mount -t tmpfs none /run
|
||||||
|
|
||||||
|
|
||||||
# Process the kernel command line.
|
# Process the kernel command line.
|
||||||
@ -310,7 +312,10 @@ if ! test -e "$targetRoot/$stage2Init" -o -L "$targetRoot/$stage2Init"; then
|
|||||||
fail
|
fail
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -m 0755 -p $targetRoot/proc $targetRoot/sys $targetRoot/dev
|
mkdir -m 0755 -p $targetRoot/proc $targetRoot/sys $targetRoot/dev $targetRoot/run
|
||||||
|
|
||||||
|
# `switch_root' doesn't move /run yet, so we have to do it ourselves.
|
||||||
|
mount --bind /run $targetRoot/run
|
||||||
|
|
||||||
exec switch_root "$targetRoot" "$stage2Init"
|
exec switch_root "$targetRoot" "$stage2Init"
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ mkdir -m 0755 -p /etc/nixos
|
|||||||
|
|
||||||
|
|
||||||
# Miscellaneous boot time cleanup.
|
# Miscellaneous boot time cleanup.
|
||||||
rm -rf /run /var/run /var/lock /var/log/upstart
|
rm -rf /var/run /var/lock /var/log/upstart
|
||||||
|
|
||||||
#echo -n "cleaning \`/tmp'..."
|
#echo -n "cleaning \`/tmp'..."
|
||||||
#rm -rf --one-file-system /tmp/*
|
#rm -rf --one-file-system /tmp/*
|
||||||
@ -122,9 +122,13 @@ rm -rf /nix/var/nix/gcroots/tmp /nix/var/nix/temproots
|
|||||||
|
|
||||||
|
|
||||||
# Create a tmpfs on /run to hold runtime state for programs such as
|
# Create a tmpfs on /run to hold runtime state for programs such as
|
||||||
# udev.
|
# udev (if stage 1 hasn't already done so).
|
||||||
mkdir -m 0755 -p /run
|
if ! mountpoint -q /run; then
|
||||||
mount -t tmpfs -o "mode=755" none /run
|
rm -rf /run
|
||||||
|
mkdir -m 0755 -p /run
|
||||||
|
mount -t tmpfs -o "mode=755" none /run
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir -m 0700 -p /run/lock
|
mkdir -m 0700 -p /run/lock
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{pkgs, config, ...}:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
@ -36,11 +36,10 @@ let
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inherit (pkgs) substituteAll writeText coreutils utillinux udev;
|
|
||||||
kernel = config.boot.kernelPackages.kernel;
|
kernel = config.boot.kernelPackages.kernel;
|
||||||
activateConfiguration = config.system.activationScripts.script;
|
activateConfiguration = config.system.activationScripts.script;
|
||||||
|
|
||||||
bootStage2 = substituteAll {
|
bootStage2 = pkgs.substituteAll {
|
||||||
src = ./stage-2-init.sh;
|
src = ./stage-2-init.sh;
|
||||||
isExecutable = true;
|
isExecutable = true;
|
||||||
inherit kernel;
|
inherit kernel;
|
||||||
@ -48,11 +47,12 @@ let
|
|||||||
ttyGid = config.ids.gids.tty;
|
ttyGid = config.ids.gids.tty;
|
||||||
upstart = config.system.build.upstart;
|
upstart = config.system.build.upstart;
|
||||||
path =
|
path =
|
||||||
[ coreutils
|
[ pkgs.coreutils
|
||||||
utillinux
|
pkgs.utillinux
|
||||||
udev
|
pkgs.udev
|
||||||
|
pkgs.sysvtools
|
||||||
];
|
];
|
||||||
postBootCommands = writeText "local-cmds"
|
postBootCommands = pkgs.writeText "local-cmds"
|
||||||
''
|
''
|
||||||
${config.boot.postBootCommands}
|
${config.boot.postBootCommands}
|
||||||
${config.powerManagement.powerUpCommands}
|
${config.powerManagement.powerUpCommands}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user