Merge pull request #1391 from flatcar/kai/brightbox

Use OpenStack image for Brightbox
This commit is contained in:
Kai Lüke 2023-11-16 18:30:51 +01:00 committed by GitHub
commit bd36d82fe6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 6 additions and 94 deletions

View File

@ -9,7 +9,6 @@ VALID_IMG_TYPES=(
ami
ami_vmdk
azure
brightbox
cloudsigma
cloudstack
cloudstack_vhd
@ -242,12 +241,6 @@ IMG_openstack_mini_OEM_PACKAGE=common-oem-files
IMG_openstack_mini_OEM_USE=openstack
IMG_openstack_mini_OEM_SYSEXT=oem-openstack
## brightbox, supports ec2's metadata format so use oem-ec2-compat
IMG_brightbox_DISK_FORMAT=qcow2
IMG_brightbox_DISK_LAYOUT=vm
IMG_brightbox_OEM_PACKAGE=oem-ec2-compat
IMG_brightbox_OEM_USE=brightbox
## pxe, which is an cpio image
IMG_pxe_DISK_FORMAT=cpio
IMG_pxe_PARTITIONED_IMG=0

View File

@ -0,0 +1,2 @@
- Brightbox: The regular OpenStack image should now be used, it includes Afterburn for instance metadata attributes
- OpenStack: An uncompressed image is provided for simpler import (since the images use qcow2 inline compression, there is no benefit in using the `.gz` or `.bz2` images)

View File

@ -127,8 +127,10 @@ function _vm_build_impl() {
for format in ${formats}; do
echo " ################### VENDOR '${format}' ################### "
COMPRESSION_FORMAT="bz2"
if [[ "${format}" =~ ^(openstack|openstack_mini|digitalocean)$ ]];then
if [[ "${format}" =~ ^(openstack_mini|digitalocean)$ ]];then
COMPRESSION_FORMAT="gz,bz2"
elif [[ "${format}" =~ ^(openstack)$ ]];then
COMPRESSION_FORMAT="gz,bz2,none"
elif [[ "${format}" =~ ^(qemu|qemu_uefi)$ ]];then
COMPRESSION_FORMAT="bz2,none"
fi
@ -148,6 +150,7 @@ function _vm_build_impl() {
-v "${vernum}" \
mv "${CONTAINER_IMAGE_ROOT}/${arch}-usr/" "./${images_out}/"
( cd images/latest ; ln -s flatcar_production_openstack_image.img.bz2 flatcar_production_brightbox_image.img.bz2 )
create_digests "${SIGNER}" "images/latest/"*
sign_artifacts "${SIGNER}" "images/latest/"*
copy_to_buildcache "images/${arch}/${vernum}/" "images/latest/"*

View File

@ -1,4 +0,0 @@
These Ignition configs are part of the OEM configuration. Do not modify
them. If you want to write an Ignition config directly to disk, put it in
../config.ign and it will be applied at first boot instead of a config
in userdata.

View File

@ -1,13 +0,0 @@
{
"ignition": {
"version": "3.3.0"
},
"systemd": {
"units": [
{
"enabled": true,
"name": "coreos-metadata-sshkeys@.service"
}
]
}
}

View File

@ -1,3 +0,0 @@
# Flatcar GRUB settings for EC2
set oem_id="brightbox"

View File

@ -1,3 +0,0 @@
# Flatcar GRUB settings for EC2
set oem_id="openstack"

View File

@ -1,5 +0,0 @@
ID=@@OEM_ID@@
VERSION_ID=@@OEM_VERSION_ID@@
NAME="@@OEM_NAME@@"
HOME_URL="@@OEM_HOME_URL@@"
BUG_REPORT_URL="https://issues.flatcar.org"

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
</pkgmetadata>

View File

@ -1,54 +0,0 @@
# Copyright (c) 2013 CoreOS, Inc.. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
EAPI=7
DESCRIPTION="OEM suite for EC2 compatible images"
HOMEPAGE=""
SRC_URI=""
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 arm64 x86"
IUSE="openstack brightbox"
REQUIRED_USE="^^ ( openstack brightbox )"
# no source directory
S="${WORKDIR}"
src_prepare() {
default
if use openstack ; then
ID="openstack"
NAME="Openstack"
HOME_URL="https://www.openstack.org/"
elif use brightbox ; then
ID="brightbox"
NAME="Brightbox"
HOME_URL="http://brightbox.com/"
else
die "Unknown OEM!"
fi
sed -e "s\\@@OEM_ID@@\\${ID}\\g" \
-e "s\\@@OEM_NAME@@\\${NAME}\\g" \
-e "s\\@@OEM_VERSION_ID@@\\${PVR}\\g" \
-e "s\\@@OEM_HOME_URL@@\\${HOME_URL}\\g" \
"${FILESDIR}/oem-release" > "${T}/oem-release" || die
}
src_install() {
insinto "/oem"
doins "${T}/oem-release"
if use openstack ; then
newins "${FILESDIR}/grub-openstack.cfg" grub.cfg
elif use brightbox ; then
newins "${FILESDIR}/grub-brightbox.cfg" grub.cfg
fi
insinto "/oem/base"
doins "${FILESDIR}/base/README"
if use openstack; then
newins "${FILESDIR}/base/openstack.ign" base.ign
fi
}