Skip to content
Open
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
1 change: 1 addition & 0 deletions .github/workflows/pkr-bld-hyperv-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
os:
- almalinux-8
- almalinux-9
- alpine-3.21
- centos-stream-9
- centos-stream-10
- debian-11
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/pkr-bld-parallels-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
os:
- almalinux-8
- almalinux-9
- alpine-3.21
- centos-stream-9
- centos-stream-10
- debian-11
Expand All @@ -36,11 +37,11 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@main
# - name: Setup Packer
# if: steps.verify-changed-files.outputs.files_changed == 'true'
# uses: hashicorp/setup-packer@main
# with:
# version: latest
# - name: Setup Packer
# if: steps.verify-changed-files.outputs.files_changed == 'true'
# uses: hashicorp/setup-packer@main
# with:
# version: latest
- name: Bento build
run: |
eval "$(chef shell-init bash)"
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/pkr-bld-parallels-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
os:
- almalinux-8
- almalinux-9
- alpine-3.21
- centos-stream-9
- centos-stream-10
- debian-11
Expand All @@ -36,10 +37,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@main
# - name: Setup Packer
# uses: hashicorp/setup-packer@main
# with:
# version: latest
# - name: Setup Packer
# uses: hashicorp/setup-packer@main
# with:
# version: latest
- name: Bento build
run: |
eval "$(chef shell-init bash)"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pkr-bld-qemu-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
os:
- almalinux-8
- almalinux-9
- alpine-3.21
- centos-stream-9
- centos-stream-10
- debian-11
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pkr-bld-qemu-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
os:
- almalinux-8
- almalinux-9
- alpine-3.21
- centos-stream-9
- centos-stream-10
- debian-11
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pkr-bld-virtualbox-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
os:
- almalinux-8
- almalinux-9
- alpine-3.21
- centos-stream-9
- centos-stream-10
- debian-11
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pkr-bld-virtualbox-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
os:
- almalinux-8
- almalinux-9
- alpine-3.21
- centos-stream-9
- centos-stream-10
- debian-11
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pkr-bld-vmware-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
os:
- almalinux-8
- almalinux-9
- alpine-3.21
- centos-stream-9
- centos-stream-10
- debian-11
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pkr-bld-vmware-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
os:
- almalinux-8
- almalinux-9
- alpine-3.21
- centos-stream-9
- centos-stream-10
- debian-11
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-pkr-bld-parallels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
os:
- almalinux-8
- almalinux-9
- alpine-3.21
- centos-stream-9
- debian-11
- debian-12
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Markdown table generated at <https://www.tablesgenerator.com/markdown_tables#>
|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
| almalinux-8 | | x | na | x | na | x | na | x | na |
| almalinux-9 | | x | x | x | | x | x | x | x |
| alpine-3.21 | TBD | TBD | TBD | TBD | TBD | TBD | TBD | TDB | TDB |
| amazonlinux-2023 | | | | | | x | | | |
| centos-stream-9 | | x | x | x | | x | x | x | x |
| centos-stream-10 | | x | x | x | | x | x | x | x |
Expand Down
55 changes: 55 additions & 0 deletions alpine-3.21-aarch64-virtualbox-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/sh

if [ ! -z "${BASH_VERSION+x}" ]; then
this_file="${BASH_SOURCE[0]}"
set -o pipefail
elif [ ! -z "${ZSH_VERSION+x}" ]; then
this_file="${(%):-%x}"
set -o pipefail
else
this_file="${0}"
fi
set -feu

export ARCH="${ARCH:-aarch64}"
export VERSION="${VERSION:-3.21.2}"
export VERSION_MAJOR_MINOR="${VERSION%.*}"

# Getting script directory location
SCRIPT_RELATIVE_DIR=$(dirname -- "${this_file}")
cd -- "$SCRIPT_RELATIVE_DIR" || exit

# set tmp dir for files
ALPDIR="$(pwd)/builds/build_files/alpine-${VERSION}-${ARCH}-virtualbox"
[ -d "$ALPDIR" ] || mkdir -p -- "$ALPDIR"

