1
0
Fork 0

windows tests: split networked-installer.sh into windows-installer.sh+anaconda-installer.sh

This commit is contained in:
Astro 2019-04-18 16:42:19 +02:00
parent 93f1c15d9f
commit 6f57d607ce
2 changed files with 28 additions and 21 deletions

View File

@ -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).

View File

@ -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."
else
echo "Please finalize your Windows installation (or delete c.img and restart)"
${qemu.runQemu false [
"-boot" "order=c"
"-drive" "file=c.img,index=0,media=disk"
]} &
fi
cat ${instructions} cat ${instructions}
wait
EOF
read cat > $out/bin/anaconda-installer.sh << EOF
#!/usr/bin/env bash
set -e -m
${qemu.runQemu false [
"-boot" "order=c"
"-drive" "file=c.img,index=0,media=disk"
]} &
sleep 10
${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
''; '';
} }