Skip to content

Commit f20f614

Browse files
committed
add ionoscloud support
1 parent 8357e5c commit f20f614

File tree

13 files changed

+347
-12
lines changed

13 files changed

+347
-12
lines changed

build_library/disk_layout.json

+10
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,16 @@
104104
"fs_type":"ext2"
105105
}
106106
},
107+
"ionoscloud":{
108+
"6":{
109+
"fs_type":"ext4"
110+
},
111+
"9":{
112+
"label":"ROOT",
113+
"fs_label":"ROOT",
114+
"blocks":"12943360"
115+
}
116+
},
107117
"container":{
108118
"1":{
109119
"type":"blank"

build_library/vm_image_util.sh

+27
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ VALID_IMG_TYPES=(
4242
vmware_ova
4343
vmware_raw
4444
xen
45+
ionoscloud
46+
ionoscloud_raw
4547
)
4648

4749
#list of oem package names, minus the oem- prefix
@@ -68,6 +70,7 @@ VALID_OEM_PACKAGES=(
6870
vagrant-virtualbox
6971
virtualbox
7072
vmware
73+
ionoscloud
7174
)
7275

7376
# Set at runtime to one of the above types
@@ -341,6 +344,20 @@ IMG_proxmoxve_OEM_PACKAGE=common-oem-files
341344
IMG_proxmoxve_OEM_USE=proxmoxve
342345
IMG_proxmoxve_OEM_SYSEXT=oem-proxmoxve
343346

347+
## ionoscloud
348+
IMG_ionoscloud_OEM_USE=ionoscloud
349+
IMG_ionoscloud_OEM_PACKAGE=oem-ionoscloud
350+
IMG_ionoscloud_DISK_LAYOUT=ionoscloud
351+
IMG_ionoscloud_DISK_FORMAT=qcow2
352+
IMG_ionoscloud_DISK_EXTENSION=qcow2
353+
IMG_ionoscloud_FS_HOOK=ionoscloud
354+
355+
## ionoscloud_raw
356+
IMG_ionoscloud_raw_OEM_USE=ionoscloud
357+
IMG_ionoscloud_raw_OEM_PACKAGE=oem-ionoscloud
358+
IMG_ionoscloud_raw_DISK_LAYOUT=ionoscloud
359+
IMG_ionoscloud_raw_FS_HOOK=ionoscloud
360+
344361
###########################################################
345362

346363
# Print the default vm type for the specified board
@@ -619,6 +636,16 @@ _run_box_fs_hook() {
619636
sudo rm -fr "${VM_TMP_ROOT}/oem/box"
620637
}
621638

639+
_run_ionoscloud_fs_hook() {
640+
# Prepare root partition for IONOS Cloud legacy injection
641+
# This is a workaround until the IONOS Cloud introduces a metadata server
642+
sudo mount -o remount,rw "${VM_TMP_ROOT}"
643+
sudo mkdir -p "${VM_TMP_ROOT}/var/lib/cloud/seed/nocloud"
644+
sudo mkdir -p "${VM_TMP_ROOT}/etc/cloud"
645+
sudo touch "${VM_TMP_ROOT}/etc/cloud/cloud.cfg"
646+
sudo mount -o remount,ro "${VM_TMP_ROOT}"
647+
}
648+
622649
# Write the vm disk image to the target directory in the proper format
623650
write_vm_disk() {
624651
if [[ $(_get_vm_opt PARTITIONED_IMG) -eq 1 ]]; then

ci-automation/vms.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function _vm_build_impl() {
138138
COMPRESSION_FORMAT="bz2,none"
139139
elif [[ "${format}" =~ ^(hyperv|hyperv_vhdx)$ ]];then
140140
COMPRESSION_FORMAT="zip"
141-
elif [[ "${format}" =~ ^(scaleway|kubevirt|proxmoxve)$ ]];then
141+
elif [[ "${format}" =~ ^(scaleway|kubevirt|proxmoxve|ionoscloud)$ ]];then
142142
COMPRESSION_FORMAT="none"
143143
elif [[ "${format}" =~ ^(akamai)$ ]];then
144144
COMPRESSION_FORMAT="gz"
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FLATCAR_VERSION=4207.0.0+nightly-20250106-2100
2-
FLATCAR_VERSION_ID=4207.0.0
3-
FLATCAR_BUILD_ID="nightly-20250106-2100"
1+
FLATCAR_VERSION=4204.0.0+nightly-20250103-2100-7-g83c4e5a2a4
2+
FLATCAR_VERSION_ID=4204.0.0
3+
FLATCAR_BUILD_ID="nightly-20250103-2100-7-g83c4e5a2a4"
44
FLATCAR_SDK_VERSION=4207.0.0+nightly-20250106-2100

sdk_container/src/third_party/coreos-overlay/coreos-base/afterburn/files/coreos-metadata.service

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ ConditionKernelCommandLine=|flatcar.oem.id=akamai
2727

2828
ConditionKernelCommandLine=|flatcar.oem.id=proxmoxve
2929

30+
ConditionKernelCommandLine=|flatcar.oem.id=ionoscloud
31+
3032
Description=Flatcar Metadata Agent
3133

3234
[Service]

sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-cloudinit/coreos-cloudinit-9999.ebuild

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
# Distributed under the terms of the GNU General Public License v2
33

44
EAPI=7
5-
EGIT_REPO_URI="https://github.com/flatcar/coreos-cloudinit.git"
5+
EGIT_REPO_URI="https://github.com/tuunit/flatcar-cloudinit.git"
66
COREOS_GO_PACKAGE="github.com/flatcar/coreos-cloudinit"
77
COREOS_GO_GO111MODULE="on"
88
inherit git-r3 systemd toolchain-funcs udev coreos-go
99

1010
if [[ "${PV}" == 9999 ]]; then
1111
KEYWORDS="~amd64 ~arm64"
1212
else
13-
EGIT_COMMIT="f3aaab923de5075524780716635f25564b5e6934" # flatcar-master
13+
EGIT_COMMIT="a0a73022ef2af493b029b145d4235b5a8360afe1" # feat/ionoscloud-support
1414
KEYWORDS="amd64 arm64"
1515
fi
1616

sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-init/coreos-init-9999.ebuild

+5-6
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,18 @@
33
# Distributed under the terms of the GNU General Public License v2
44

55
EAPI=7
6-
EGIT_REPO_URI="https://github.com/flatcar/init.git"
6+
EGIT_REPO_URI="https://github.com/tuunit/flatcar-init.git"
7+
PYTHON_COMPAT=( python3_{9..11} )
8+
9+
inherit git-r3 systemd python-any-r1
710

811
if [[ "${PV}" == 9999 ]]; then
912
KEYWORDS="~amd64 ~arm ~arm64 ~x86"
1013
else
11-
EGIT_COMMIT="b5a6cbcfaabe605e28e075b8ac674edaf576a0eb" # flatcar-master
14+
EGIT_COMMIT="5e39ca5d2e5e85217704cefdfa9f2f128ecf822f" # feat/ionoscloud-support
1215
KEYWORDS="amd64 arm arm64 x86"
1316
fi
1417

15-
PYTHON_COMPAT=( python3_{9..11} )
16-
17-
inherit git-r3 systemd python-any-r1
18-
1918
DESCRIPTION="Init scripts for CoreOS"
2019
HOMEPAGE="http://www.coreos.com/"
2120
SRC_URI=""
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# DO NOT EDIT FILE
2+
# MANAGED BY IONOS CLOUD
3+
#
4+
# INDICATOR FILE FOR USER DATA INJECTION
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Flatcar GRUB settings
2+
3+
set oem_id="ionoscloud"
4+
set linux_append="flatcar.autologin"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
3+
<pkgmetadata>
4+
</pkgmetadata>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (c) 2013 CoreOS, Inc.. All rights reserved.
2+
# Distributed under the terms of the GNU General Public License v2
3+
4+
EAPI=8
5+
6+
DESCRIPTION="OEM suite for IONOS Cloud"
7+
HOMEPAGE="https://cloud.ionos.com"
8+
SRC_URI=""
9+
10+
LICENSE="Apache-2.0"
11+
SLOT="0"
12+
KEYWORDS="amd64"
13+
14+
# no source directory
15+
S="${WORKDIR}"
16+
17+
src_install() {
18+
insinto "/oem"
19+
doins "${FILESDIR}/grub.cfg"
20+
doins "${FILESDIR}/USER_DATA_INJECTION"
21+
}

0 commit comments

Comments
 (0)