mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-14 16:37:01 +02:00
feat(coreos-base/oem): add the initial oem partition support
this (great looking) code adds the oem partition and supporting scripts and services. AMI is the first target use case.
This commit is contained in:
parent
50959ce3c9
commit
3cd7f13223
@ -152,6 +152,7 @@ RDEPEND="${RDEPEND}
|
||||
sys-process/criu
|
||||
app-misc/ca-certificates
|
||||
virtual/udev
|
||||
coreos-base/oem-service
|
||||
"
|
||||
|
||||
# TODO(dianders):
|
||||
|
@ -105,6 +105,7 @@ RDEPEND="${RDEPEND}
|
||||
dev-libs/protobuf-c
|
||||
app-text/asciidoc
|
||||
app-text/xmlto
|
||||
sys-apps/gptfdisk
|
||||
"
|
||||
|
||||
# Host dependencies that create usernames/groups we need to pull over to target.
|
||||
|
16
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/files/install-ec2-key.sh
vendored
Executable file
16
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/files/install-ec2-key.sh
vendored
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
USER_DIR="/home/core/user"
|
||||
|
||||
if [ ! -d ${USER_DIR}/.ssh ] ; then
|
||||
mkdir -p ${USER_DIR}/.ssh
|
||||
chmod 700 ${USER_DIR}/.ssh
|
||||
fi
|
||||
# Fetch public key using HTTP
|
||||
curl -s http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key > /tmp/my-key
|
||||
if [ $? -eq 0 ] ; then
|
||||
cat /tmp/my-key >> ${USER_DIR}/.ssh/authorized_keys
|
||||
chmod 700 ${USER_DIR}/.ssh/authorized_keys
|
||||
rm /tmp/my-key
|
||||
fi
|
||||
chown -R core: $USER_DIR/.ssh
|
3
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/files/oem.service
vendored
Normal file
3
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/files/oem.service
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/share/oem/bin/install-ec2-key.sh
|
3
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/files/run.sh
vendored
Executable file
3
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/files/run.sh
vendored
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
/usr/share/oem/usr/bin/install-ec2-key.sh
|
1
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/oem-ami-0.0.1-r4.ebuild
vendored
Symbolic link
1
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/oem-ami-0.0.1-r4.ebuild
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
oem-ami-0.0.1.ebuild
|
24
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/oem-ami-0.0.1.ebuild
vendored
Normal file
24
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/oem-ami-0.0.1.ebuild
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
#
|
||||
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
|
||||
# Copyright (c) 2013 CoreOS, Inc.. All rights reserved.
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header:$
|
||||
#
|
||||
|
||||
EAPI=2
|
||||
|
||||
DESCRIPTION="oem suite for ami images"
|
||||
HOMEPAGE=""
|
||||
SRC_URI=""
|
||||
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="0"
|
||||
KEYWORDS="amd64 x86"
|
||||
IUSE=""
|
||||
|
||||
src_install() {
|
||||
dobin "${FILESDIR}"/install-ec2-key.sh
|
||||
|
||||
exeinto "/"
|
||||
doexe ${FILESDIR}/run.sh
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/run-oem.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
6
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-service/files/run-oem.sh
vendored
Executable file
6
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-service/files/run-oem.sh
vendored
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Each oem implemenation has a run.sh that boostraps its OEM process for systemd
|
||||
OEM_EXEC="/usr/share/oem/run.sh"
|
||||
|
||||
[ -e $OEM_EXEC ] && exec $OEM_EXEC || exit 0
|
1
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-service/oem-service-0.0.1-r3.ebuild
vendored
Symbolic link
1
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-service/oem-service-0.0.1-r3.ebuild
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
oem-service-0.0.1.ebuild
|
25
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-service/oem-service-0.0.1.ebuild
vendored
Normal file
25
sdk_container/src/third_party/coreos-overlay/coreos-base/oem-service/oem-service-0.0.1.ebuild
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
#
|
||||
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
|
||||
# Copyright (c) 2013 CoreOS, Inc.. All rights reserved.
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header:$
|
||||
#
|
||||
|
||||
EAPI=2
|
||||
inherit systemd
|
||||
|
||||
DESCRIPTION="oem service"
|
||||
HOMEPAGE=""
|
||||
SRC_URI=""
|
||||
|
||||
LICENSE="Apache-2.0"
|
||||
SLOT="0"
|
||||
KEYWORDS="amd64 x86"
|
||||
IUSE=""
|
||||
|
||||
src_install() {
|
||||
dobin ${FILESDIR}/run-oem.sh
|
||||
|
||||
systemd_dounit "${FILESDIR}"/${PN}.service
|
||||
systemd_enable_service multi-user.target ${PN}.service
|
||||
}
|
Loading…
Reference in New Issue
Block a user