Compare commits

...

1 Commits

Author SHA1 Message Date
Michael Aldridge c97a67c04f packer: Add AWS AMI
This commit adds a packer configuration to build an AWS AMI.  The AMI
works in that it is a bootable void image that if it could be imported
to AWS it would be bootable and would work.  Unfortunately, AWS is
doing really naive string parsing on files in /boot rather than
checking that the contents are actually what they claim to be so the
import task fails.

NOTICE: AWS is the only cloud that this has been observed happening
on.  We can run as a vendor supported distro in GCP and in Azure
clouds, and so if you need Void on an enterprise cloud those are the
providers to look at.  If you're interested in a hobbyist cloud, Void
runs critical infrastructure in DigitalOcean and it is a fully
supported environment.

We could probably masquerade the kernel as something that would pass
the string parsing, because it appears that this parsing layer exists
only in the vm import service and not actually in any of the
functional parts of EC2, but that would require using a different
mechanism to install Void, and the ROI on supporting a single cloud in
this way just isn't there.  This import mechanism also appears to only
work on amd64 architectures, so it can't even support the newer
graviton instance types.
2020-08-30 15:48:44 -07:00
5 changed files with 47 additions and 4 deletions

View File

@ -10,3 +10,6 @@ templates/digitalocean-glibc64.json: templates fragments/base-qemu-glibc64.json
templates/vagrant-glibc64.json: templates fragments/base-vbox-glibc64.json fragments/platform-vagrant.json
jq -s 'add' fragments/base-vbox-glibc64.json fragments/platform-vagrant.json > templates/vagrant-glibc64.json
templates/aws-glibc64.json: templates fragments/base-qemu-glibc64.json fragments/provisioner-cloud.json fragments/platform-digitalocean.json
jq -s 'add' fragments/base-qemu-glibc64.json fragments/provisioner-cloud.json fragments/platform-aws.json > templates/aws-glibc64.json

View File

@ -10,17 +10,16 @@
"boot_wait": "5s",
"disk_interface": "virtio",
"disk_size": "1000M",
"format": "qcow2",
"format": "raw",
"vm_name": "void.raw",
"http_directory": "http",
"iso_checksum": "sha256:d95d40e1eb13a7776b5319a05660792fddd762662eaecee5df6b8feb3aa9b391",
"iso_url": "https://alpha.de.repo.voidlinux.org/live/20200722/void-live-x86_64-5.7.10_1-20200722.iso",
"output_directory": "output_void_qcow2",
"shutdown_command": "echo 'void' | sudo -S shutdown -P now",
"ssh_password": "void",
"ssh_timeout": "20m",
"ssh_username": "void",
"type": "qemu",
"vm_name": "DO-glibc64"
"type": "qemu"
}
]
}

View File

@ -0,0 +1,12 @@
{
"post-processors": [
{
"type": "amazon-import",
"s3_bucket_name": "{{user `s3_bucket_name`}}",
"format": "raw"
}
],
"variables": {
"s3_bucket_name": "{{env `S3_BUCKET_NAME`}}"
}
}

View File

@ -0,0 +1,19 @@
{
"builds": [
{
"name": "qemu",
"builder_type": "qemu",
"build_time": 1598776155,
"files": [
{
"name": "output-qemu/packer-qemu",
"size": 1048576000
}
],
"artifact_id": "VM",
"packer_run_uuid": "bef5beb0-c26f-2680-495d-6a04ca26e636",
"custom_data": null
}
],
"last_run_uuid": "bef5beb0-c26f-2680-495d-6a04ca26e636"
}

View File

@ -0,0 +1,10 @@
#!/bin/sh
df -h
rm -rf /var/cache/xbps/
df -h
echo 'ignorepkg=linux' > /etc/xbps.d/90-ignore-linux.conf
xbps-remove -Ry linux
rm -fv /boot/"*$(uname -r)*"
xbps-install -y linux-lts