diff --git a/build_library/vm_image_util.sh b/build_library/vm_image_util.sh index ecaa792d5a5..38033ef998b 100644 --- a/build_library/vm_image_util.sh +++ b/build_library/vm_image_util.sh @@ -25,6 +25,7 @@ VALID_IMG_TYPES=( openstack_mini packet parallels + proxmoxve pxe qemu_uefi rackspace @@ -57,6 +58,7 @@ VALID_OEM_PACKAGES=( kubevirt openstack packet + proxmoxve qemu rackspace rackspace-onmetal @@ -332,6 +334,13 @@ IMG_akamai_OEM_PACKAGE=common-oem-files IMG_akamai_OEM_USE=akamai IMG_akamai_OEM_SYSEXT=oem-akamai +# proxmoxve +IMG_proxmoxve_DISK_FORMAT=qcow2 +IMG_proxmoxve_DISK_LAYOUT=vm +IMG_proxmoxve_OEM_PACKAGE=common-oem-files +IMG_proxmoxve_OEM_USE=proxmoxve +IMG_proxmoxve_OEM_SYSEXT=oem-proxmoxve + ########################################################### # Print the default vm type for the specified board diff --git a/changelog/changes/2024-10-24-proxmoxve.md b/changelog/changes/2024-10-24-proxmoxve.md new file mode 100644 index 00000000000..2470ec3616a --- /dev/null +++ b/changelog/changes/2024-10-24-proxmoxve.md @@ -0,0 +1 @@ +- Added Proxmox Virtual Environment images ([scripts#1783](https://github.com/flatcar/scripts/pull/1783)) diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/afterburn/files/coreos-metadata.service b/sdk_container/src/third_party/coreos-overlay/coreos-base/afterburn/files/coreos-metadata.service index facc01224db..ad64b983b47 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/afterburn/files/coreos-metadata.service +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/afterburn/files/coreos-metadata.service @@ -25,6 +25,8 @@ ConditionKernelCommandLine=|flatcar.oem.id=kubevirt ConditionKernelCommandLine=|flatcar.oem.id=akamai +ConditionKernelCommandLine=|flatcar.oem.id=proxmoxve + Description=Flatcar Metadata Agent [Service] diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/common-oem-files/common-oem-files-0-r8.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/common-oem-files/common-oem-files-0-r8.ebuild index 9c69deac343..53f2a48e2f6 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/common-oem-files/common-oem-files-0-r8.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/common-oem-files/common-oem-files-0-r8.ebuild @@ -35,6 +35,7 @@ COMMON_OEMIDS=( hetzner openstack packet + proxmoxve qemu scaleway kubevirt diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/common-oem-files/files/proxmoxve/grub.cfg.frag b/sdk_container/src/third_party/coreos-overlay/coreos-base/common-oem-files/files/proxmoxve/grub.cfg.frag new file mode 100644 index 00000000000..4f9e06c2c8c --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/common-oem-files/files/proxmoxve/grub.cfg.frag @@ -0,0 +1 @@ +set linux_append="flatcar.autologin" diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-proxmoxve/metadata.xml b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-proxmoxve/metadata.xml new file mode 100644 index 00000000000..097975e3adc --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-proxmoxve/metadata.xml @@ -0,0 +1,4 @@ + + + + diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-proxmoxve/oem-proxmoxve-0.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-proxmoxve/oem-proxmoxve-0.ebuild new file mode 100644 index 00000000000..bb7fa6e0629 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-proxmoxve/oem-proxmoxve-0.ebuild @@ -0,0 +1,15 @@ +# Copyright (c) 2013 CoreOS, Inc.. All rights reserved. +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="OEM suite for Proxmox VE" +HOMEPAGE="https://www.proxmox.com/en/proxmox-virtual-environment/" +SRC_URI="" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 arm64" +IUSE="" + +OEM_NAME="Proxmox VE" diff --git a/sdk_container/src/third_party/coreos-overlay/coreos/user-patches/coreos-base/coreos-init/115.patch b/sdk_container/src/third_party/coreos-overlay/coreos/user-patches/coreos-base/coreos-init/115.patch new file mode 100644 index 00000000000..9a2c8ebdb21 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/coreos/user-patches/coreos-base/coreos-init/115.patch @@ -0,0 +1,27 @@ +From 67ac31d0fc9ed22d83f2fc5a6449c6e35a83a1df Mon Sep 17 00:00:00 2001 +From: Kai Lueke +Date: Fri, 22 Mar 2024 20:58:23 +0900 +Subject: [PATCH] Draft for Proxmox support + +This makes use of https://github.com/coreos/afterburn/pull/1023 +to set up the ssh keys from the metadata. + +Signed-off-by: Mathieu Tortuyaux +--- + systemd/system/sshkeys.service | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/systemd/system/sshkeys.service b/systemd/system/sshkeys.service +index 7727185..9edf5cc 100644 +--- a/systemd/system/sshkeys.service ++++ b/systemd/system/sshkeys.service +@@ -30,6 +30,9 @@ ConditionKernelCommandLine=|flatcar.oem.id=hetzner + ConditionKernelCommandLine=|ignition.platform.id=akamai + ConditionKernelCommandLine=|flatcar.oem.id=akamai + ++ConditionKernelCommandLine=|ignition.platform.id=proxmoxve ++ConditionKernelCommandLine=|flatcar.oem.id=proxmoxve ++ + [Service] + Type=oneshot + RemainAfterExit=yes diff --git a/sdk_container/src/third_party/coreos-overlay/coreos/user-patches/sys-kernel/bootengine/91.patch b/sdk_container/src/third_party/coreos-overlay/coreos/user-patches/sys-kernel/bootengine/91.patch new file mode 100644 index 00000000000..7f1a8154aa4 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/coreos/user-patches/sys-kernel/bootengine/91.patch @@ -0,0 +1,40 @@ +From 10357a387459fc16a381f70601c44313668076ed Mon Sep 17 00:00:00 2001 +From: Kai Lueke +Date: Fri, 22 Mar 2024 20:23:49 +0900 +Subject: [PATCH] Draft for Proxmox support + +This makes use of https://github.com/coreos/afterburn/pull/1023 +to set up any static networking from the initrd (for Ignition) and the +hostname (early enough so that Ignition could overwrite it). +--- + dracut/30ignition/flatcar-metadata-hostname.service | 2 ++ + dracut/30ignition/ignition-generator | 2 +- + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/dracut/30ignition/flatcar-metadata-hostname.service b/dracut/30ignition/flatcar-metadata-hostname.service +index fc75732..323c62e 100644 +--- a/dracut/30ignition/flatcar-metadata-hostname.service ++++ b/dracut/30ignition/flatcar-metadata-hostname.service +@@ -33,8 +33,10 @@ ConditionKernelCommandLine=|flatcar.oem.id=vultr + # Addition: + ConditionKernelCommandLine=|coreos.oem.id=packet + ConditionKernelCommandLine=|flatcar.oem.id=packet ++ + ConditionKernelCommandLine=|flatcar.oem.id=hetzner + ConditionKernelCommandLine=|flatcar.oem.id=kubevirt ++ConditionKernelCommandLine=|flatcar.oem.id=proxmoxve + + OnFailure=emergency.target + OnFailureJobMode=isolate +diff --git a/dracut/30ignition/ignition-generator b/dracut/30ignition/ignition-generator +index 59bdf80..c015ff5 100755 +--- a/dracut/30ignition/ignition-generator ++++ b/dracut/30ignition/ignition-generator +@@ -146,6 +146,6 @@ if [ "${nopxe}" = 1 ]; then + add_requires "disk-uuid.service" initrd.target + fi + +-if [[ $(cmdline_arg flatcar.oem.id) == "digitalocean" ]] || [[ $(cmdline_arg coreos.oem.id) == "digitalocean" ]]; then ++if [[ $(cmdline_arg flatcar.oem.id) == "digitalocean" ]] || [[ $(cmdline_arg coreos.oem.id) == "digitalocean" ]] || [[ $(cmdline_arg flatcar.oem.id) == "proxmoxve" ]]; then + add_requires flatcar-digitalocean-network.service initrd.target + fi