From f4f9107caeae362185410551e12d75c09326859d Mon Sep 17 00:00:00 2001 From: David Michael Date: Tue, 18 Oct 2016 16:09:22 -0700 Subject: [PATCH] app-emulation/google-compute-engine: use a config template The configuration template needs to be written by the service itself in the current setup. The host's /etc is mounted into the ACI to provide all of the user's system configuration and to allow the GCE scripts to make their modifications, so the template can't be included in the ACI. It can't be written to the host's /etc either, since it is read-only in the SDK when OEM packages are being installed. --- ...0930.ebuild => google-compute-engine-20160930-r1.ebuild} | 6 ------ .../coreos-oem-gce/coreos-oem-gce-0.0.1-r1.ebuild | 1 + .../coreos-base/coreos-oem-gce/files/manglefs.sh | 5 +++++ 3 files changed, 6 insertions(+), 6 deletions(-) rename sdk_container/src/third_party/coreos-overlay/app-emulation/google-compute-engine/{google-compute-engine-20160930.ebuild => google-compute-engine-20160930-r1.ebuild} (83%) create mode 120000 sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-oem-gce/coreos-oem-gce-0.0.1-r1.ebuild diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/google-compute-engine/google-compute-engine-20160930.ebuild b/sdk_container/src/third_party/coreos-overlay/app-emulation/google-compute-engine/google-compute-engine-20160930-r1.ebuild similarity index 83% rename from sdk_container/src/third_party/coreos-overlay/app-emulation/google-compute-engine/google-compute-engine-20160930.ebuild rename to sdk_container/src/third_party/coreos-overlay/app-emulation/google-compute-engine/google-compute-engine-20160930-r1.ebuild index 56092ae0d3..179bf9adbf 100644 --- a/sdk_container/src/third_party/coreos-overlay/app-emulation/google-compute-engine/google-compute-engine-20160930.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/google-compute-engine/google-compute-engine-20160930-r1.ebuild @@ -30,12 +30,6 @@ RDEPEND=" S="${WORKDIR}/compute-image-packages-${PV}" -src_prepare() { - # Don't attempt to mess with our host keys. - sed -i -e '/set_host_keys/s/true/false/i' \ - "${S}"/google_compute_engine/instance_setup/instance_config.py -} - src_compile() { (cd "${S}" && exec python setup.py build) } diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-oem-gce/coreos-oem-gce-0.0.1-r1.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-oem-gce/coreos-oem-gce-0.0.1-r1.ebuild new file mode 120000 index 0000000000..348c68c571 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-oem-gce/coreos-oem-gce-0.0.1-r1.ebuild @@ -0,0 +1 @@ +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/files/manglefs.sh b/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-oem-gce/files/manglefs.sh index cee4b02818..013b990370 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/coreos-oem-gce/files/manglefs.sh @@ -7,6 +7,11 @@ set -e 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 ] || +echo -e > /etc/default/instance_configs.cfg.template \ + '[InstanceSetup]\nset_host_keys = false' + # Run the initialization scripts. /usr/bin/google_instance_setup /usr/bin/google_network_setup