Merge pull request #830 from Max13/alpine-virt

Update Alpine Linux (Virt) to 3.18.4
This commit is contained in:
Jeremy Grossmann 2023-10-15 11:39:18 +10:00 committed by GitHub
commit ca8007ffc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 37 additions and 7 deletions

View File

@ -25,6 +25,14 @@
"kvm": "allow"
},
"images": [
{
"filename": "alpine-virt-3.18.4.qcow2",
"version": "3.18.4",
"md5sum": "99d393c16c870e12c4215aadd82ca998",
"filesize": 51066880,
"download_url": "https://sourceforge.net/projects/gns-3/files/Qemu%20Appliances/",
"direct_download_url": "https://sourceforge.net/projects/gns-3/files/Qemu%20Appliances/alpine-virt-3.18.4.qcow2/download"
},
{
"filename": "alpine-virt-3.16.img",
"version": "3.16",
@ -35,6 +43,12 @@
}
],
"versions": [
{
"name": "3.18.4",
"images": {
"hda_disk_image": "alpine-virt-3.18.4.qcow2"
}
},
{
"name": "3.16",
"images": {

View File

@ -1,8 +1,8 @@
# Packer for Alpine (Virt) GNS3 appliance
This is the bare version of `Alpine Linux` installed from iso, no extra package added.
This is the bare version of `Alpine Linux` installed from iso, no extra package added. From `v3.18.4`, the image file goes from 100MB to 200MB, and is using `qcow2` format to allow compression.
Build in 1m12s on `macOS Monterey`.
Build in 1m14s on `macOS Monterey`.
### Linux (tested)
@ -20,3 +20,9 @@ packer build -var-file macos.json alpine.json
```
> :information_source: Uses `hvf` QEMU accelerator. `Packer` will fail on `macOS` without `hvf` (timing issue).
See:
- https://wiki.alpinelinux.org/wiki/Alpine_setup_scripts#setup-disk
- https://wiki.alpinelinux.org/wiki/Enable_Serial_Console_on_Boot#Example_.2Fboot.2Fextlinux.conf
- https://wiki.alpinelinux.org/wiki/Install_to_disk
- https://www.packer.io/plugins/builders/qemu

View File

@ -1,6 +1,7 @@
{
"variables": {
"accelerator": "kvm"
"accelerator": "kvm",
"img_name": "alpine-virt-3.18.4"
},
"builders": [
{
@ -8,11 +9,11 @@
"type": "qemu",
"accelerator": "{{ user `accelerator` }}",
"use_default_display": true,
"iso_url": "https://dl-cdn.alpinelinux.org/alpine/v3.16/releases/x86_64/alpine-virt-3.16.2-x86_64.iso",
"iso_checksum": "6c7cb998ec2c8925d5a1239410a4d224b771203f916a18f8015f31169dd767a2",
"iso_url": "https://dl-cdn.alpinelinux.org/alpine/v3.18/releases/x86_64/alpine-virt-3.18.4-x86_64.iso",
"iso_checksum": "24d79bc148c05a864c2914dfa41a6ffbf808973e44de88c7700d30b4517965b2",
"http_directory": "./files",
"vm_name": "alpine-virt-3.16.img",
"disk_size": "92M",
"vm_name": "{{ user `img_name` }}.img",
"disk_size": "200M",
"format": "raw",
"qemu_img_args": {
"create": ["-o", "preallocation=off"]
@ -31,5 +32,14 @@
"poweroff<enter>"
]
}
],
"post-processors": [
{
"type": "shell-local",
"inline": [
"qemu-img convert -c -O qcow2 output-qemu/{{ user `img_name` }}.img output-qemu/{{ user `img_name` }}.qcow2",
"rm output-qemu/{{ user `img_name` }}.img"
]
}
]
}