overlay coreos-base/oem-azure: Make it a sysext package

This package will be used for the sysext image, instead of for
installing files into /usr/share/oem. This means that we can drop some
files or move them elsewhere. The systemd service file is not needed,
because it is installed by the app-emulation/wa-linux-agent package
now. This also means that the ignition file as lost its purpose. The
grub.cfg and oem-release must be installed in /usr/share/oem, next to
the sysext raw image file, so handling of these files is moved to the
newly added coreos-base/common-oem-files package. `eject` symlink to
`/usr/bin/true` is installed in the newly added manglefs.sh script.

With this done, we also opt into building an OEM sysext image for
Azure platform.
This commit is contained in:
Krzesimir Nowak 2023-06-06 13:14:55 +02:00
parent 70d33ebabd
commit 995910cd78
10 changed files with 41 additions and 102 deletions

View File

@ -279,7 +279,9 @@ IMG_exoscale_OEM_PACKAGE=oem-exoscale
## azure
IMG_azure_DISK_FORMAT=vhd_fixed
IMG_azure_DISK_LAYOUT=azure
IMG_azure_OEM_PACKAGE=oem-azure
IMG_azure_OEM_USE=azure
IMG_azure_OEM_PACKAGE=common-oem-files
IMG_azure_OEM_SYSEXT=oem-azure
## hyper-v
IMG_hyperv_DISK_FORMAT=vhd

View File

@ -4,6 +4,7 @@
EAPI=8
OEMIDS=(
azure
)
DESCRIPTION='Common OEM files'

View File

@ -1,7 +1,3 @@
# Flatcar GRUB settings
set oem_id="azure"
set linux_append="flatcar.autologin"
# Azure only has a serial console.

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,37 +0,0 @@
{
"ignition": {
"version": "2.1.0"
},
"storage": {
"files": [
{
"filesystem": "root",
"path": "/etc/systemd/system/waagent.service",
"contents": {
"source": "oem:///units/waagent.service"
},
"mode": 292
},
{
"filesystem": "root",
"path": "/etc/systemd/system/nvidia.service",
"contents": {
"source": "oem:///units/nvidia.service"
},
"mode": 292
}
]
},
"systemd": {
"units": [
{
"name": "waagent.service",
"enabled": true
},
{
"name": "nvidia.service",
"enabled": true
}
]
}
}

View File

@ -0,0 +1,16 @@
#!/bin/bash
set -euo pipefail
rootfs="${1}"
to_delete=(
/usr/include
/usr/lib/debug
/usr/share/gdb
/usr/lib64/pkgconfig
)
rm -rf "${to_delete[@]/#/${rootfs}}"
ln -sf /usr/bin/true "${rootfs}/usr/bin/eject"

View File

@ -1,5 +0,0 @@
ID=azure
VERSION_ID=@@OEM_VERSION_ID@@
NAME="Microsoft Azure"
HOME_URL="https://azure.microsoft.com/"
BUG_REPORT_URL="https://issues.flatcar.org"

View File

@ -1,15 +0,0 @@
[Unit]
Description=Microsoft Azure Agent
Wants=network-online.target sshd-keygen.service
After=network-online.target sshd-keygen.service
[Service]
Type=simple
Restart=always
RestartSec=5s
Environment=PATH=/oem/python/bin:/oem/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
Environment=PYTHONUNBUFFERED=x
ExecStart=/oem/bin/waagent -daemon
[Install]
WantedBy=multi-user.target

View File

@ -1,36 +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 Azure"
HOMEPAGE=""
SRC_URI=""
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 arm64"
IUSE=""
# no source directory
S="${WORKDIR}"
RDEPEND="
~app-emulation/wa-linux-agent-${PV}
x11-drivers/nvidia-drivers
"
src_prepare() {
default
sed -e "s\\@@OEM_VERSION_ID@@\\${PVR}\\g" \
"${FILESDIR}/oem-release" > "${T}/oem-release" || die
}
src_install() {
insinto "/oem"
doins "${FILESDIR}/grub.cfg"
doins "${T}/oem-release"
doins -r "${FILESDIR}/base"
doins -r "${FILESDIR}/units"
dosym "/usr/bin/true" "/oem/bin/eject"
}

View File

@ -0,0 +1,21 @@
# 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 Azure"
HOMEPAGE="https://azure.microsoft.com/"
SRC_URI=""
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 arm64"
IUSE=""
RDEPEND="
~app-emulation/wa-linux-agent-${PV}
x11-drivers/nvidia-drivers
"
# for coreos-base/common-oem-files
OEM_NAME="Microsoft Azure"