x86_64 to amd64 to match Vagrant arch names

This commit is contained in:
Greg Hellings
2023-11-27 21:00:35 -06:00
parent 997880276d
commit d472bf08d5
41 changed files with 99 additions and 75 deletions
+3 -3
View File
@@ -31,15 +31,15 @@ jobs:
build: build:
name: Build box name: Build box
runs-on: ${{ matrix.builder == 'virtualbox-iso.x86_64' && 'macOS-12' || 'ubuntu-22.04' }} runs-on: ${{ matrix.builder == 'virtualbox-iso.amd64' && 'macOS-12' || 'ubuntu-22.04' }}
needs: needs:
- collect - collect
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
builder: builder:
- virtualbox-iso.x86_64 - virtualbox-iso.amd64
- qemu.x86_64 - qemu.amd64
distro: ${{ fromJson( needs.collect.outputs.distros ) }} distro: ${{ fromJson( needs.collect.outputs.distros ) }}
needs_timeout: needs_timeout:
- distros/ubuntu-20.04-x86_64.pkrvars.hcl - distros/ubuntu-20.04-x86_64.pkrvars.hcl
+1 -1
View File
@@ -16,7 +16,7 @@
1. Try a build 1. Try a build
1. You can execute directly with the `packer` executable, if you want 1. You can execute directly with the `packer` executable, if you want
1. If you want to wrap up standard options, or build multiple versions/distros at once, use the `build.xsh` file 1. If you want to wrap up standard options, or build multiple versions/distros at once, use the `build.xsh` file
1. `xonsh build.xsh -d <distro> -b hyperv-iso.x86_64 -v` 1. `xonsh build.xsh -d <distro> -b hyperv-iso.amd64 -v`
1. You can substitute out any of the options with `-a` to build "all" targets that match 1. You can substitute out any of the options with `-a` to build "all" targets that match
### Troubleshooting ### Troubleshooting
+1 -1
View File
@@ -16,7 +16,7 @@ support = Support()
parser = ArgumentParser("Build a box") parser = ArgumentParser("Build a box")
parser.add_argument("--distro", "-d", help="Name of the distro/ folder") parser.add_argument("--distro", "-d", help="Name of the distro/ folder")
parser.add_argument("--version", "-v", help="Version of the distro to build") parser.add_argument("--version", "-v", help="Version of the distro to build")
parser.add_argument("--build", "-b", help="Name of the target build, e.g. qemu.x86_64, virtualbox-iso.x86_64") parser.add_argument("--build", "-b", help="Name of the target build, e.g. qemu.amd64, virtualbox-iso.amd64")
parser.add_argument("--list", "-l", help="List all build targets", action="store_true") parser.add_argument("--list", "-l", help="List all build targets", action="store_true")
parser.add_argument("--all", "-a", help="Build all applicable targets", action="store_true") parser.add_argument("--all", "-a", help="Build all applicable targets", action="store_true")
parser.add_argument("--upload", "-u", help="Force doing uploads", action="store_true") parser.add_argument("--upload", "-u", help="Force doing uploads", action="store_true")
+1 -1
View File
@@ -4,7 +4,7 @@ source ./test.xsh
parser = argparse.ArgumentParser("Build all") parser = argparse.ArgumentParser("Build all")
parser.add_argument("--provider", choices=get_providers(), default="qemu.x86_64") parser.add_argument("--provider", choices=get_providers(), default="qemu.amd64")
args = parser.parse_args() args = parser.parse_args()
@@ -1,8 +1,8 @@
distro = "archlinux" distro = "archlinux"
version = "rolling" version = "rolling"
iso = { iso = {
url = "http://dfw.mirror.rackspace.com/archlinux/iso/2023.08.01/archlinux-x86_64.iso" url = "http://dfw.mirror.rackspace.com/archlinux/iso/2023.11.01/archlinux-2023.11.01-x86_64.iso"
checksum = "3bf1287333de5c26663b70a17ce7573f15dc60780b140cbbd1c720338c0abac5" checksum = "477f50617d648e46d6e326549aa56ab92115a29a97f2ca364e944cea06970608"
} }
boot_command = [ boot_command = [
"<tab><wait> net.ifnames=0<wait> <wait>bi<wait>osdevnames=0<enter>", "<tab><wait> net.ifnames=0<wait> <wait>bi<wait>osdevnames=0<enter>",
+4 -4
View File
@@ -1,9 +1,9 @@
rolling: rolling:
- arch: x86_64 - arch: amd64
provider: qemu provider: qemu
- arch: x86_64 - arch: amd64
provider: virtualbox-iso provider: virtualbox-iso
- arch: x86_64 - arch: amd64
provider: vmware-iso provider: vmware-iso
- arch: x86_64 - arch: amd64
provider: hyperv-iso provider: hyperv-iso
+3 -3
View File
@@ -1,8 +1,8 @@
8: &supp 8: &supp
- arch: x86_64 - arch: amd64
provider: qemu provider: qemu
- arch: x86_64 - arch: amd64
provider: virtualbox-iso provider: virtualbox-iso
- arch: x86_64 - arch: amd64
provider: vmware-iso provider: vmware-iso
9: *supp 9: *supp
+4 -4
View File
@@ -1,9 +1,9 @@
7: 7:
- arch: x86_64 - arch: amd64
provider: qemu provider: qemu
- arch: x86_64 - arch: amd64
provider: virtualbox-iso provider: virtualbox-iso
- arch: x86_64 - arch: amd64
provider: vmware-iso provider: vmware-iso
- arch: x86_64 - arch: amd64
provider: hyperv-iso provider: hyperv-iso
@@ -1,8 +1,8 @@
distro = "debian" distro = "debian"
version = "11" version = "11"
iso = { iso = {
url = "https://cdimage.debian.org/cdimage/archive/11.7.0/amd64/iso-cd/debian-11.7.0-amd64-netinst.iso" url = "http://cdimage.debian.org/cdimage/archive/11.8.0/amd64/iso-cd/debian-11.8.0-amd64-netinst.iso"
checksum = "eb3f96fd607e4b67e80f4fc15670feb7d9db5be50f4ca8d0bf07008cb025766b" checksum = "d7a74813a734083df30c8d35784926deaa36bc41e5c0766388e9f591ab056b72"
} }
boot_command = [ boot_command = [
"<esc><wait>", "<esc><wait>",
@@ -1,8 +1,8 @@
distro = "debian" distro = "debian"
version = "12" version = "12"
iso = { iso = {
url = "https://cdimage.debian.org/cdimage/archive/12.0.0/amd64/iso-cd/debian-12.0.0-amd64-netinst.iso" url = "http://cdimage.debian.org/cdimage/release/12.2.0/amd64/iso-cd/debian-12.2.0-amd64-netinst.iso"
checksum = "3b0e9718e3653435f20d8c2124de6d363a51a1fd7f911b9ca0c6db6b3d30d53e" checksum = "23ab444503069d9ef681e3028016250289a33cc7bab079259b73100daee0af66"
} }
boot_command = [ boot_command = [
"<esc><wait>", "<esc><wait>",
+3 -3
View File
@@ -1,9 +1,9 @@
10: &supp 10: &supp
- arch: x86_64 - arch: amd64
provider: qemu provider: qemu
- arch: x86_64 - arch: amd64
provider: virtualbox-iso provider: virtualbox-iso
- arch: x86_64 - arch: amd64
provider: vmware-iso provider: vmware-iso
11: *supp 11: *supp
12: *supp 12: *supp
+16 -3
View File
@@ -34,11 +34,18 @@ url --mirrorlist=https://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$relea
reboot reboot
##### begin package list ############################################# ##### begin package list #############################################
%packages --inst-langs=en %packages --instLangs=en
# Include packages for the cloud-server-environment group # Include packages for the cloud-server-environment group
@^cloud-server-environment @^cloud-server-environment
# Install the tracer dnf plugin to enable automatic reboots
# IF the user requests package updates
# AND requests a reboot
# AND the packages updated require a reboot.
# https://fedoraproject.org/wiki/Changes/Automatic_Cloud_Reboot_On_Updates
python3-dnf-plugin-tracer
# Don't include the kernel toplevel package since it pulls in # Don't include the kernel toplevel package since it pulls in
# kernel-modules. We're happy for now with kernel-core. # kernel-modules. We're happy for now with kernel-core.
-kernel -kernel
@@ -136,6 +143,7 @@ btrfs filesystem sync /
# Let's clean it up. # Let's clean it up.
echo "Cleanup leftover networking configuration" echo "Cleanup leftover networking configuration"
rm -f /etc/NetworkManager/system-connections/*.nmconnection rm -f /etc/NetworkManager/system-connections/*.nmconnection
#*/
# Truncate the /etc/resolv.conf left over from NetworkManager during the # Truncate the /etc/resolv.conf left over from NetworkManager during the
# kickstart. This causes delays in boot with cloud-init because the # kickstart. This causes delays in boot with cloud-init because the
@@ -149,16 +157,21 @@ truncate -s 0 /etc/machine-id
sed -i 's,Defaults\\s*requiretty,Defaults !requiretty,' /etc/sudoers sed -i 's,Defaults\\s*requiretty,Defaults !requiretty,' /etc/sudoers
echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant-nopasswd echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant-nopasswd
sed -i 's/.*UseDNS.*/UseDNS no/' /etc/ssh/sshd_config sed -i 's/.*UseDNS.*/UseDNS no/' /etc/ssh/sshd_config
#'
cat > /etc/ssh/sshd_config.d/10-vagrant-insecure-rsa-key.conf <<EOF cat > /etc/ssh/sshd_config.d/10-vagrant-insecure-rsa-key.conf <<EOF
# For now the vagrant insecure key is an rsa key # For now the vagrant insecure key is an rsa key
# https://github.com/hashicorp/vagrant/issues/11783 # htfedoratps://github.com/hashicorp/vagrant/issues/11783
PubkeyAcceptedKeyTypes=+ssh-rsa PubkeyAcceptedKeyTypes=+ssh-rsa
EOF EOF
ssh-keygen -A ssh-keygen -A
mkdir -m 0700 -p /home/vagrant/.ssh/
curl -L -o /home/vagrant/.ssh/authorized_keys "https://raw.githubusercontent.com/hashicorp/vagrant/main/keys/vagrant.pub"
chown -R vagrant:vagrant /home/vagrant/.ssh
chmod 600 /home/vagrant/.ssh/authorized_keys
chcon -R unconfined_u:object_r:user_home_t:s0 /home/vagrant/.ssh
%end %end
##### end kickstart post ############################################ ##### end kickstart post ############################################
+26 -4
View File
@@ -75,6 +75,9 @@ qemu-guest-agent
# in /usr/share/GeoIP # in /usr/share/GeoIP
-geolite2-country -geolite2-country
-geolite2-city -geolite2-city
# Specific to vagrant
dnf-yum
rsync rsync
fuse-sshfs fuse-sshfs
%end %end
@@ -83,16 +86,26 @@ fuse-sshfs
##### begin kickstart post ########################################### ##### begin kickstart post ###########################################
%post --erroronfail %post --erroronfail
#!/bin/bash
set -x set -x
if [ -e /dev/vda ]; then
device="/dev/vda"
elif [ -e /dev/sda ]; then
device="/dev/sda"
else
echo "No device found"
exit 1
fi
if [ "$(arch)" = "x86_64" ]; then if [ "$(arch)" = "x86_64" ]; then
# Set up legacy BIOS boot if we booted from UEFI # Set up legacy BIOS boot if we booted from UEFI
grub2-install --target=i386-pc /dev/vda grub2-install --target=i386-pc "${device}"
fi fi
# Blivet sets pmbr_boot flag erroneously and we need to purge it # Blivet sets pmbr_boot flag erroneously and we need to purge it
# otherwise it'll fail to boot # otherwise it'll fail to boot
parted /dev/vda disk_set pmbr_boot off parted "${device}" disk_set pmbr_boot off
# linux-firmware is installed by default and is quite large. As of mid 2020: # linux-firmware is installed by default and is quite large. As of mid 2020:
# Total download size: 97 M # Total download size: 97 M
@@ -145,13 +158,22 @@ echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant-nopasswd
sed -i 's/.*UseDNS.*/UseDNS no/' /etc/ssh/sshd_config sed -i 's/.*UseDNS.*/UseDNS no/' /etc/ssh/sshd_config
cat > /etc/ssh/sshd_config.d/10-vagrant-insecure-rsa-key.conf <<EOF cat > /etc/ssh/sshd_config.d/10-vagrant-insecure-rsa-key.conf <<EOF
# For now the vagrant insecure key is an rsa key # Starting in Vagrant 2.3.8 there is support for an EDDSA25519 key,
# https://github.com/hashicorp/vagrant/issues/11783 # but prior to that, only the insecure RSA is available. When the time
# comes, we can remove this bit, but we keep it for a long time
# for backwards compatibility
PubkeyAcceptedKeyTypes=+ssh-rsa PubkeyAcceptedKeyTypes=+ssh-rsa
EOF EOF
ssh-keygen -A ssh-keygen -A
mkdir -m 0700 -p /home/vagrant/.ssh/
curl -L -o /home/vagrant/.ssh/authorized_keys "https://raw.githubusercontent.com/hashicorp/vagrant/main/keys/vagrant.pub"
chown -R vagrant:vagrant /home/vagrant/.ssh
chmod 600 /home/vagrant/.ssh/authorized_keys
chcon -R unconfined_u:object_r:user_home_t:s0 /home/vagrant/.ssh
%end %end
##### end kickstart post ############################################ ##### end kickstart post ############################################
-13
View File
@@ -1,13 +0,0 @@
distro = "fedora"
version = "rawhide"
iso = {
url = "https://download.fedoraproject.org/pub/fedora/linux/development/rawhide/Server/x86_64/iso/Fedora-Server-dvd-x86_64-Rawhide-20231126.n.0.iso"
checksum = "5613927b713cac9503a6475de95c518c9615a0aeb784b6444764a1ee0b1b69af"
}
boot_command = [
"<up>e<down><down><end><bs><bs><bs><bs><bs>",
"net.ifnames=0 biosdevnames=0 inst.ks=cdrom:/x86_64.ks console=tty0 console=ttyS0<f10>"
]
cd_files = [
"distros/fedora/rawhide/*.ks"
]
+4 -4
View File
@@ -1,12 +1,12 @@
37: &supp 37: &supp
- arch: x86_64 - arch: amd64
provider: qemu provider: qemu
- arch: x86_64 - arch: amd64
provider: virtualbox-iso provider: virtualbox-iso
- arch: x86_64 - arch: amd64
provider: vmware-iso provider: vmware-iso
38: *supp 38: *supp
39: *supp 39: *supp
rawhide: rawhide:
- arch: x86_64 - arch: amd64
provider: qemu provider: qemu
+3 -3
View File
@@ -1,7 +1,7 @@
23.05: 23.05:
- arch: x86_64 - arch: amd64
provider: qemu provider: qemu
- arch: x86_64 - arch: amd64
provider: virtualbox-iso provider: virtualbox-iso
- arch: x86_64 - arch: amd64
provider: vmware-iso provider: vmware-iso
+3 -3
View File
@@ -1,9 +1,9 @@
20.04: &supp 20.04: &supp
- arch: x86_64 - arch: amd64
provider: qemu provider: qemu
- arch: x86_64 - arch: amd64
provider: virtualbox-iso provider: virtualbox-iso
- arch: x86_64 - arch: amd64
provider: vmware-iso provider: vmware-iso
22.04: *supp 22.04: *supp
"23.10": *supp "23.10": *supp
+10 -8
View File
@@ -10,7 +10,7 @@ packer {
} }
vagrant = { vagrant = {
source = "github.com/hashicorp/vagrant" source = "github.com/hashicorp/vagrant"
version = "~> 1" version = "1.1.1"
} }
vmware = { vmware = {
version = ">= 1.0" version = ">= 1.0"
@@ -25,26 +25,26 @@ packer {
build { build {
sources = [ sources = [
"source.qemu.x86_64", "source.qemu.amd64",
"source.virtualbox-iso.x86_64", "source.virtualbox-iso.amd64",
"source.vmware-iso.x86_64", "source.vmware-iso.amd64",
"source.hyperv-iso.x86_64" "source.hyperv-iso.amd64"
] ]
# If anything needs specific support for one of the distros # If anything needs specific support for one of the distros
provisioner "shell" { provisioner "shell" {
execute_command = "sudo -S sh -c '{{ .Vars }} {{ .Path }}'" execute_command = "sudo -S sh -c '{{ .Vars }} {{ .Path }}'"
only = ["qemu.x86_64"] only = ["qemu.amd64"]
script = "distros/${var.distro}/${var.version}/qemu.sh" script = "distros/${var.distro}/${var.version}/qemu.sh"
} }
provisioner "shell" { provisioner "shell" {
execute_command = "sudo -S sh -c '{{ .Vars }} {{ .Path }}'" execute_command = "sudo -S sh -c '{{ .Vars }} {{ .Path }}'"
only = ["virtualbox-iso.x86_64"] only = ["virtualbox-iso.amd64"]
script = "distros/${var.distro}/${var.version}/virtualbox.sh" script = "distros/${var.distro}/${var.version}/virtualbox.sh"
} }
provisioner "shell" { provisioner "shell" {
execute_command = "sudo -S sh -c '{{ .Vars }} {{ .Path }}'" execute_command = "sudo -S sh -c '{{ .Vars }} {{ .Path }}'"
only = ["vmware-iso.x86_64"] only = ["vmware-iso.amd64"]
script = "distros/${var.distro}/${var.version}/vmware.sh" script = "distros/${var.distro}/${var.version}/vmware.sh"
} }
@@ -69,7 +69,9 @@ build {
post-processor "vagrant-cloud" { post-processor "vagrant-cloud" {
name = "upload" name = "upload"
access_token = var.vagrant_cloud_token access_token = var.vagrant_cloud_token
architecture = var.architecture
box_tag = "boxen/${local.name}" box_tag = "boxen/${local.name}"
default_architecture = "amd64"
version = var.build version = var.build
version_description = local.description version_description = local.description
} }
+1 -1
View File
@@ -1,4 +1,4 @@
source "hyperv-iso" "x86_64" { source "hyperv-iso" "amd64" {
iso_url = var.iso.url iso_url = var.iso.url
iso_checksum = var.iso.checksum iso_checksum = var.iso.checksum
output_directory = "output/hyperv/${local.name}" output_directory = "output/hyperv/${local.name}"
+1 -1
View File
@@ -10,7 +10,7 @@ variable "distro" {
variable "arch" { variable "arch" {
type = string type = string
default = "x86_64" default = "amd64"
} }
variable "version" { variable "version" {
+1 -1
View File
@@ -3,7 +3,7 @@ variable "qemu_accelerator" {
default = "kvm" default = "kvm"
} }
source "qemu" "x86_64" { source "qemu" "amd64" {
iso_url = var.iso.url iso_url = var.iso.url
iso_checksum = var.iso.checksum iso_checksum = var.iso.checksum
output_directory = "output/libvirt/${local.name}" output_directory = "output/libvirt/${local.name}"
+1 -1
View File
@@ -1,4 +1,4 @@
source "virtualbox-iso" "x86_64" { source "virtualbox-iso" "amd64" {
iso_url = var.iso.url iso_url = var.iso.url
iso_checksum = var.iso.checksum iso_checksum = var.iso.checksum
output_directory = "output/virtualbox/${local.name}" output_directory = "output/virtualbox/${local.name}"
+1 -1
View File
@@ -1,4 +1,4 @@
source "vmware-iso" "x86_64" { source "vmware-iso" "amd64" {
iso_url = var.iso.url iso_url = var.iso.url
iso_checksum = var.iso.checksum iso_checksum = var.iso.checksum
output_directory = "output/vmware/${local.name}" output_directory = "output/vmware/${local.name}"
+3 -3
View File
@@ -24,9 +24,9 @@ def get_vagrant_provider(provider):
def get_providers(): def get_providers():
"List of providers as defined in sources/" "List of providers as defined in sources/"
providers: set[str] = { providers: set[str] = {
"qemu.x86_64" "qemu.amd64"
"virtualbox-iso.x86_64", "virtualbox-iso.amd64",
"vmware-iso.x86_64" "vmware-iso.amd64"
} }
return providers return providers