diff --git a/build_library/vm_image_util.sh b/build_library/vm_image_util.sh index a82759496b..e7a966b75b 100644 --- a/build_library/vm_image_util.sh +++ b/build_library/vm_image_util.sh @@ -257,7 +257,6 @@ IMG_iso_MEM=2048 IMG_gce_DISK_LAYOUT=vm IMG_gce_CONF_FORMAT=gce IMG_gce_OEM_PACKAGE=common-oem-files -IMG_gce_OEM_ACI=gce IMG_gce_OEM_USE=gce IMG_gce_OEM_SYSEXT=oem-gce diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-oem-gce/coreos-oem-gce-0.0.1-r6.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-oem-gce/coreos-oem-gce-0.0.1-r6.ebuild deleted file mode 120000 index 348c68c571..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-oem-gce/coreos-oem-gce-0.0.1-r6.ebuild +++ /dev/null @@ -1 +0,0 @@ -coreos-oem-gce-0.0.1.ebuild \ No newline at end of file diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-oem-gce/coreos-oem-gce-0.0.1.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-oem-gce/coreos-oem-gce-0.0.1.ebuild deleted file mode 100644 index 062aa7eebf..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-oem-gce/coreos-oem-gce-0.0.1.ebuild +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2016 CoreOS, Inc.. All rights reserved. -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -DESCRIPTION="CoreOS OEM suite for Google Compute Engine (meta package)" -HOMEPAGE="" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="amd64" -IUSE="" - -RDEPEND=" - app-emulation/google-compute-engine - app-shells/bash - sys-apps/gentoo-functions - sys-libs/glibc - sys-libs/nss-usrfiles -" diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-oem-gce/files/manifest.in b/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-oem-gce/files/manifest.in deleted file mode 100644 index b7a8896f85..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-oem-gce/files/manifest.in +++ /dev/null @@ -1,33 +0,0 @@ -{ - "acKind": "ImageManifest", - "acVersion": "0.8.6", - "name": "@ACI_NAME@", - "labels": [ - {"name": "arch", "value": "@ACI_ARCH@"}, - {"name": "os", "value": "linux"}, - {"name": "version", "value": "@ACI_VERSION@"} - ], - "app": { - "exec": [ "/init.sh" ], - "user": "0", - "group": "0", - - "mountPoints": [ - { - "name": "etc", - "path": "/etc", - "readOnly": false - }, - { - "name": "home", - "path": "/home", - "readOnly": false - }, - { - "name": "runsystemd", - "path": "/run/systemd", - "readOnly": false - } - ] - } -} diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-oem-gce/metadata.xml b/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-oem-gce/metadata.xml deleted file mode 100644 index 097975e3ad..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-oem-gce/metadata.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-oem-gce/files/manglefs.sh b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/bin/init.sh similarity index 71% rename from sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-oem-gce/files/manglefs.sh rename to sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/bin/init.sh index eab042ad0d..1b6c56e5b3 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-oem-gce/files/manglefs.sh +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/bin/init.sh @@ -1,11 +1,7 @@ -#!/bin/sh -set -e - +#!/bin/bash -ex # GCE can work with our normal file system, but it needs an "init system". # Here is a better place to install this script so it doesn't get put in real # images built from the GCE Python package. -cat << 'EOF' > init.sh && chmod 755 init.sh -#!/bin/bash -ex # Write a configuration template if it does not exist. [ -e /etc/default/instance_configs.cfg.template ] || @@ -38,20 +34,3 @@ test -n "$stopping" || exit 1 # Otherwise, run the shutdown script before quitting. exec /usr/bin/google_metadata_script_runner --script-type shutdown -EOF - -# Disable PAM checks in the container. -rm -f usr/lib/pam.d/* -cat << 'EOF' > usr/lib/pam.d/other -account optional pam_permit.so -auth optional pam_permit.so -password optional pam_permit.so -session optional pam_permit.so -EOF - -# Don't bundle these paths, since they are useless to us. -mv usr/lib/systemd/lib*.so* usr/lib64/ -rm -fr boot etc/* usr/lib/systemd var/db/pkg - -# Remove test stuff from python - it's quite large. -rm -rf usr/lib/python*/test diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/10-oem-gce.conf b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/10-oem-gce.conf index 69909d6ea3..59b5fa8e1f 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/10-oem-gce.conf +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/10-oem-gce.conf @@ -1,2 +1,2 @@ [Unit] -Upholds=oem-gce-enable-oslogin.service setup-oem.service +Upholds=oem-gce-enable-oslogin.service setup-oem.service oem-gce.service diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/oem-gce.service b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/oem-gce.service index 8fb3a77339..c03bcc740d 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/oem-gce.service +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/files/units/oem-gce.service @@ -12,20 +12,7 @@ RestartSec=5 KillMode=process KillSignal=SIGTERM -ExecStartPre=/usr/bin/rm -f /var/lib/flatcar-oem-gce.img -ExecStartPre=/usr/bin/truncate -s 1G /var/lib/flatcar-oem-gce.img -ExecStartPre=/usr/sbin/mkfs.ext4 /var/lib/flatcar-oem-gce.img -ExecStartPre=/usr/bin/rm -rf /var/lib/flatcar-oem-gce -ExecStartPre=/usr/bin/mkdir -p /var/lib/flatcar-oem-gce -ExecStartPre=-/usr/bin/umount /var/lib/flatcar-oem-gce.img -ExecStartPre=/usr/bin/mount /var/lib/flatcar-oem-gce.img /var/lib/flatcar-oem-gce -ExecStartPre=/usr/bin/tar --directory=/var/lib/flatcar-oem-gce --extract --file=/oem/flatcar-oem-gce.aci --strip-components=1 rootfs -ExecStartPre=/usr/bin/umount /var/lib/flatcar-oem-gce.img -# the container expects to be able to optmize irq settings in /proc/irq and /sys/ -Environment=SYSTEMD_NSPAWN_API_VFS_WRITABLE=1 -ExecStart=/usr/bin/systemd-nspawn --keep-unit --register=no --link-journal=no \ - --machine=oem-gce --capability=CAP_NET_ADMIN --bind=/dev/log --bind=/run/systemd --tmpfs=/run/lock --bind=/etc --bind=/home --bind-ro=/usr/share/google-oslogin/nsswitch.conf \ - --read-only --volatile=overlay --image=/var/lib/flatcar-oem-gce.img --kill-signal=SIGTERM /init.sh +ExecStart=/usr/bin/init.sh [Install] WantedBy=multi-user.target diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/oem-gce-20180823-r6.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/oem-gce-20180823-r6.ebuild index 0fec59b6f3..ca82fb0b21 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/oem-gce-20180823-r6.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-gce/oem-gce-20180823-r6.ebuild @@ -19,14 +19,20 @@ IUSE="" # no source directory S="${WORKDIR}" +RDEPEND=" + app-emulation/google-compute-engine +" + OEM_NAME="Google Compute Engine" src_install() { + systemd_dounit "${FILESDIR}/units/oem-gce.service" systemd_dounit "${FILESDIR}/units/oem-gce-enable-oslogin.service" systemd_dounit "${FILESDIR}/units/setup-oem.service" systemd_install_dropin "multi-user.target" "${FILESDIR}/units/10-oem-gce.conf" dobin "${FILESDIR}/bin/enable-oslogin" + dobin "${FILESDIR}/bin/init.sh" # These files will be symlinked to /etc via 'setup-oem.service' insinto /usr/share/gce/ diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-devel/board-packages/board-packages-0.0.1.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-devel/board-packages/board-packages-0.0.1.ebuild index 308ff191e5..5166713cb1 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-devel/board-packages/board-packages-0.0.1.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/coreos-devel/board-packages/board-packages-0.0.1.ebuild @@ -20,8 +20,8 @@ IUSE="" DEPEND="" RDEPEND=" amd64? ( + app-emulation/google-compute-engine app-emulation/open-vm-tools - coreos-base/coreos-oem-gce coreos-base/nova-agent-container coreos-base/nova-agent-watcher )