debian-vm-auto-setup/preseed_method/setup_workspace.sh

25 lines
691 B
Bash
Raw Normal View History

2023-12-19 12:28:22 +00:00
#!/usr/bin/sh
# Download and extract netboot image
2023-12-19 23:50:24 +00:00
mkdir -p machines/$1
2023-12-19 12:28:22 +00:00
2023-12-19 23:50:24 +00:00
ln -f -s $(pwd)/files_to_serve/ ./machines/$1/files_to_serve
2023-12-19 23:37:02 +00:00
2023-12-19 23:50:24 +00:00
mkdir machines/$1/tftp_container
2023-12-19 12:28:22 +00:00
wget \
2023-12-19 23:50:24 +00:00
-O ./machines/$1/tftp_container/netboot.tar.gz \
https://deb.debian.org/debian/dists/bookworm/main/installer-amd64/current/images/netboot/netboot.tar.gz
2023-12-19 12:28:22 +00:00
2023-12-19 23:50:24 +00:00
tar -xzvf ./machines/$1/tftp_container/netboot.tar.gz -C ./machines/$1/tftp_container/
2023-12-19 12:28:22 +00:00
# create base image
2023-12-19 23:50:24 +00:00
qemu-img create -f qcow2 ./machines/$1/main.qcow 5G
2023-12-19 12:28:22 +00:00
2023-12-19 23:50:24 +00:00
cp ./install_machine.sh ./machines/$1/
2023-12-19 12:28:22 +00:00
2023-12-19 23:50:24 +00:00
cp ./run_usernet.sh ./machines/$1/run.sh
2023-12-19 23:37:02 +00:00
2023-12-19 23:50:24 +00:00
cp ./debian_install_config_default ./machines/$1/tftp_container/debian-installer/amd64/pxelinux.cfg/default