* Obsolete.

svn path=/nixos/trunk/; revision=19213
This commit is contained in:
Eelco Dolstra 2010-01-05 09:20:43 +00:00
parent 170331be30
commit 9e98910a72
4 changed files with 0 additions and 180 deletions

View File

@ -1,10 +0,0 @@
#! /bin/sh
stop dhclient
ifconfig eth0 10.0.253.250 netmask 255.255.0.0 up
chmod a+x install-script.sh install-start.sh
scp -i id_livedvd -o StrictHostKeyChecking=no install-script.sh 10.0.253.251:
scp -i id_livedvd -o StrictHostKeyChecking=no install-start.sh 10.0.253.251:
ssh -i id_livedvd -o StrictHostKeyChecking=no 10.0.253.251 bash ./install-start.sh

View File

@ -1,87 +0,0 @@
dd if=/dev/zero of=/dev/sda bs=1048576 count=1
sfdisk /dev/sda -uM << EOF
,512,L
,1024,S
,,L
EOF
mkfs.ext3 /dev/sda1 ; mkswap /dev/sda2 ; mkfs.ext3 /dev/sda3
mount /dev/sda3 /mnt ; mkdir /mnt/boot ; mount /dev/sda1 /mnt/boot
mkdir -p /mnt/etc/nixos
cat > /mnt/etc/nixos/configuration.nix <<EOF
{pkgs, config, ...}: {
boot = {
grubDevice = "/dev/sda";
copyKernels = true;
bootMount = "(hd0,0)";
};
fileSystems = [
{ mountPoint = "/";
device = "/dev/sda3";
}
{ mountPoint = "/boot";
device = "/dev/sda1";
neededForBoot = true;
}
];
swapDevices = [
{ device = "/dev/sda2"; }
];
services = {
sshd = {
enable = true;
};
extraJobs = [
{
name = "Host-call-back";
job = ''
start on network-interfaces/started
script
while ! /var/run/current-system/sw/sbin/ifconfig eth0 |
/var/run/current-system/sw/bin/grep "inet addr:" &>/dev/null; do
sleep 1;
done
echo -e "Installation finished\nOK" | /var/run/current-system/sw/bin/socat stdio tcp:10.0.2.2:4424 | {
read;
if [ "\\\$REPLY" = "reboot" ] ; then
/var/run/current-system/sw/sbin/start ctrl-alt-delete;
fi;
}
end script
'';
}
];
};
fonts = {
enableFontConfig = false;
};
environment = {
systemPackages = [
pkgs.socat (pkgs.lowPrio pkgs.nixUnstable)
];
nix = pkgs.nixCustomFun (pkgs.nixUnstable.src)
""
["nix-reduce-build" "nix-http-export.cgi"]
["--with-docbook-xsl=\\\${pkgs.docbook5_xsl}/xml/xsl/docbook/"];
};
}
EOF
nixos-install
echo Installation finished
start ctrl-alt-delete

View File

@ -1,12 +0,0 @@
#! /bin/sh
nohup bash -c 'NIX_REMOTE= ./install-script.sh &>/dev/tty11' &
sleep 1;
chvt 11 || true;
disown
exit

View File

@ -1,71 +0,0 @@
#! /bin/sh -i
if test -z "$INSTALL_TEST_RUNNING" ; then
export INSTALL_TEST_RUNNING=1;
export ORIGINAL_NAME="$0";
sh -i < "$ORIGINAL_NAME";
exit;
fi;
if ! eval ' ( sleep 0.1; exit 0; ) & fg ' ; then
echo "Failing job control test";
exit;
fi;
set -x
echo "Installation starting.." > report
nix-build -o socat /etc/nixos/nixpkgs -A socat || { echo "Failed to build socat" >&2 ; exit 2; };
nix-build -o qemu /etc/nixos/nixpkgs -A ${QEMU_PACKAGE:-qemu} || { echo "Failed to build qemu" >&2 ; exit 2; };
echo "reboot" | ./socat/bin/socat tcp-listen:4424 stdio >> report &
if ( ! [ -d dvd/iso ] ) || ( [ -z "$USE_LEFTOVER_DVD" ] ); then
rm dvd
# unset NIXPKGS_CONFIG to reduce host -> image configuration leak
NIXPKGS_CONFIG= nix-build -o dvd /etc/nixos/nixos/installer/cd-dvd/closed-install.nix ||
{ echo "Failed to build LiveDVD" >&2 ; exit 2; };
fi;
if ( ! [ -f install-test.img ] ) || ( [ -z "$JUST_BOOT" ] ); then
rm install-test.img
./qemu/bin/qemu-img create -f qcow2 install-test.img 5G
./qemu/bin/qemu --kernel-kqemu -m 512 -cdrom dvd/iso/nixos-*.iso -hda install-test.img -boot d -no-reboot &
./socat/bin/socat tcp-listen:4425 tcp-listen:3737 &
sleep 1;
sed -e '/^127[.]0[.]0[.]1/d; /^\[127[.]0[.]0[.]1/d' -i ~/.ssh/known_hosts || true;
(
echo "cat > install-script.sh <<BIGEOF"
cat $(dirname "$ORIGINAL_NAME")/install-script.sh
echo BIGEOF
echo "cat > install-start.sh <<BIGEOF"
cat $(dirname "$ORIGINAL_NAME")/install-start.sh
echo BIGEOF
echo 'chmod a+x *.sh'
echo './install-start.sh'
) | ssh -l root -i /var/certs/ssh/id_livedvd -o StrictHostKeyChecking=no 127.0.0.1 -p 4425
fi;
./qemu/bin/qemu --kernel-kqemu -m 128 install-test.img -no-reboot
echo "Report contains: "
cat report
set +x
if [ -n "$GC_DVD" ] ; then
rm dvd; nix-store --delete $(readlink -f dvd);
fi;
if [ -n "$DO_CLEANUP" ]; then
rm dvd ; rm socat ; rm qemu ; rm install-test.img ;
fi;
test OK = "$(tail -1 report)";