Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ stamps*
!dracut/*/*.sh
!packer/scripts/*.sh
void-live-*/
distdir-*/
release/
packer/cloud-*/
packer/vagrant-*/
10 changes: 7 additions & 3 deletions mkimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ usage() {
-b <fstype> /boot filesystem type (default: vfat)
-B <bsize> /boot filesystem size (default: 256MiB)
-r <fstype> / filesystem type (default: ext4)
-s <totalsize> Total image size (default: 2GiB)
-s <totalsize> Total image size (default: 768MiB)
-o <output> Image filename (default: guessed automatically)
-x <num> Number of threads to use for image compression (default: dynamic)
-h Show this help and exit
Expand Down Expand Up @@ -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}"
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions packer/hcl2/source-qemu.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions packer/hcl2/source-virtualbox-ose.pkr.hcl
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
16 changes: 16 additions & 0 deletions packer/plugins.pkr.hcl
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
14 changes: 2 additions & 12 deletions packer/scripts/cloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down