echo "Cleaning up old files"
set +f
rm -f -- "$ALPDIR"/*.iso "$ALPDIR"/*.ovf "$ALPDIR"/*.vmdk "$ALPDIR"/*.vdi

NAME='generic_alpine-'"${VERSION}"'-'"${ARCH}"'-uefi-tiny-r0'
export QCOW="${NAME}"'.qcow2'
export VMDK="${NAME}"'.vmdk'
export VDI="${NAME}"'.vdi'

if [ ! -f "$ALPDIR"'/'"${QCOW}" ]; then
wget -q -O -- "$ALPDIR"'/'"${QCOW}" 'https://dl-cdn.alpinelinux.org/alpine/v'"${VERSION_MAJOR_MINOR}"'/releases/cloud/'"${QCOW}"
fi

if [ ! -f "${VMDK}" ]; then
qemu-img convert -f qcow2 -O vmdk -- "$ALPDIR"'/'"${QCOW}" "$ALPDIR"'/'"${VMDK}" # &
fi

if [ ! -f "${VMDK}" ]; then
qemu-img convert -f qcow2 -O vdi -- "$ALPDIR"'/'"${QCOW}" "$ALPDIR"'/'"${VDI}" # &
fi

wait

echo "starting packer build of alpine ${VERSION} for ${ARCH}"
if bento build --vars 'ssh_timeout=60m' --vars vbox_source_path="$ALPDIR"/alpine_arm64.ovf,vbox_checksum=null "$(pwd)"/os_pkrvars/alpine/alpine-3.21-aarch64.pkrvars.hcl; then
echo "Cleaning up files"
rm -rf -- "$ALPDIR"
else
exit 1
fi
5 changes: 4 additions & 1 deletion builds.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
vagrant_cloud_account: 'bento'
vagrant_cloud_account: "bento"

default_architectures:
- x86_64
Expand All @@ -9,6 +9,7 @@ public:
- amazonlinux-2023
- almalinux-8
- almalinux-9
- alpine-3.21
- centos-stream-9
- centos-stream-10
- debian-11
Expand All @@ -30,6 +31,7 @@ public:
slugs:
- almalinux-8
- almalinux-9
- alpine-3.21
- debian-12
- debian-11
- fedora-latest
Expand All @@ -51,6 +53,7 @@ do_not_build:
- rhel
- windows
# - almalinux
# - alpine-3.21
# - centos
# - debian
# - fedora
Expand Down
10 changes: 10 additions & 0 deletions os_pkrvars/alpine/alpine-3.21-aarch64.pkrvars.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
os_name = "alpine"
os_version = "3.21"
os_arch = "aarch64"
iso_url = "https://dl-cdn.alpinelinux.org/alpine/v3.21/releases/aarch64/alpine-standard-3.21.3-aarch64.iso"
iso_checksum = "file:https://dl-cdn.alpinelinux.org/alpine/v3.21/releases/aarch64/alpine-standard-3.21.3-aarch64.iso.sha256"
parallels_guest_os_type = "otherlinux"
vbox_guest_os_type = "ArchLinux_arm64"
vmware_guest_os_type = "otherlinux"
parallels_boot_wait = "0s"
boot_command = ["<up>e<wait><down><down><end> inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/fedora/ks.cfg inst.repo=https://download.fedoraproject.org/pub/fedora/linux/releases/41/Server/aarch64/os/ <F10><wait>"]
9 changes: 9 additions & 0 deletions os_pkrvars/alpine/alpine-3.21-x86_64.pkrvars.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
os_name = "alpine"
os_version = "3.21"
os_arch = "x86_64"
iso_url = "https://dl-cdn.alpinelinux.org/alpine/v3.21/releases/x86_64/alpine-standard-3.21.3-x86_64.iso"
iso_checksum = "file:https://dl-cdn.alpinelinux.org/alpine/v3.21/releases/x86_64/alpine-standard-3.21.3-x86_64.iso.sha256"
parallels_guest_os_type = "otherlinux"
vbox_guest_os_type = "ArchLinux_64"
vmware_guest_os_type = "otherlinux-64"
boot_command = ["<wait><up>e<wait><down><down><end> inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/fedora/ks.cfg inst.repo=https://download.fedoraproject.org/pub/fedora/linux/releases/41/Server/x86_64/os/ <F10><wait>"]
21 changes: 21 additions & 0 deletions os_pkrvars/alpine/alpine-3_21-aarch64.pkrvars.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
os_name = "alpine"
os_version = "3_21"
os_arch = "aarch64"
iso_url = "https://dl-cdn.alpinelinux.org/alpine/v3.21/releases/aarch64/alpine-standard-3.21.3-aarch64.iso"
iso_checksum = "file:https://dl-cdn.alpinelinux.org/alpine/v3.21/releases/aarch64/alpine-standard-3.21.3-aarch64.iso.sha256"
parallels_guest_os_type = "otherlinux"
vbox_guest_os_type = "ArchLinux_arm64"
vmware_guest_os_type = "otherlinux"
parallels_boot_wait = "0s"
boot_command = ["root<enter><wait>",
"ifconfig eth0 up && udhcpc -i eth0<enter><wait5>",
"wget http://{{ .HTTPIP }}:{{ .HTTPPort }}/answers<enter><wait>",
"setup-alpine -f answers<enter><wait5>",
"{{user `ssh_password`}}<enter><wait>",
"{{user `ssh_password`}}<enter><wait5>",
"<wait>y<enter><wait10>",
"rc-service sshd stop<enter>",
"mount /dev/sda3 /mnt<enter>",
"echo 'PermitRootLogin yes' >> /mnt/etc/ssh/sshd_config<enter>",
"umount /mnt<enter>",
"reboot<enter>"]
46 changes: 46 additions & 0 deletions packer_templates/http/alpine/ks.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
lang en_US.UTF-8
keyboard --xlayouts='us'
network --bootproto=dhcp --noipv6 --onboot=on --device=eth0
rootpw --plaintext vagrant
firewall --disabled
selinux --permissive
timezone UTC
bootloader --timeout=1 --location=mbr --append="net.ifnames=0 biosdevname=0"
text
skipx
zerombr
clearpart --all --initlabel
autopart --nohome --nolvm --noboot
firstboot --disabled
reboot --eject
user --name=vagrant --plaintext --password vagrant

%packages
bzip2
tar
wget
nfs-utils
net-tools
rsync
akms
%end

%post
# sudo
echo 'Defaults:vagrant !requiretty' > /etc/sudoers.d/vagrant
echo '%vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers.d/vagrant
chmod 440 /etc/sudoers.d/vagrant

# Enable hyper-v daemons only if using hyper-v virtualization
if [ $(virt-what) == "hyperv" ]; then
apk add hvtools

rc-service hv_fcopy_daemon start
rc-service hv_kvp_daemon start
rc-service hv_vss_daemon start

rc-update add hv_fcopy_daemon
rc-update add hv_kvp_daemon
rc-update add hv_vss_daemon
fi
%end
36 changes: 25 additions & 11 deletions packer_templates/pkr-builder.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,31 @@ locals {
"${path.root}/scripts/fedora/real-tmp_fedora.sh",
"${path.root}/scripts/fedora/cleanup_dnf.sh",
"${path.root}/scripts/_common/minimize.sh"
] : [
"${path.root}/scripts/rhel/update_dnf.sh",
"${path.root}/scripts/_common/motd.sh",
"${path.root}/scripts/_common/sshd.sh",
"${path.root}/scripts/_common/vagrant.sh",
"${path.root}/scripts/_common/virtualbox.sh",
"${path.root}/scripts/_common/vmware.sh",
"${path.root}/scripts/_common/parallels.sh",
"${path.root}/scripts/rhel/cleanup_dnf.sh",
"${path.root}/scripts/_common/minimize.sh"
]
] : var.os_name == "alpine" ? [
"${path.root}/scripts/alpine/networking_alpine.sh",
"${path.root}/scripts/alpine/update_apk.sh",
"${path.root}/scripts/_common/motd.sh",
"${path.root}/scripts/_common/sshd.sh",
"${path.root}/scripts/alpine/install-supporting-packages_alpine.sh",
"${path.root}/scripts/alpine/build-tools_alpine.sh",
"${path.root}/scripts/_common/virtualbox.sh",
"${path.root}/scripts/_common/vmware.sh",
"${path.root}/scripts/_common/parallels.sh",
"${path.root}/scripts/_common/vagrant.sh",
"${path.root}/scripts/alpine/real-tmp_alpine.sh",
"${path.root}/scripts/alpine/cleanup_apk.sh",
"${path.root}/scripts/_common/minimize.sh"
] : [
"${path.root}/scripts/rhel/update_dnf.sh",
"${path.root}/scripts/_common/motd.sh",
"${path.root}/scripts/_common/sshd.sh",
"${path.root}/scripts/_common/vagrant.sh",
"${path.root}/scripts/_common/virtualbox.sh",
"${path.root}/scripts/_common/vmware.sh",
"${path.root}/scripts/_common/parallels.sh",
"${path.root}/scripts/rhel/cleanup_dnf.sh",
"${path.root}/scripts/_common/minimize.sh"
]
)
)
)
Expand Down
2 changes: 2 additions & 0 deletions packer_templates/scripts/_common/virtualbox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ virtualbox-iso|virtualbox-ovf)
apt-get install -y build-essential dkms bzip2 tar linux-headers-"$(uname -r)"
elif [ -f "/usr/bin/zypper" ]; then
zypper install -y perl cpp gcc make bzip2 tar kernel-default-devel
elif [ -f "/sbin/apk" ]; then
apk add perl musl-dev gcc make bzip2 tar linux-headers
fi

echo "installing the vbox additions for architecture $ARCHITECTURE"
Expand Down
6 changes: 4 additions & 2 deletions packer_templates/scripts/_common/vmware.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash -eux
#!/bin/sh

set -eux

# set a default HOME_DIR environment variable if not set
HOME_DIR="${HOME_DIR:-/home/vagrant}"
Expand All @@ -12,7 +14,7 @@ vmware-iso|vmware-vmx)
systemctl start vmtoolsd
elif [ -f "/usr/bin/apt-get" ]; then
# determine the major Debian version we're runninng
major_version="$(grep VERSION_ID /etc/os-release | awk -F= '{print $2}' | tr -d '"')"
major_version="$(. /etc/os-release | printf '%s' "${VERSION_ID}")"
architecture="$(uname -m)"
# open-vm-tools for amd64 are only available in bullseye-backports repo
echo "install open-vm-tools"
Expand Down
5 changes: 5 additions & 0 deletions packer_templates/scripts/alpine/build-tools_alpine.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

set -eux

apk add autoconf gcc libelf libtool linux-headers make musl-dev perl
Loading
Loading