diff --git a/.gitignore b/.gitignore index 82ba82d917..538c33fbd5 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,7 @@ stamps* !dracut/*/*.sh !packer/scripts/*.sh void-live-*/ +distdir-*/ release/ +packer/cloud-*/ +packer/vagrant-*/ diff --git a/mkimage.sh b/mkimage.sh index 1d691cc681..9e27bcd59c 100755 --- a/mkimage.sh +++ b/mkimage.sh @@ -65,7 +65,7 @@ usage() { -b /boot filesystem type (default: vfat) -B /boot filesystem size (default: 256MiB) -r / filesystem type (default: ext4) - -s Total image size (default: 2GiB) + -s Total image size (default: 768MiB) -o Image filename (default: guessed automatically) -x Number of threads to use for image compression (default: dynamic) -h Show this help and exit @@ -128,10 +128,10 @@ case "$PLATFORM" in ;; esac # By default we build all platform images with a 256MiB boot partition -# formated FAT16, and an approximately 1.88GiB root partition formatted +# formated FAT16, and an approximately 512MiB root partition formatted # ext4. More exotic combinations are of course possible, but this # combination works on all known platforms. -: "${IMGSIZE:=2G}" +: "${IMGSIZE:=768M}" : "${BOOT_FSTYPE:=vfat}" : "${BOOT_FSSIZE:=256MiB}" : "${ROOT_FSTYPE:=ext4}" @@ -245,6 +245,10 @@ fi # ensure ssh login is possible for headless setups. sed -i "${ROOTFS}/etc/ssh/sshd_config" -e 's|^#\(PermitRootLogin\) .*|\1 yes|g' +# Grow rootfs to fill the media on boot +run_cmd_target "xbps-install -Syr $ROOTFS cloud-guest-utils" +sed -i "${ROOTFS}/etc/default/growpart" -e 's/#ENABLE/ENABLE/' + # This section does final configuration on the images. In the case of # SBCs this writes the bootloader to the image or sets up other # required binaries to boot. In the case of images destined for a diff --git a/packer/hcl2/source-qemu.pkr.hcl b/packer/hcl2/source-qemu.pkr.hcl index 5d2b5db0e8..f1e870042c 100644 --- a/packer/hcl2/source-qemu.pkr.hcl +++ b/packer/hcl2/source-qemu.pkr.hcl @@ -5,8 +5,8 @@ source "qemu" "x86_64" { disk_size = "2000M" format = "qcow2" http_directory = "http" - iso_checksum = "sha256:5507fe41f54719e78db7b0f9c685f85b063616d913b14f815dd481b5ea66e397" - iso_url = "https://repo-default.voidlinux.org/live/20221001/void-live-x86_64-20221001-base.iso" + iso_url = "https://repo-default.voidlinux.org/live/20240314/void-live-x86_64-20240314-base.iso" + iso_checksum = "sha256:c1a3c0aff363057132f8dab80287396df8a8b4d7cd7f7d8d3f0e2c3ee9e5be7d" ssh_password = "void" ssh_timeout = "20m" ssh_username = "void" diff --git a/packer/hcl2/source-virtualbox-ose.pkr.hcl b/packer/hcl2/source-virtualbox-ose.pkr.hcl index 58e0cce030..a01a2279e5 100644 --- a/packer/hcl2/source-virtualbox-ose.pkr.hcl +++ b/packer/hcl2/source-virtualbox-ose.pkr.hcl @@ -1,7 +1,7 @@ source "virtualbox-iso" "x86_64" { guest_os_type = "Linux_64" - iso_url = "https://repo-default.voidlinux.org/live/20221001/void-live-x86_64-20221001-base.iso" - iso_checksum = "sha256:5507fe41f54719e78db7b0f9c685f85b063616d913b14f815dd481b5ea66e397" + iso_url = "https://repo-default.voidlinux.org/live/20240314/void-live-x86_64-20240314-base.iso" + iso_checksum = "sha256:c1a3c0aff363057132f8dab80287396df8a8b4d7cd7f7d8d3f0e2c3ee9e5be7d" ssh_username = "void" ssh_password = "void" http_directory = "http" diff --git a/packer/plugins.pkr.hcl b/packer/plugins.pkr.hcl new file mode 100644 index 0000000000..7de2aaa61d --- /dev/null +++ b/packer/plugins.pkr.hcl @@ -0,0 +1,16 @@ +packer { + required_plugins { + qemu = { + version = "~> 1" + source = "github.com/hashicorp/qemu" + } + vagrant = { + version = "~> 1" + source = "github.com/hashicorp/vagrant" + } + virtualbox = { + version = "~> 1" + source = "github.com/hashicorp/virtualbox" + } + } +} diff --git a/packer/scripts/cloud.sh b/packer/scripts/cloud.sh index e942f875cb..328d194c15 100644 --- a/packer/scripts/cloud.sh +++ b/packer/scripts/cloud.sh @@ -5,20 +5,10 @@ echo "Defaults:void !requiretty" >> /etc/sudoers.d/99-void chmod 0440 /etc/sudoers.d/99-void mv /etc/sudoers.d/{,10-}wheel -xbps-fetch -o /usr/bin/growpart https://raw.githubusercontent.com/canonical/cloud-utils/ubuntu/0.31-22-g37d4e32a-0ubuntu1/bin/growpart -chmod +x /usr/bin/growpart - -xbps-install -Sy util-linux coreutils sed shinit +xbps-install -Sy util-linux coreutils sed shinit cloud-guest-utils ln -s /etc/sv/shinit /var/service/ -cat <<'EOF' > /etc/runit/core-services/10-resize-root.sh -#!/bin/sh -rpart=$(findmnt -r -o SOURCE -v -n /) -rnum=$(cat /sys/class/block/$(basename $rpart)/partition) - -/usr/bin/growpart ${rpart%%$rnum} $rnum -resize2fs $rpart -EOF +sed -i -e 's/#ENABLE/ENABLE/' /etc/default/growpart passwd -dl void passwd -dl root