x86_64 to amd64 to match Vagrant arch names
This commit is contained in:
@@ -31,15 +31,15 @@ jobs:
|
||||
|
||||
build:
|
||||
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:
|
||||
- collect
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
builder:
|
||||
- virtualbox-iso.x86_64
|
||||
- qemu.x86_64
|
||||
- virtualbox-iso.amd64
|
||||
- qemu.amd64
|
||||
distro: ${{ fromJson( needs.collect.outputs.distros ) }}
|
||||
needs_timeout:
|
||||
- distros/ubuntu-20.04-x86_64.pkrvars.hcl
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
1. Try a build
|
||||
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. `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
|
||||
|
||||
### Troubleshooting
|
||||
@@ -44,4 +44,4 @@ to reach it.
|
||||
1. Set connection type to 'External'
|
||||
1. In your DHCP server, assign a static IP address to MAC address "00:00:de:ad:be:ef"
|
||||
1. Personally, I use dnsmasq and my subnet is 10.42.2.1/16 for DHCP, so the appropriate config line is `dhcp-host=00:00:de:ad:be:ef,10.42.2.254`
|
||||
1. The actual IP address you assign is unimportant, and if you need to spoof a different Mac address, edit the file `sources/hyperv-iso.pkr.hcl`
|
||||
1. The actual IP address you assign is unimportant, and if you need to spoof a different Mac address, edit the file `sources/hyperv-iso.pkr.hcl`
|
||||
|
||||
@@ -16,7 +16,7 @@ support = Support()
|
||||
parser = ArgumentParser("Build a box")
|
||||
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("--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("--all", "-a", help="Build all applicable targets", action="store_true")
|
||||
parser.add_argument("--upload", "-u", help="Force doing uploads", action="store_true")
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ source ./test.xsh
|
||||
|
||||
|
||||
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()
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
distro = "archlinux"
|
||||
version = "rolling"
|
||||
iso = {
|
||||
url = "http://dfw.mirror.rackspace.com/archlinux/iso/2023.08.01/archlinux-x86_64.iso"
|
||||
checksum = "3bf1287333de5c26663b70a17ce7573f15dc60780b140cbbd1c720338c0abac5"
|
||||
url = "http://dfw.mirror.rackspace.com/archlinux/iso/2023.11.01/archlinux-2023.11.01-x86_64.iso"
|
||||
checksum = "477f50617d648e46d6e326549aa56ab92115a29a97f2ca364e944cea06970608"
|
||||
}
|
||||
boot_command = [
|
||||
"<tab><wait> net.ifnames=0<wait> <wait>bi<wait>osdevnames=0<enter>",
|
||||
@@ -1,9 +1,9 @@
|
||||
rolling:
|
||||
- arch: x86_64
|
||||
- arch: amd64
|
||||
provider: qemu
|
||||
- arch: x86_64
|
||||
- arch: amd64
|
||||
provider: virtualbox-iso
|
||||
- arch: x86_64
|
||||
- arch: amd64
|
||||
provider: vmware-iso
|
||||
- arch: x86_64
|
||||
provider: hyperv-iso
|
||||
- arch: amd64
|
||||
provider: hyperv-iso
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
8: &supp
|
||||
- arch: x86_64
|
||||
- arch: amd64
|
||||
provider: qemu
|
||||
- arch: x86_64
|
||||
- arch: amd64
|
||||
provider: virtualbox-iso
|
||||
- arch: x86_64
|
||||
- arch: amd64
|
||||
provider: vmware-iso
|
||||
9: *supp
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
7:
|
||||
- arch: x86_64
|
||||
- arch: amd64
|
||||
provider: qemu
|
||||
- arch: x86_64
|
||||
- arch: amd64
|
||||
provider: virtualbox-iso
|
||||
- arch: x86_64
|
||||
- arch: amd64
|
||||
provider: vmware-iso
|
||||
- arch: x86_64
|
||||
provider: hyperv-iso
|
||||
- arch: amd64
|
||||
provider: hyperv-iso
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
distro = "debian"
|
||||
version = "11"
|
||||
iso = {
|
||||
url = "https://cdimage.debian.org/cdimage/archive/11.7.0/amd64/iso-cd/debian-11.7.0-amd64-netinst.iso"
|
||||
checksum = "eb3f96fd607e4b67e80f4fc15670feb7d9db5be50f4ca8d0bf07008cb025766b"
|
||||
url = "http://cdimage.debian.org/cdimage/archive/11.8.0/amd64/iso-cd/debian-11.8.0-amd64-netinst.iso"
|
||||
checksum = "d7a74813a734083df30c8d35784926deaa36bc41e5c0766388e9f591ab056b72"
|
||||
}
|
||||
boot_command = [
|
||||
"<esc><wait>",
|
||||
@@ -1,8 +1,8 @@
|
||||
distro = "debian"
|
||||
version = "12"
|
||||
iso = {
|
||||
url = "https://cdimage.debian.org/cdimage/archive/12.0.0/amd64/iso-cd/debian-12.0.0-amd64-netinst.iso"
|
||||
checksum = "3b0e9718e3653435f20d8c2124de6d363a51a1fd7f911b9ca0c6db6b3d30d53e"
|
||||
url = "http://cdimage.debian.org/cdimage/release/12.2.0/amd64/iso-cd/debian-12.2.0-amd64-netinst.iso"
|
||||
checksum = "23ab444503069d9ef681e3028016250289a33cc7bab079259b73100daee0af66"
|
||||
}
|
||||
boot_command = [
|
||||
"<esc><wait>",
|
||||
@@ -1,9 +1,9 @@
|
||||
10: &supp
|
||||
- arch: x86_64
|
||||
- arch: amd64
|
||||
provider: qemu
|
||||
- arch: x86_64
|
||||
- arch: amd64
|
||||
provider: virtualbox-iso
|
||||
- arch: x86_64
|
||||
- arch: amd64
|
||||
provider: vmware-iso
|
||||
11: *supp
|
||||
12: *supp
|
||||
|
||||
@@ -34,11 +34,18 @@ url --mirrorlist=https://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$relea
|
||||
reboot
|
||||
|
||||
##### begin package list #############################################
|
||||
%packages --inst-langs=en
|
||||
%packages --instLangs=en
|
||||
|
||||
# Include packages for the cloud-server-environment group
|
||||
@^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
|
||||
# kernel-modules. We're happy for now with kernel-core.
|
||||
-kernel
|
||||
@@ -136,6 +143,7 @@ btrfs filesystem sync /
|
||||
# Let's clean it up.
|
||||
echo "Cleanup leftover networking configuration"
|
||||
rm -f /etc/NetworkManager/system-connections/*.nmconnection
|
||||
#*/
|
||||
|
||||
# Truncate the /etc/resolv.conf left over from NetworkManager during 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
|
||||
echo 'vagrant ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/vagrant-nopasswd
|
||||
sed -i 's/.*UseDNS.*/UseDNS no/' /etc/ssh/sshd_config
|
||||
#'
|
||||
|
||||
cat > /etc/ssh/sshd_config.d/10-vagrant-insecure-rsa-key.conf <<EOF
|
||||
# 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
|
||||
EOF
|
||||
|
||||
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 kickstart post ############################################
|
||||
|
||||
|
||||
@@ -75,6 +75,9 @@ qemu-guest-agent
|
||||
# in /usr/share/GeoIP
|
||||
-geolite2-country
|
||||
-geolite2-city
|
||||
|
||||
# Specific to vagrant
|
||||
dnf-yum
|
||||
rsync
|
||||
fuse-sshfs
|
||||
%end
|
||||
@@ -83,16 +86,26 @@ fuse-sshfs
|
||||
|
||||
##### begin kickstart post ###########################################
|
||||
%post --erroronfail
|
||||
#!/bin/bash
|
||||
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
|
||||
# Set up legacy BIOS boot if we booted from UEFI
|
||||
grub2-install --target=i386-pc /dev/vda
|
||||
grub2-install --target=i386-pc "${device}"
|
||||
fi
|
||||
|
||||
# Blivet sets pmbr_boot flag erroneously and we need to purge it
|
||||
# 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:
|
||||
# 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
|
||||
|
||||
cat > /etc/ssh/sshd_config.d/10-vagrant-insecure-rsa-key.conf <<EOF
|
||||
# For now the vagrant insecure key is an rsa key
|
||||
# https://github.com/hashicorp/vagrant/issues/11783
|
||||
# Starting in Vagrant 2.3.8 there is support for an EDDSA25519 key,
|
||||
# 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
|
||||
EOF
|
||||
|
||||
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 kickstart post ############################################
|
||||
|
||||
|
||||
@@ -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"
|
||||
]
|
||||
@@ -1,12 +1,12 @@
|
||||
37: &supp
|
||||
- arch: x86_64
|
||||
- arch: amd64
|
||||
provider: qemu
|
||||
- arch: x86_64
|
||||
- arch: amd64
|
||||
provider: virtualbox-iso
|
||||
- arch: x86_64
|
||||
- arch: amd64
|
||||
provider: vmware-iso
|
||||
38: *supp
|
||||
39: *supp
|
||||
rawhide:
|
||||
- arch: x86_64
|
||||
- arch: amd64
|
||||
provider: qemu
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
23.05:
|
||||
- arch: x86_64
|
||||
- arch: amd64
|
||||
provider: qemu
|
||||
- arch: x86_64
|
||||
- arch: amd64
|
||||
provider: virtualbox-iso
|
||||
- arch: x86_64
|
||||
- arch: amd64
|
||||
provider: vmware-iso
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
20.04: &supp
|
||||
- arch: x86_64
|
||||
- arch: amd64
|
||||
provider: qemu
|
||||
- arch: x86_64
|
||||
- arch: amd64
|
||||
provider: virtualbox-iso
|
||||
- arch: x86_64
|
||||
- arch: amd64
|
||||
provider: vmware-iso
|
||||
22.04: *supp
|
||||
"23.10": *supp
|
||||
|
||||
+10
-8
@@ -10,7 +10,7 @@ packer {
|
||||
}
|
||||
vagrant = {
|
||||
source = "github.com/hashicorp/vagrant"
|
||||
version = "~> 1"
|
||||
version = "1.1.1"
|
||||
}
|
||||
vmware = {
|
||||
version = ">= 1.0"
|
||||
@@ -25,26 +25,26 @@ packer {
|
||||
|
||||
build {
|
||||
sources = [
|
||||
"source.qemu.x86_64",
|
||||
"source.virtualbox-iso.x86_64",
|
||||
"source.vmware-iso.x86_64",
|
||||
"source.hyperv-iso.x86_64"
|
||||
"source.qemu.amd64",
|
||||
"source.virtualbox-iso.amd64",
|
||||
"source.vmware-iso.amd64",
|
||||
"source.hyperv-iso.amd64"
|
||||
]
|
||||
|
||||
# If anything needs specific support for one of the distros
|
||||
provisioner "shell" {
|
||||
execute_command = "sudo -S sh -c '{{ .Vars }} {{ .Path }}'"
|
||||
only = ["qemu.x86_64"]
|
||||
only = ["qemu.amd64"]
|
||||
script = "distros/${var.distro}/${var.version}/qemu.sh"
|
||||
}
|
||||
provisioner "shell" {
|
||||
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"
|
||||
}
|
||||
provisioner "shell" {
|
||||
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"
|
||||
}
|
||||
|
||||
@@ -69,7 +69,9 @@ build {
|
||||
post-processor "vagrant-cloud" {
|
||||
name = "upload"
|
||||
access_token = var.vagrant_cloud_token
|
||||
architecture = var.architecture
|
||||
box_tag = "boxen/${local.name}"
|
||||
default_architecture = "amd64"
|
||||
version = var.build
|
||||
version_description = local.description
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
source "hyperv-iso" "x86_64" {
|
||||
source "hyperv-iso" "amd64" {
|
||||
iso_url = var.iso.url
|
||||
iso_checksum = var.iso.checksum
|
||||
output_directory = "output/hyperv/${local.name}"
|
||||
|
||||
@@ -10,7 +10,7 @@ variable "distro" {
|
||||
|
||||
variable "arch" {
|
||||
type = string
|
||||
default = "x86_64"
|
||||
default = "amd64"
|
||||
}
|
||||
|
||||
variable "version" {
|
||||
|
||||
@@ -3,7 +3,7 @@ variable "qemu_accelerator" {
|
||||
default = "kvm"
|
||||
}
|
||||
|
||||
source "qemu" "x86_64" {
|
||||
source "qemu" "amd64" {
|
||||
iso_url = var.iso.url
|
||||
iso_checksum = var.iso.checksum
|
||||
output_directory = "output/libvirt/${local.name}"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
source "virtualbox-iso" "x86_64" {
|
||||
source "virtualbox-iso" "amd64" {
|
||||
iso_url = var.iso.url
|
||||
iso_checksum = var.iso.checksum
|
||||
output_directory = "output/virtualbox/${local.name}"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
source "vmware-iso" "x86_64" {
|
||||
source "vmware-iso" "amd64" {
|
||||
iso_url = var.iso.url
|
||||
iso_checksum = var.iso.checksum
|
||||
output_directory = "output/vmware/${local.name}"
|
||||
|
||||
@@ -24,9 +24,9 @@ def get_vagrant_provider(provider):
|
||||
def get_providers():
|
||||
"List of providers as defined in sources/"
|
||||
providers: set[str] = {
|
||||
"qemu.x86_64"
|
||||
"virtualbox-iso.x86_64",
|
||||
"vmware-iso.x86_64"
|
||||
"qemu.amd64"
|
||||
"virtualbox-iso.amd64",
|
||||
"vmware-iso.amd64"
|
||||
}
|
||||
return providers
|
||||
|
||||
|
||||
Reference in New Issue
Block a user