Skip to content

Commit

Permalink
overlay coreos-base/oem-ec2: new sysext image
Browse files Browse the repository at this point in the history
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
  • Loading branch information
tormath1 committed Aug 29, 2023
1 parent ea93e63 commit d12ce32
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 4 deletions.
8 changes: 5 additions & 3 deletions build_library/vm_image_util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,13 @@ IMG_parallels_DISK_LAYOUT=vm
IMG_parallels_CONF_FORMAT=pvs

## ami
IMG_ami_OEM_PACKAGE=oem-ec2-compat
IMG_ami_OEM_USE=ec2
IMG_ami_vmdk_DISK_FORMAT=vmdk_stream
IMG_ami_vmdk_OEM_PACKAGE=oem-ec2-compat
IMG_ami_vmdk_OEM_USE=ec2
IMG_ami_vmdk_OEM_PACKAGE=common-oem-files
IMG_ami_vmdk_SYSEXT=oem-ec2
IMG_ami_OEM_USE=ec2
IMG_ami_OEM_PACKAGE=common-oem-files
IMG_ami_OEM_SYSEXT=oem-ec2

## openstack, supports ec2's metadata format so use oem-ec2-compat
IMG_openstack_DISK_FORMAT=qcow2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
EAPI=8

OEMIDS=(
qemu
azure
ec2
qemu
)

DESCRIPTION='Common OEM files'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

set -euo pipefail

rootfs="${1}"

cat > "${rootfs}/usr/lib/systemd/system/setup-oem.service" <<-'EOF'
[Unit]
Description=Setup OEM
Before=amazon-ssm-agent.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStartPre=/usr/bin/mkdir --parents /etc/amazon/ssm/ /etc/eks
ExecStartPre=/usr/bin/ln --symbolic /usr/share/amazon/ssm/amazon-ssm-agent.json.template /etc/amazon/ssm/amazon-ssm-agent.json
ExecStartPre=/usr/bin/ln --symbolic /usr/share/amazon/ssm/seelog.xml.template /etc/amazon/ssm/seelog.xml
ExecStart=/usr/bin/ln --symbolic /usr/share/amazon/eks/bootstrap.sh /etc/eks/bootstrap.sh
[Install]
WantedBy=multi-user.target
EOF

mkdir -p "${rootfs}/usr/lib/systemd/system/multi-user.target.d"
{ echo "[Unit]"; echo "Upholds=amazon-ssm-agent.service coreos-metadata-sshkeys@.service setup-oem.service"; } > "${rootfs}/usr/lib/systemd/system/multi-user.target.d/10-oem-ec2.conf"
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,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 Amazon Machine Images"
HOMEPAGE="http://aws.amazon.com/ec2/"
SRC_URI=""

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 arm64"
IUSE=""

RDEPEND="
~app-emulation/amazon-ssm-agent-${PV}
coreos-base/flatcar-eks
"

# for coreos-base/common-oem-files
OEM_NAME="Amazon EC2"

0 comments on commit d12ce32

Please sign in to comment.