Merge pull request #83 from polvi/add-oem

feat(coreos-base/oem): add the initial oem partition support
This commit is contained in:
Brandon Philips 2013-07-18 10:48:14 -07:00
commit b8c19881ae
10 changed files with 84 additions and 0 deletions

View File

@ -151,6 +151,7 @@ RDEPEND="${RDEPEND}
app-emulation/docker app-emulation/docker
app-misc/ca-certificates app-misc/ca-certificates
virtual/udev virtual/udev
coreos-base/oem-service
" "
# TODO(dianders): # TODO(dianders):

View File

@ -106,6 +106,7 @@ RDEPEND="${RDEPEND}
dev-libs/protobuf-c dev-libs/protobuf-c
app-text/asciidoc app-text/asciidoc
app-text/xmlto app-text/xmlto
sys-apps/gptfdisk
" "
# Host dependencies that create usernames/groups we need to pull over to target. # Host dependencies that create usernames/groups we need to pull over to target.

View 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

View File

@ -0,0 +1,3 @@
#!/bin/bash
/usr/share/oem/usr/bin/install-ec2-key.sh

View File

@ -0,0 +1 @@
oem-ami-0.0.1.ebuild

View 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
}

View File

@ -0,0 +1,6 @@
[Service]
Type=oneshot
ExecStart=/usr/bin/run-oem.sh
[Install]
WantedBy=multi-user.target

View 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

View File

@ -0,0 +1 @@
oem-service-0.0.1.ebuild

View 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
}