Skip to content

Commit 753a11f

Browse files
committed
Add Alpine 3.22
1 parent 4b015d9 commit 753a11f

2 files changed

Lines changed: 92 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ jobs:
4747
- alpine319
4848
- alpine320
4949
- alpine321
50+
- alpine322
5051
- archlinux
5152
- debian13
5253
- fedora40

alpine-3.22.pkr.hcl

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
source "qemu" "alpine322" {
2+
iso_url = "https://mirrors.edge.kernel.org/alpine/v3.22/releases/x86_64/alpine-virt-3.22.0-x86_64.iso"
3+
iso_checksum = "file:https://mirrors.edge.kernel.org/alpine/v3.22/releases/x86_64/alpine-virt-3.22.0-x86_64.iso.sha256"
4+
vga = "virtio"
5+
cpus = 2
6+
memory = 4096
7+
headless = var.headless
8+
shutdown_command = "/sbin/poweroff"
9+
qmp_enable = var.headless
10+
disk_discard = "unmap"
11+
http_content = {
12+
"/alpine-answer.sh" = templatefile("${path.root}/alpine-answer.sh", { path = path, hostname = "alpine322" })
13+
"/vagrant.pub" = file("${path.root}/keys/vagrant.pub")
14+
}
15+
ssh_username = "root"
16+
ssh_private_key_file = "${path.root}/keys/vagrant"
17+
boot_wait = "1m"
18+
boot_command = [
19+
"<enter><wait10>",
20+
"root<enter><wait10>",
21+
"setup-interfaces -a -r && ",
22+
"setup-sshd -k 'http://{{ .HTTPIP }}:{{ .HTTPPort }}/vagrant.pub' openssh<enter>",
23+
]
24+
efi_firmware_code = "${path.root}/ovmf/OVMF_CODE.4m.fd"
25+
efi_firmware_vars = "${path.root}/ovmf/OVMF_VARS.4m.fd"
26+
qemuargs = [["-serial", "stdio"]]
27+
machine_type = var.machine_type
28+
}
29+
30+
build {
31+
sources = [
32+
"source.qemu.alpine322"
33+
]
34+
35+
provisioner "shell" {
36+
inline = [
37+
"setup-alpine -e -f 'http://${build.PackerHTTPAddr}/alpine-answer.sh'",
38+
]
39+
40+
env = {
41+
"ERASE_DISKS" = "/dev/vda"
42+
}
43+
}
44+
45+
provisioner "shell" {
46+
inline = [
47+
"apk add efibootmgr",
48+
"efibootmgr -c -d /dev/vda -p 1 -L alpine -l '\\EFI\\alpine\\grubx64.efi'",
49+
]
50+
}
51+
52+
provisioner "shell" {
53+
inline = ["reboot"]
54+
expect_disconnect = true
55+
pause_after = "1m"
56+
}
57+
58+
provisioner "shell" {
59+
start_retry_timeout = "10m"
60+
inline = [
61+
"setup-xorg-base",
62+
"setup-desktop gnome",
63+
"apk add qemu-guest-agent spice-vdagent spice-webdavd rsync",
64+
"rc-update add qemu-guest-agent",
65+
"rc-update add spice-vdagentd",
66+
"rc-update add spice-webdavd",
67+
"usermod -p '${bcrypt("vagrant")}' vagrant",
68+
"usermod -p '${bcrypt("vagrant")}' root",
69+
"echo 'permit nopass :vagrant' >/etc/doas.d/vagrant.conf",
70+
"rm -rf /var/cache/apk/*",
71+
"fstrim -v /",
72+
]
73+
}
74+
75+
post-processors {
76+
post-processor "vagrant" {
77+
vagrantfile_template = "Vagrantfile"
78+
include = [
79+
"${path.root}/ovmf/OVMF_CODE.4m.fd",
80+
"${path.root}/output-${source.name}/efivars.fd",
81+
"${path.root}/ovmf/edk2.License.txt",
82+
"${path.root}/ovmf/OvmfPkg.License.txt",
83+
]
84+
}
85+
86+
post-processor "vagrant-registry" {
87+
box_tag = "gnome-shell-box/alpine322"
88+
version = local.version
89+
}
90+
}
91+
}

0 commit comments

Comments
 (0)