|
| 1 | +From 202d7e30789bb909ecb0ee088320831360a8ce19 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Jan Larwig < [email protected]> |
| 3 | +Date: Mon, 21 Oct 2024 10:58:14 +0200 |
| 4 | +Subject: [PATCH 1/2] add ionoscloud support |
| 5 | + |
| 6 | +--- |
| 7 | + build_library/vm_image_util.sh | 21 +++++++++++++++++++ |
| 8 | + .../afterburn/files/coreos-metadata.service | 2 ++ |
| 9 | + .../common-oem-files-0-r8.ebuild | 1 + |
| 10 | + .../files/ionoscloud/grub.cfg.frag | 1 + |
| 11 | + .../coreos-cloudinit-9999.ebuild | 4 ++-- |
| 12 | + .../coreos-init/coreos-init-9999.ebuild | 4 ++-- |
| 13 | + .../coreos-base/oem-ionoscloud/metadata.xml | 4 ++++ |
| 14 | + .../oem-ionoscloud/oem-ionoscloud-0.ebuild | 15 +++++++++++++ |
| 15 | + .../sys-apps/ignition/ignition-9999.ebuild | 2 +- |
| 16 | + 9 files changed, 49 insertions(+), 5 deletions(-) |
| 17 | + create mode 100644 sdk_container/src/third_party/coreos-overlay/coreos-base/common-oem-files/files/ionoscloud/grub.cfg.frag |
| 18 | + create mode 100644 sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ionoscloud/metadata.xml |
| 19 | + create mode 100644 sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ionoscloud/oem-ionoscloud-0.ebuild |
| 20 | + |
| 21 | +diff --git a/build_library/vm_image_util.sh b/build_library/vm_image_util.sh |
| 22 | +index ecaa792d5a..4d7fa6e8df 100644 |
| 23 | +--- a/build_library/vm_image_util.sh |
| 24 | ++++ b/build_library/vm_image_util.sh |
| 25 | +@@ -41,6 +41,7 @@ VALID_IMG_TYPES=( |
| 26 | + vmware_ova |
| 27 | + vmware_raw |
| 28 | + xen |
| 29 | ++ ionoscloud |
| 30 | + ) |
| 31 | + |
| 32 | + #list of oem package names, minus the oem- prefix |
| 33 | +@@ -66,6 +67,7 @@ VALID_OEM_PACKAGES=( |
| 34 | + vagrant-virtualbox |
| 35 | + virtualbox |
| 36 | + vmware |
| 37 | ++ ionoscloud |
| 38 | + ) |
| 39 | + |
| 40 | + # Set at runtime to one of the above types |
| 41 | +@@ -332,6 +334,15 @@ IMG_akamai_OEM_PACKAGE=common-oem-files |
| 42 | + IMG_akamai_OEM_USE=akamai |
| 43 | + IMG_akamai_OEM_SYSEXT=oem-akamai |
| 44 | + |
| 45 | ++## ionoscloud |
| 46 | ++IMG_ionoscloud_OEM_USE=ionoscloud |
| 47 | ++IMG_ionoscloud_OEM_SYSEXT=oem-ionoscloud |
| 48 | ++IMG_ionoscloud_OEM_PACKAGE=common-oem-files |
| 49 | ++IMG_ionoscloud_DISK_LAYOUT=vm |
| 50 | ++IMG_ionoscloud_DISK_FORMAT=qcow2 |
| 51 | ++IMG_ionoscloud_DISK_EXTENSION=qcow2 |
| 52 | ++IMG_ionoscloud_FS_HOOK=ionoscloud |
| 53 | ++ |
| 54 | + ########################################################### |
| 55 | + |
| 56 | + # Print the default vm type for the specified board |
| 57 | +@@ -610,6 +621,16 @@ _run_box_fs_hook() { |
| 58 | + sudo rm -fr "${VM_TMP_ROOT}/oem/box" |
| 59 | + } |
| 60 | + |
| 61 | ++_run_ionoscloud_fs_hook() { |
| 62 | ++ # Prep root parition for IONOS Cloud legacy injection |
| 63 | ++ # This is a workaround until the IONOS Cloud introduces a metadata server |
| 64 | ++ sudo mount -o remount,rw "${VM_TMP_ROOT}" |
| 65 | ++ sudo mkdir -p "${VM_TMP_ROOT}/var/lib/cloud/seed/nocloud" |
| 66 | ++ sudo mkdir -p "${VM_TMP_ROOT}/etc/cloud" |
| 67 | ++ sudo touch "${VM_TMP_ROOT}/etc/cloud/cloud.cfg" |
| 68 | ++ sudo mount -o remount,ro "${VM_TMP_ROOT}" |
| 69 | ++} |
| 70 | ++ |
| 71 | + # Write the vm disk image to the target directory in the proper format |
| 72 | + write_vm_disk() { |
| 73 | + if [[ $(_get_vm_opt PARTITIONED_IMG) -eq 1 ]]; then |
| 74 | +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 |
| 75 | +index facc01224d..c96e509c30 100644 |
| 76 | +--- a/sdk_container/src/third_party/coreos-overlay/coreos-base/afterburn/files/coreos-metadata.service |
| 77 | ++++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/afterburn/files/coreos-metadata.service |
| 78 | +@@ -25,6 +25,8 @@ ConditionKernelCommandLine=|flatcar.oem.id=kubevirt |
| 79 | + |
| 80 | + ConditionKernelCommandLine=|flatcar.oem.id=akamai |
| 81 | + |
| 82 | ++ConditionKernelCommandLine=|flatcar.oem.id=ionoscloud |
| 83 | ++ |
| 84 | + Description=Flatcar Metadata Agent |
| 85 | + |
| 86 | + [Service] |
| 87 | +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 |
| 88 | +index 9c69deac34..a8e0b1736e 100644 |
| 89 | +--- a/sdk_container/src/third_party/coreos-overlay/coreos-base/common-oem-files/common-oem-files-0-r8.ebuild |
| 90 | ++++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/common-oem-files/common-oem-files-0-r8.ebuild |
| 91 | +@@ -38,6 +38,7 @@ COMMON_OEMIDS=( |
| 92 | + qemu |
| 93 | + scaleway |
| 94 | + kubevirt |
| 95 | ++ ionoscloud |
| 96 | + ) |
| 97 | + |
| 98 | + ARM64_ONLY_OEMIDS=( |
| 99 | +diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/common-oem-files/files/ionoscloud/grub.cfg.frag b/sdk_container/src/third_party/coreos-overlay/coreos-base/common-oem-files/files/ionoscloud/grub.cfg.frag |
| 100 | +new file mode 100644 |
| 101 | +index 0000000000..4f9e06c2c8 |
| 102 | +--- /dev/null |
| 103 | ++++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/common-oem-files/files/ionoscloud/grub.cfg.frag |
| 104 | +@@ -0,0 +1 @@ |
| 105 | ++set linux_append="flatcar.autologin" |
| 106 | +diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-cloudinit/coreos-cloudinit-9999.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-cloudinit/coreos-cloudinit-9999.ebuild |
| 107 | +index 834af69793..3499aea430 100644 |
| 108 | +--- a/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-cloudinit/coreos-cloudinit-9999.ebuild |
| 109 | ++++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-cloudinit/coreos-cloudinit-9999.ebuild |
| 110 | +@@ -2,7 +2,7 @@ |
| 111 | + # Distributed under the terms of the GNU General Public License v2 |
| 112 | + |
| 113 | + EAPI=7 |
| 114 | +-EGIT_REPO_URI="https://github.com/flatcar/coreos-cloudinit.git" |
| 115 | ++EGIT_REPO_URI="https://github.com/tuunit/flatcar-cloudinit.git" |
| 116 | + COREOS_GO_PACKAGE="github.com/flatcar/coreos-cloudinit" |
| 117 | + COREOS_GO_GO111MODULE="on" |
| 118 | + inherit git-r3 systemd toolchain-funcs udev coreos-go |
| 119 | +@@ -10,7 +10,7 @@ inherit git-r3 systemd toolchain-funcs udev coreos-go |
| 120 | + if [[ "${PV}" == 9999 ]]; then |
| 121 | + KEYWORDS="~amd64 ~arm64" |
| 122 | + else |
| 123 | +- EGIT_COMMIT="f3aaab923de5075524780716635f25564b5e6934" # flatcar-master |
| 124 | ++ EGIT_COMMIT="57fac09cb2f4c13b89f6baec46569a3e66a3b29b" # feat/ionoscloud-support |
| 125 | + KEYWORDS="amd64 arm64" |
| 126 | + fi |
| 127 | + |
| 128 | +diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-init/coreos-init-9999.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-init/coreos-init-9999.ebuild |
| 129 | +index 3340856180..299ffdd522 100644 |
| 130 | +--- a/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-init/coreos-init-9999.ebuild |
| 131 | ++++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-init/coreos-init-9999.ebuild |
| 132 | +@@ -3,12 +3,12 @@ |
| 133 | + # Distributed under the terms of the GNU General Public License v2 |
| 134 | + |
| 135 | + EAPI=7 |
| 136 | +-EGIT_REPO_URI="https://github.com/flatcar/init.git" |
| 137 | ++EGIT_REPO_URI="https://github.com/tuunit/flatcar-init.git" |
| 138 | + |
| 139 | + if [[ "${PV}" == 9999 ]]; then |
| 140 | + KEYWORDS="~amd64 ~arm ~arm64 ~x86" |
| 141 | + else |
| 142 | +- EGIT_COMMIT="05b4b2aafbe706bdd65265c7a7103ed75fee14d2" # flatcar-master |
| 143 | ++ EGIT_COMMIT="a226d804b740bba9906e1beefe1ca51cba28dcdc" # flatcar-master |
| 144 | + KEYWORDS="amd64 arm arm64 x86" |
| 145 | + fi |
| 146 | + |
| 147 | +diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ionoscloud/metadata.xml b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ionoscloud/metadata.xml |
| 148 | +new file mode 100644 |
| 149 | +index 0000000000..097975e3ad |
| 150 | +--- /dev/null |
| 151 | ++++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ionoscloud/metadata.xml |
| 152 | +@@ -0,0 +1,4 @@ |
| 153 | ++<?xml version="1.0" encoding="UTF-8"?> |
| 154 | ++<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
| 155 | ++<pkgmetadata> |
| 156 | ++</pkgmetadata> |
| 157 | +diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ionoscloud/oem-ionoscloud-0.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ionoscloud/oem-ionoscloud-0.ebuild |
| 158 | +new file mode 100644 |
| 159 | +index 0000000000..c4127bb87b |
| 160 | +--- /dev/null |
| 161 | ++++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ionoscloud/oem-ionoscloud-0.ebuild |
| 162 | +@@ -0,0 +1,15 @@ |
| 163 | ++# Copyright (c) 2013 CoreOS, Inc.. All rights reserved. |
| 164 | ++# Distributed under the terms of the GNU General Public License v2 |
| 165 | ++ |
| 166 | ++EAPI=8 |
| 167 | ++ |
| 168 | ++DESCRIPTION="OEM suite for IONOS Cloud" |
| 169 | ++HOMEPAGE="https://cloud.ionos.com" |
| 170 | ++SRC_URI="" |
| 171 | ++ |
| 172 | ++LICENSE="GPL-2" |
| 173 | ++SLOT="0" |
| 174 | ++KEYWORDS="amd64" |
| 175 | ++IUSE="" |
| 176 | ++ |
| 177 | ++OEM_NAME="IONOS Cloud" |
| 178 | +diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/ignition-9999.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/ignition-9999.ebuild |
| 179 | +index c2dc426836..5572d380a4 100644 |
| 180 | +--- a/sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/ignition-9999.ebuild |
| 181 | ++++ b/sdk_container/src/third_party/coreos-overlay/sys-apps/ignition/ignition-9999.ebuild |
| 182 | +@@ -10,7 +10,7 @@ inherit coreos-go git-r3 systemd udev |
| 183 | + if [[ "${PV}" == 9999 ]]; then |
| 184 | + KEYWORDS="~amd64 ~arm64" |
| 185 | + else |
| 186 | +- EGIT_COMMIT="a204f429f13194ae379be9401d49e5241439660b" # v2.20.0 |
| 187 | ++ EGIT_COMMIT="488d302a0863ede5b723aea4ddd558f96e318569" # v2.20.0 |
| 188 | + KEYWORDS="amd64 arm64" |
| 189 | + fi |
| 190 | + |
| 191 | +-- |
| 192 | +2.45.2 |
| 193 | + |
0 commit comments