Skip to content

Commit

Permalink
oem: provide proxmox images
Browse files Browse the repository at this point in the history
Co-authored-by: Kai Lüke <pothos@users.noreply.github.com>
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
  • Loading branch information
tormath1 and pothos committed Oct 24, 2024
1 parent a37c9ed commit 2bdf792
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 0 deletions.
9 changes: 9 additions & 0 deletions build_library/vm_image_util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ VALID_IMG_TYPES=(
openstack_mini
packet
parallels
proxmoxve
pxe
qemu_uefi
rackspace
Expand Down Expand Up @@ -57,6 +58,7 @@ VALID_OEM_PACKAGES=(
kubevirt
openstack
packet
proxmoxve
qemu
rackspace
rackspace-onmetal
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions changelog/changes/2024-10-24-proxmoxve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Added Proxmox Virtual Environment images ([scripts#1783](https://github.com/flatcar/scripts/pull/1783))
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ COMMON_OEMIDS=(
hetzner
openstack
packet
proxmoxve
qemu
scaleway
kubevirt
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
</pkgmetadata>
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From 67ac31d0fc9ed22d83f2fc5a6449c6e35a83a1df Mon Sep 17 00:00:00 2001
From: Kai Lueke <kailuke@microsoft.com>
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 <mtortuyaux@microsoft.com>
---
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
From 10357a387459fc16a381f70601c44313668076ed Mon Sep 17 00:00:00 2001
From: Kai Lueke <kailuke@microsoft.com>
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

0 comments on commit 2bdf792

Please sign in to comment.