3
0
Fork 0
forked from mirrors/nixpkgs

Merge branch 'master' of github.com:NixOS/nixos into systemd

This commit is contained in:
Eelco Dolstra 2012-06-22 18:20:26 -04:00
commit bd0f065c05
7 changed files with 18 additions and 24 deletions

View file

@ -68,6 +68,14 @@ sub startAll {
}
# Wait until all VMs have terminated.
sub joinAll {
$log->nest("waiting for all VMs to finish", sub {
$_->waitForShutdown foreach values %vms;
});
}
# In interactive tests, this allows the non-interactive test script to
# be executed conveniently.
sub testScript {

View file

@ -157,7 +157,7 @@ rec {
ln -s ${testDriver}/bin/nixos-test-driver $out/bin/nixos-run-vms
wrapProgram $out/bin/nixos-run-vms \
--add-flags "$vms" \
--set tests '"startAll; sleep 1e9;"' \
--set tests '"startAll; joinAll;"' \
--set VLANS '"${toString vlans}"'
''; # "

View file

@ -66,5 +66,5 @@ in
# To speed up installation a little bit, include the complete stdenv
# in the Nix store on the CD.
isoImage.storeContents = [ pkgs.stdenv pkgs.klibc pkgs.klibcShrunk ];
isoImage.storeContents = [ pkgs.stdenv pkgs.busybox ];
}

View file

@ -205,9 +205,7 @@ in
else
[ config.boot.kernelPackages.aufs ];
boot.initrd.availableKernelModules = [ "aufs" "squashfs" "iso9660" ];
boot.initrd.kernelModules = [ "loop" ];
boot.initrd.kernelModules = [ "aufs" "squashfs" "iso9660" "loop" ];
boot.kernelModules = pkgs.stdenv.lib.optional config.isoImage.makeEfiBootable "efivars";

View file

@ -123,7 +123,7 @@ in
# To speed up further installation of packages, include the complete stdenv
# in the Nix store of the tarball.
tarball.storeContents = pkgs2storeContents [ pkgs.stdenv pkgs.klibc pkgs.klibcShrunk ];
tarball.storeContents = pkgs2storeContents [ pkgs.stdenv ];
tarball.contents =
[ { source = config.boot.kernelPackages.kernel + "/" + config.system.boot.loader.kernelFile;

View file

@ -325,8 +325,7 @@ echo /sbin/modprobe > /proc/sys/kernel/modprobe
# Start stage 2. `switch_root' deletes all files in the ramfs on the
# current root. It also moves the /proc, /sys and /dev mounts over to
# the new root. Note that $stage2Init might be an absolute symlink,
# current root. Note that $stage2Init might be an absolute symlink,
# in which case "-e" won't work because we're not in the chroot yet.
if ! test -e "$targetRoot/$stage2Init" -o -L "$targetRoot/$stage2Init"; then
echo "stage 2 init script ($targetRoot/$stage2Init) not found"
@ -335,7 +334,9 @@ fi
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 /proc $targetRoot/proc
mount --bind /sys $targetRoot/sys
mount --bind /dev $targetRoot/dev
mount --bind /run $targetRoot/run
exec switch_root "$targetRoot" "$stage2Init"

View file

@ -5,20 +5,6 @@
with pkgs.lib;
let
# Urgh, `socat' sets the SIGCHLD to ignore. This wreaks havoc with
# some programs.
rootShell = pkgs.writeScript "shell.pl"
''
#! ${pkgs.perl}/bin/perl
$SIG{CHLD} = 'DEFAULT';
print "\n";
exec "/bin/sh";
'';
in
{
config = {
@ -38,7 +24,8 @@ in
exec < /dev/hvc0 > /dev/hvc0 2> /dev/ttyS0
echo "connecting to host..." >&2
stty -F /dev/hvc0 raw -echo # prevent nl -> cr/nl conversion
${pkgs.socat}/bin/socat stdio exec:${rootShell}
echo
PS1= /bin/sh
'';
};