* Allow switching to a new configuration without rebooting. However,
we don't stop/start/restart Upstart jobs yet. svn path=/nixos/trunk/; revision=7297
This commit is contained in:
parent
9986bda673
commit
4ac288e724
@ -37,9 +37,10 @@ rec {
|
|||||||
systemConfiguration = pkgs.stdenv.mkDerivation {
|
systemConfiguration = pkgs.stdenv.mkDerivation {
|
||||||
name = "system-configuration";
|
name = "system-configuration";
|
||||||
builder = ./system-configuration.sh;
|
builder = ./system-configuration.sh;
|
||||||
inherit (pkgs) grub coreutils gnused gnugrep diffutils;
|
inherit (pkgs) grub coreutils gnused gnugrep diffutils findutils;
|
||||||
inherit grubDevice;
|
inherit grubDevice;
|
||||||
inherit bootStage2;
|
inherit bootStage2;
|
||||||
|
inherit activateConfiguration;
|
||||||
inherit grubMenuBuilder;
|
inherit grubMenuBuilder;
|
||||||
kernel = pkgs.kernel + "/vmlinuz";
|
kernel = pkgs.kernel + "/vmlinuz";
|
||||||
initrd = initialRamdisk + "/initrd";
|
initrd = initialRamdisk + "/initrd";
|
||||||
|
@ -6,6 +6,7 @@ ln -s $kernel $out/kernel
|
|||||||
ln -s $grub $out/grub
|
ln -s $grub $out/grub
|
||||||
ln -s $bootStage2 $out/init
|
ln -s $bootStage2 $out/init
|
||||||
ln -s $initrd $out/initrd
|
ln -s $initrd $out/initrd
|
||||||
|
ln -s $activateConfiguration $out/activate
|
||||||
echo "$extraKernelParams" > $out/kernel-params
|
echo "$extraKernelParams" > $out/kernel-params
|
||||||
|
|
||||||
cat > $out/menu.lst << GRUBEND
|
cat > $out/menu.lst << GRUBEND
|
||||||
@ -18,7 +19,8 @@ ensureDir $out/bin
|
|||||||
cat > $out/bin/switch-to-configuration <<EOF
|
cat > $out/bin/switch-to-configuration <<EOF
|
||||||
#! $SHELL
|
#! $SHELL
|
||||||
set -e
|
set -e
|
||||||
export PATH=$coreutils/bin:$gnused/bin:$gnugrep/bin:$diffutils/bin
|
export PATH=$coreutils/bin:$gnused/bin:$gnugrep/bin:$diffutils/bin:$findutils/bin
|
||||||
|
|
||||||
if test -n "$grubDevice"; then
|
if test -n "$grubDevice"; then
|
||||||
mkdir -m 0700 -p /boot/grub
|
mkdir -m 0700 -p /boot/grub
|
||||||
$grubMenuBuilder $out
|
$grubMenuBuilder $out
|
||||||
@ -26,6 +28,13 @@ if test -n "$grubDevice"; then
|
|||||||
$grub/sbin/grub-install "$grubDevice" --no-floppy --recheck
|
$grub/sbin/grub-install "$grubDevice" --no-floppy --recheck
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test "\$activateNow" = "1"; then
|
||||||
|
echo "Activating the configuration..."
|
||||||
|
$out/activate
|
||||||
|
kill -TERM 1 # make Upstart reload its events
|
||||||
|
fi
|
||||||
|
|
||||||
sync
|
sync
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user