Compare commits
No commits in common. "20e2a485cefaf57e66526f10d50d05fc8beb4872" and "d201b6e36cfc72107ddedf70c17764039b117694" have entirely different histories.
20e2a485ce
...
d201b6e36c
5 changed files with 39 additions and 59 deletions
12
README.md
12
README.md
|
@ -19,8 +19,12 @@ packer build --only=virtualbox-iso debian-babelbox.json
|
||||||
|
|
||||||
Due to image size reasons we do not include a Debian DVD ISO image into the
|
Due to image size reasons we do not include a Debian DVD ISO image into the
|
||||||
image. Therefore the VMs have to be booted into the regular OS (first Grub menu
|
image. Therefore the VMs have to be booted into the regular OS (first Grub menu
|
||||||
option). Login as user `demo` with password `babelbox`. The shell should start
|
option). Login as user `demo` with password `babelbox` and download a Debian
|
||||||
to download a Debian DVD ISO image into `/srv/`.
|
DVD ISO image into `/srv/`:
|
||||||
|
|
||||||
If this does not work due to connectivity or DNS issues you have `vim` and
|
```
|
||||||
`sudo` in your toolbelt.
|
cd /srv
|
||||||
|
sudo wget https://cdimage.debian.org/debian-cd/10.3.0/amd64/iso-dvd/debian-10.3.0-amd64-DVD-1.iso
|
||||||
|
```
|
||||||
|
|
||||||
|
The version might be different but 10.3.0 has been used for my tests.
|
||||||
|
|
|
@ -18,20 +18,20 @@
|
||||||
"keyboard-configuration/xkb-keymap=de <wait>",
|
"keyboard-configuration/xkb-keymap=de <wait>",
|
||||||
"<enter><wait>"
|
"<enter><wait>"
|
||||||
],
|
],
|
||||||
"disk_size": 20480,
|
"disk_size": 10240,
|
||||||
"guest_os_type": "Debian_64",
|
"guest_os_type": "Debian_64",
|
||||||
"hard_drive_interface": "sata",
|
"hard_drive_interface": "sata",
|
||||||
"headless": false,
|
"headless": false,
|
||||||
"http_directory": "http",
|
"http_directory": "http",
|
||||||
"iso_checksum": "64d727dd5785ae5fcfd3ae8ffbede5f40cca96f1580aaa2820e8b99dae989d94",
|
"iso_checksum": "6a901b5abe43d88b39d627e1339d15507cc38f980036b928f835e0f0e957d3d8",
|
||||||
"iso_checksum_type": "sha256",
|
"iso_checksum_type": "sha256",
|
||||||
"iso_url": "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-12.4.0-amd64-netinst.iso",
|
"iso_url": "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-10.3.0-amd64-netinst.iso",
|
||||||
"shutdown_command": "sudo systemctl poweroff",
|
"shutdown_command": "sudo systemctl poweroff",
|
||||||
"ssh_username": "demo",
|
"ssh_username": "demo",
|
||||||
"ssh_password": "babelbox",
|
"ssh_password": "babelbox",
|
||||||
"ssh_port": "22",
|
"ssh_port": "22",
|
||||||
"ssh_wait_timeout": "1800s",
|
"ssh_wait_timeout": "1800s",
|
||||||
"vm_name": "babelbox-bookworm",
|
"vm_name": "babelbox-buster",
|
||||||
"vboxmanage": [
|
"vboxmanage": [
|
||||||
[
|
[
|
||||||
"modifyvm",
|
"modifyvm",
|
||||||
|
@ -50,41 +50,41 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "qemu",
|
"type": "qemu",
|
||||||
"iso_checksum": "64d727dd5785ae5fcfd3ae8ffbede5f40cca96f1580aaa2820e8b99dae989d94",
|
"iso_checksum": "6a901b5abe43d88b39d627e1339d15507cc38f980036b928f835e0f0e957d3d8",
|
||||||
"iso_checksum_type": "sha256",
|
"iso_checksum_type": "sha256",
|
||||||
"iso_url": "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-12.4.0-amd64-netinst.iso",
|
"iso_url": "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-10.3.0-amd64-netinst.iso",
|
||||||
"output_directory": "babelbox-qemu",
|
"output_directory": "babelbox-qemu",
|
||||||
"shutdown_command": "sudo systemctl poweroff",
|
"shutdown_command": "sudo systemctl poweroff",
|
||||||
"disk_size": "20480M",
|
"disk_size": "10240M",
|
||||||
"format": "qcow2",
|
"format": "qcow2",
|
||||||
"accelerator": "kvm",
|
"accelerator": "kvm",
|
||||||
"http_directory": "http-qemu",
|
"http_directory": "http-qemu",
|
||||||
"ssh_username": "demo",
|
"ssh_username": "demo",
|
||||||
"ssh_password": "babelbox",
|
"ssh_password": "babelbox",
|
||||||
"ssh_timeout": "20m",
|
"ssh_timeout": "20m",
|
||||||
"vm_name": "babelbox-bookworm",
|
"vm_name": "babelbox-buster",
|
||||||
"net_device": "virtio-net",
|
"net_device": "virtio-net",
|
||||||
"disk_interface": "virtio",
|
"disk_interface": "virtio",
|
||||||
"disk_detect_zeroes": "on",
|
"disk_detect_zeroes": "on",
|
||||||
"boot_wait": "10s",
|
"boot_wait": "10s",
|
||||||
"boot_command": [
|
"boot_command": [
|
||||||
"<esc><wait>",
|
"<esc><wait>",
|
||||||
"install ",
|
"install <wait>",
|
||||||
"preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
|
"preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
|
||||||
"debian-installer/locale=en_US ",
|
"debian-installer/locale=en_US <wait>",
|
||||||
"auto ",
|
"auto <wait>",
|
||||||
"netcfg/get_hostname={{ .Name }} ",
|
"netcfg/get_hostname={{ .Name }} <wait>",
|
||||||
"netcfg/get_domain=demo.local ",
|
"netcfg/get_domain=demo.local <wait>",
|
||||||
"fb=false ",
|
"fb=false <wait>",
|
||||||
"debconf/frontend=noninteractive ",
|
"debconf/frontend=noninteractive <wait>",
|
||||||
"console-setup/ask_detect=false ",
|
"console-setup/ask_detect=false <wait>",
|
||||||
"console-keymaps-at/keymap=de ",
|
"console-keymaps-at/keymap=de <wait>",
|
||||||
"keyboard-configuration/xkb-keymap=de ",
|
"keyboard-configuration/xkb-keymap=de <wait>",
|
||||||
"<enter>"
|
"<enter><wait>"
|
||||||
],
|
],
|
||||||
"memory": "1024",
|
"memory": "1024",
|
||||||
"qemuargs": [
|
"qemuargs": [
|
||||||
["-display", "gtk"]
|
["-display", "sdl"]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
@ -43,7 +43,7 @@ d-i partman-auto/disk string /dev/vda
|
||||||
d-i partman-auto/method string regular
|
d-i partman-auto/method string regular
|
||||||
d-i partman-auto/expert_recipe string \
|
d-i partman-auto/expert_recipe string \
|
||||||
root :: \
|
root :: \
|
||||||
8192 50 8192 ext4 \
|
6144 50 6144 ext4 \
|
||||||
$primary{ } $bootable{ } \
|
$primary{ } $bootable{ } \
|
||||||
method{ format } format{ } \
|
method{ format } format{ } \
|
||||||
use_filesystem{ } filesystem{ ext4 } \
|
use_filesystem{ } filesystem{ ext4 } \
|
||||||
|
@ -78,7 +78,7 @@ d-i apt-setup/security_host string security.debian.org
|
||||||
### Package selection
|
### Package selection
|
||||||
tasksel tasksel/first multiselect standard
|
tasksel tasksel/first multiselect standard
|
||||||
|
|
||||||
d-i pkgsel/include string parted openssh-server acpid sudo ca-certificates curl git vim-nox
|
d-i pkgsel/include string parted openssh-server acpid sudo ca-certificates curl
|
||||||
d-i pkgsel/upgrade select safe-upgrade
|
d-i pkgsel/upgrade select safe-upgrade
|
||||||
|
|
||||||
popularity-contest popularity-contest/participate boolean false
|
popularity-contest popularity-contest/participate boolean false
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Clean up
|
# Clean up
|
||||||
set -e
|
|
||||||
|
|
||||||
|
apt-get --yes remove dmidecode gcc-8 laptop-detect libc6-dev linux-libc-dev
|
||||||
|
apt-get --yes autoremove
|
||||||
apt-get --yes clean
|
apt-get --yes clean
|
||||||
|
|
||||||
# Removing leftover leases and persistent rules
|
# Removing leftover leases and persistent rules
|
||||||
echo "cleaning up dhcp leases"
|
echo "cleaning up dhcp leases"
|
||||||
rm /var/lib/dhcp/*
|
rm /var/lib/dhcp/*
|
||||||
|
|
||||||
# Use systemd-resolved nameserver
|
echo "Adding a 2 sec delay to the interface up, to make the dhclient happy"
|
||||||
echo "nameserver 127.0.0.53" > /etc/resolv.conf
|
echo "pre-up sleep 2" >> /etc/network/interfaces
|
||||||
|
|
|
@ -2,43 +2,20 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
FDISK_VERSION=2.38.1-5+b1
|
apt-get install -y git wget
|
||||||
|
|
||||||
cd /srv
|
cd /srv
|
||||||
curl -L -O http://ftp.debian.org/debian/dists/stable/main/installer-amd64/current/images/hd-media/gtk/initrd.gz
|
wget http://ftp.debian.org/debian/dists/stable/main/installer-amd64/current/images/hd-media/gtk/initrd.gz http://ftp.debian.org/debian/dists/stable/main/installer-amd64/current/images/hd-media/gtk/vmlinuz http://ftp.debian.org/debian/pool/main/u/util-linux/fdisk-udeb_2.33.1-0.1_amd64.udeb
|
||||||
curl -L -O http://ftp.debian.org/debian/dists/stable/main/installer-amd64/current/images/hd-media/gtk/vmlinuz
|
|
||||||
curl -L -O http://ftp.debian.org/debian/pool/main/u/util-linux/fdisk-udeb_${FDISK_VERSION}_amd64.udeb
|
|
||||||
mkdir initrd_with_fdisk
|
mkdir initrd_with_fdisk
|
||||||
cd initrd_with_fdisk
|
cd initrd_with_fdisk
|
||||||
gunzip -c ../initrd.gz | cpio -id
|
gunzip -c ../initrd.gz | cpio -id
|
||||||
dpkg-deb -x ../fdisk-udeb_${FDISK_VERSION}_amd64.udeb .
|
dpkg-deb -x ../fdisk-udeb_2.33.1-0.1_amd64.udeb .
|
||||||
find . | cpio --create --format='newc' | gzip -9 > ../initrd.gz
|
find . | cpio --create --format='newc' | gzip -9 > ../initrd.gz
|
||||||
cd ..
|
cd ..
|
||||||
rm -rf initrd_with_fdisk fdisk-udeb_${FDISK_VERSION}_amd64.udeb
|
rm -rf initrd_with_fdisk fdisk-udeb_2.33.1-0.1_amd64.udeb
|
||||||
git clone https://salsa.debian.org/installer-team/babelbox.git
|
git clone https://salsa.debian.org/installer-team/babelbox.git
|
||||||
cd babelbox
|
cd babelbox
|
||||||
cat babelbox-grub >> /etc/grub.d/40_custom
|
cat babelbox-grub >> /etc/grub.d/40_custom
|
||||||
update-grub
|
update-grub
|
||||||
./cronscript
|
./cronscript
|
||||||
|
|
||||||
cat > /etc/systemd/network/80-dhcp.network <<EOD
|
echo "You need to download a Debian amd64 DVD ISO into /srv"
|
||||||
[Match]
|
|
||||||
Name=en*
|
|
||||||
|
|
||||||
[Network]
|
|
||||||
DHCP=yes
|
|
||||||
EOD
|
|
||||||
|
|
||||||
systemctl enable systemd-networkd.service
|
|
||||||
|
|
||||||
apt-get install --yes systemd-resolved
|
|
||||||
|
|
||||||
cat >> /home/demo/.bashrc <<EOD
|
|
||||||
DEBIAN_VERSION=12.4.0
|
|
||||||
|
|
||||||
if [ ! -f /srv/debian-\${DEBIAN_VERSION}-amd64-DVD-1.iso ]; then
|
|
||||||
echo "downloading Debian amd64 DVD ISO into /srv"
|
|
||||||
curl -L -O https://cdimage.debian.org/debian-cd/current/amd64/iso-dvd/debian-\${DEBIAN_VERSION}-amd64-DVD-1.iso
|
|
||||||
sudo mv debian-\${DEBIAN_VERSION}-amd64-DVD-1.iso /srv/
|
|
||||||
fi
|
|
||||||
EOD
|
|
||||||
|
|
Loading…
Reference in a new issue