fix: setup workspace with args

This commit is contained in:
Matthieu Bessat 2023-12-20 00:50:24 +01:00
parent 0fddf32bc5
commit f147318025
2 changed files with 11 additions and 10 deletions

View file

@ -0,0 +1 @@
/home/mbess/workspace/debian-vm-auto-setup/files_to_serve/

View file

@ -2,23 +2,23 @@
# Download and extract netboot image
mkdir -p machines/machine01.local
mkdir -p machines/$1
ln -f -s $(pwd)/files_to_serve/ ./machines/machine01.local/files_to_serve
ln -f -s $(pwd)/files_to_serve/ ./machines/$1/files_to_serve
mkdir machines/machine01.local/tftp_container
mkdir machines/$1/tftp_container
wget \
-O ./machines/machine01.local/tftp_container/netboot.tar.gz \
https://deb.debian.org/debian/dists/bookworm/main/installer-amd64/20230607/images/netboot/netboot.tar.gz
-O ./machines/$1/tftp_container/netboot.tar.gz \
https://deb.debian.org/debian/dists/bookworm/main/installer-amd64/current/images/netboot/netboot.tar.gz
tar -xzvf ./machines/machine01.local/tftp_container/netboot.tar.gz -C ./machines/machine01.local/tftp_container/
tar -xzvf ./machines/$1/tftp_container/netboot.tar.gz -C ./machines/$1/tftp_container/
# create base image
qemu-img create -f qcow2 ./machines/machine01.local/main.qcow 5G
qemu-img create -f qcow2 ./machines/$1/main.qcow 5G
cp ./install_machine.sh ./machines/machine01.local/
cp ./install_machine.sh ./machines/$1/
cp ./run_usernet.sh ./machines/machine01.local/run.sh
cp ./run_usernet.sh ./machines/$1/run.sh
cp ./debian_install_config_default ./machines/machine01.local/tftp_container/debian-installer/amd64/pxelinux.cfg/default
cp ./debian_install_config_default ./machines/$1/tftp_container/debian-installer/amd64/pxelinux.cfg/default