forked from M-Labs/nix-scripts
windows tests: split networked-installer.sh into windows-installer.sh+anaconda-installer.sh
This commit is contained in:
parent
93f1c15d9f
commit
6f57d607ce
|
@ -1,13 +1,20 @@
|
||||||
# Preparing a Windows image
|
# Preparation steps
|
||||||
|
|
||||||
|
## Install a Windows image
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
nix-build install.nix
|
nix-build install.nix
|
||||||
result/bin/networked-installer.sh
|
result/bin/windows-installer.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
Follow the instructions.
|
Follow the instructions.
|
||||||
|
|
||||||
Then press **return** to automatically complete the installation via SSH. The virtual machine will be shut down when the process is complete.
|
## Install Anaconda to the image
|
||||||
|
|
||||||
|
```shell
|
||||||
|
nix-build install.nix
|
||||||
|
result/bin/anaconda-installer.sh
|
||||||
|
```
|
||||||
|
|
||||||
Move the image `c.img` to one of Nix' `extra-sandbox-paths` (`nix.sandboxPaths` on NixOS).
|
Move the image `c.img` to one of Nix' `extra-sandbox-paths` (`nix.sandboxPaths` on NixOS).
|
||||||
|
|
||||||
|
|
|
@ -47,29 +47,29 @@ stdenv.mkDerivation {
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/bin $out/data
|
mkdir -p $out/bin $out/data
|
||||||
ln -s $(readlink windows.iso) $out/data/windows.iso
|
ln -s $(readlink windows.iso) $out/data/windows.iso
|
||||||
cat > $out/bin/networked-installer.sh << EOF
|
cat > $out/bin/windows-installer.sh << EOF
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e -m
|
set -e -m
|
||||||
|
|
||||||
if [ ! -f c.img ] ; then
|
|
||||||
${qemu.qemu-img} create -f qcow2 c.img ${diskImageSize}
|
${qemu.qemu-img} create -f qcow2 c.img ${diskImageSize}
|
||||||
${qemu.runQemu false [
|
${qemu.runQemu false [
|
||||||
"-boot" "order=d"
|
"-boot" "order=d"
|
||||||
"-drive" "file=c.img,index=0,media=disk,cache=unsafe"
|
"-drive" "file=c.img,index=0,media=disk,cache=unsafe"
|
||||||
"-drive" "file=$out/data/windows.iso,index=1,media=cdrom,cache=unsafe"
|
"-drive" "file=$out/data/windows.iso,index=1,media=cdrom,cache=unsafe"
|
||||||
]} &
|
]} &
|
||||||
echo "Please perform a Windows installation."
|
cat ${instructions}
|
||||||
else
|
wait
|
||||||
echo "Please finalize your Windows installation (or delete c.img and restart)"
|
EOF
|
||||||
|
|
||||||
|
cat > $out/bin/anaconda-installer.sh << EOF
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e -m
|
||||||
|
|
||||||
${qemu.runQemu false [
|
${qemu.runQemu false [
|
||||||
"-boot" "order=c"
|
"-boot" "order=c"
|
||||||
"-drive" "file=c.img,index=0,media=disk"
|
"-drive" "file=c.img,index=0,media=disk"
|
||||||
]} &
|
]} &
|
||||||
fi
|
sleep 10
|
||||||
cat ${instructions}
|
|
||||||
|
|
||||||
read
|
|
||||||
|
|
||||||
${ssh "ver"}
|
${ssh "ver"}
|
||||||
|
|
||||||
${scp anaconda "Anaconda.exe"}
|
${scp anaconda "Anaconda.exe"}
|
||||||
|
@ -86,6 +86,6 @@ stdenv.mkDerivation {
|
||||||
echo "Waiting for qemu exit"
|
echo "Waiting for qemu exit"
|
||||||
wait
|
wait
|
||||||
EOF
|
EOF
|
||||||
chmod a+x $out/bin/networked-installer.sh
|
chmod a+x $out/bin/*.sh
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue