diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/google-startup-scripts/Manifest b/sdk_container/src/third_party/coreos-overlay/app-emulation/google-startup-scripts/Manifest index abbd981714..fd682a9a9b 100644 --- a/sdk_container/src/third_party/coreos-overlay/app-emulation/google-startup-scripts/Manifest +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/google-startup-scripts/Manifest @@ -1 +1 @@ -DIST google-startup-scripts-1.1.1.tar.gz 12852 SHA256 33739257421ef2cc3d1170ae84540215e739160d9395f9a72e166401fa64086f SHA512 7f69c1c7ed260c42b31c789b1a0e684e58b52f126b691c68105b5ebe6c96f2e4a694c9c773d3e89f5c768a5a62e4d30e8b20220c2be372ac1e4f5983cc543bd1 WHIRLPOOL 1d0164bfeac0b20f40e183f7bb48f1f374c39de608ab5060801f914b2543a28b69b2315c39ae926bf9a5902afdcf5f3a67eb093ca2ce09fe9dfd4db0eee7e820 +DIST google-startup-scripts-1.3.2.tar.gz 15750 SHA256 e26f70714d9bfc8feba83d44c0881b2c10f54a594bc206e77c03c2f0611a5f39 SHA512 f5c2d4bca4030426dbec9103c0b53cb8c166645ae0d6926bfc318112c6b14743dd2df8834cd35e5f5eb73a4862b709deda50e95018250abf069cac52ec436217 WHIRLPOOL a09f4b169e87301f23688d2404d12e546d19930e87894c79bf5f5253ebc05ed796d49ab3dfe8233de50797ec50afbb0ffc935c881f0f00f975363e5a4189592e diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/google-startup-scripts/files/0001-Allow-location-of-startup-scripts-to-be-overridden.patch b/sdk_container/src/third_party/coreos-overlay/app-emulation/google-startup-scripts/files/0001-Allow-location-of-startup-scripts-to-be-overridden.patch new file mode 100644 index 0000000000..9f952683c2 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/google-startup-scripts/files/0001-Allow-location-of-startup-scripts-to-be-overridden.patch @@ -0,0 +1,163 @@ +From 73c4917ef66a0be37b625f00d0c38dffe5cbc70c Mon Sep 17 00:00:00 2001 +From: Alex Crawford +Date: Thu, 12 May 2016 14:28:01 -0700 +Subject: [PATCH] Allow location of startup scripts to be overridden + +--- + google-startup-scripts/usr/share/google/fetch_script | 3 ++- + google-startup-scripts/usr/share/google/first-boot | 7 ++++--- + google-startup-scripts/usr/share/google/onboot | 19 ++++++++++--------- + .../usr/share/google/run-shutdown-scripts | 5 +++-- + .../usr/share/google/run-startup-scripts | 5 +++-- + 5 files changed, 22 insertions(+), 17 deletions(-) + +diff --git a/google-startup-scripts/usr/share/google/fetch_script b/google-startup-scripts/usr/share/google/fetch_script +index 72ba9ac..2946a71 100755 +--- a/google-startup-scripts/usr/share/google/fetch_script ++++ b/google-startup-scripts/usr/share/google/fetch_script +@@ -24,6 +24,7 @@ fi + + declare -r CURL_RETRY_LIMIT=10 + declare -r CURL_TIMEOUT=10 ++declare -r SCRIPTS_PREFIX=${GOOGLE_SCRIPTS_PREFIX:-/usr/share/google/} + + function log() { + echo "$@" | ${LOGGER} -t google -p daemon.info +@@ -109,7 +110,7 @@ function download_url() { + + function get_metadata_attribute() { + local readonly varname=$1 +- /usr/share/google/get_metadata_value "attributes/${varname}" ++ ${SCRIPTS_PREFIX}/get_metadata_value "attributes/${varname}" + return $? + } + +diff --git a/google-startup-scripts/usr/share/google/first-boot b/google-startup-scripts/usr/share/google/first-boot +index b346b65..836857d 100755 +--- a/google-startup-scripts/usr/share/google/first-boot ++++ b/google-startup-scripts/usr/share/google/first-boot +@@ -17,6 +17,7 @@ + + declare -r INSTANCE_FILE=${PREFIX}/var/lib/google/vm-instance-id + declare -r LOCK_FILE=${INSTANCE_FILE}.lock ++declare -r SCRIPTS_PREFIX=${GOOGLE_SCRIPTS_PREFIX:-/usr/share/google/} + + mkdir -p ${PREFIX}/var/lib/google/per-instance + +@@ -29,7 +30,7 @@ function log() { + } + + function get_instance_id() { +- ${PREFIX}/usr/share/google/get_metadata_value id 2>/dev/null ++ ${PREFIX}/${SCRIPTS_PREFIX}/get_metadata_value id 2>/dev/null + } + + # Checks the instance id has changed. +@@ -71,8 +72,8 @@ function manage_stored_instance_id() { + log "Running first-boot" + + # Regenerate host keys for ssh. +- if [[ -x ${PREFIX}/usr/share/google/regenerate-host-keys ]]; then +- ${PREFIX}/usr/share/google/regenerate-host-keys ++ if [[ -x ${PREFIX}/${SCRIPTS_PREFIX}/regenerate-host-keys ]]; then ++ ${PREFIX}/${SCRIPTS_PREFIX}/regenerate-host-keys + fi + + # We are booting this instance for the first time. +diff --git a/google-startup-scripts/usr/share/google/onboot b/google-startup-scripts/usr/share/google/onboot +index 482d384..a3df445 100755 +--- a/google-startup-scripts/usr/share/google/onboot ++++ b/google-startup-scripts/usr/share/google/onboot +@@ -33,7 +33,8 @@ else + declare -r LOGGER=/bin/logger + fi + +-declare -r BOTO_SETUP_SCRIPT=/usr/share/google/boto/boot_setup.py ++declare -r SCRIPTS_PREFIX=${GOOGLE_SCRIPTS_PREFIX:-/usr/share/google/} ++declare -r BOTO_SETUP_SCRIPT=${SCRIPTS_PREFIX}/boto/boot_setup.py + declare -r GOOGLE_ENVIRONMENT=/var/run/google.environment + + function log() { +@@ -42,26 +43,26 @@ function log() { + } + + function set_interrupts() { +- if [[ -x /usr/share/google/set-interrupts ]]; then +- /usr/share/google/set-interrupts ++ if [[ -x ${SCRIPTS_PREFIX}/set-interrupts ]]; then ++ ${SCRIPTS_PREFIX}/set-interrupts + fi + } + + function virtionet_irq_affinity() { +- if [[ -x /usr/share/google/virtionet-irq-affinity ]]; then +- /usr/share/google/virtionet-irq-affinity ++ if [[ -x ${SCRIPTS_PREFIX}/virtionet-irq-affinity ]]; then ++ ${SCRIPTS_PREFIX}/virtionet-irq-affinity + fi + } + + function first_boot() { +- if [[ -x /usr/share/google/first-boot ]]; then +- /usr/share/google/first-boot ++ if [[ -x ${SCRIPTS_PREFIX}/first-boot ]]; then ++ ${SCRIPTS_PREFIX}/first-boot + fi + } + + function get_metadata_value() { + local readonly varname=$1 +- /usr/share/google/get_metadata_value ${varname} ++ ${SCRIPTS_PREFIX}/get_metadata_value ${varname} + return $? + } + +@@ -119,7 +120,7 @@ function check_for_connection() { + log "Checking for metadata server connection." + while true; do + ((count++)) +- MDS_TRIES=1 /usr/share/google/get_metadata_value "?recursive=True" ++ MDS_TRIES=1 ${SCRIPTS_PREFIX}/get_metadata_value "?recursive=True" + return_code=$? + case ${return_code} in + # No error. Connection is active. +diff --git a/google-startup-scripts/usr/share/google/run-shutdown-scripts b/google-startup-scripts/usr/share/google/run-shutdown-scripts +index 61377e9..b81f49b 100755 +--- a/google-startup-scripts/usr/share/google/run-shutdown-scripts ++++ b/google-startup-scripts/usr/share/google/run-shutdown-scripts +@@ -20,6 +20,7 @@ + PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin + + declare -r SHUTDOWN_SCRIPT=/var/run/google.shutdown.script ++declare -r SCRIPTS_PREFIX=${GOOGLE_SCRIPTS_PREFIX:-/usr/share/google/} + + # NOTE + # Make sure that the shutdown script completes within 90 seconds, so +@@ -27,5 +28,5 @@ declare -r SHUTDOWN_SCRIPT=/var/run/google.shutdown.script + # buffers to disk. + # + # The shutdown script blocks other shutdown operations from proceeding. +-/usr/share/google/fetch_script ${SHUTDOWN_SCRIPT} shutdown +-/usr/share/google/run-scripts ${SHUTDOWN_SCRIPT} shutdown ++${SCRIPTS_PREFIX}/fetch_script ${SHUTDOWN_SCRIPT} shutdown ++${SCRIPTS_PREFIX}/run-scripts ${SHUTDOWN_SCRIPT} shutdown +diff --git a/google-startup-scripts/usr/share/google/run-startup-scripts b/google-startup-scripts/usr/share/google/run-startup-scripts +index b9e2667..c9afddf 100755 +--- a/google-startup-scripts/usr/share/google/run-startup-scripts ++++ b/google-startup-scripts/usr/share/google/run-startup-scripts +@@ -19,9 +19,10 @@ + PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin + + declare -r STARTUP_SCRIPT=/var/run/google.startup.script ++declare -r SCRIPTS_PREFIX=${GOOGLE_SCRIPTS_PREFIX:-/usr/share/google/} + + # Make sure all udev changes settle before running startup scripts. + udevadm settle + +-/usr/share/google/fetch_script ${STARTUP_SCRIPT} startup +-/usr/share/google/run-scripts ${STARTUP_SCRIPT} startup ++${SCRIPTS_PREFIX}/fetch_script ${STARTUP_SCRIPT} startup ++${SCRIPTS_PREFIX}/run-scripts ${STARTUP_SCRIPT} startup +-- +2.7.3 + diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/google-startup-scripts/files/0001-fix-google-startup-scripts-use-GOOGLE_STARTUP_SCRIPT.patch b/sdk_container/src/third_party/coreos-overlay/app-emulation/google-startup-scripts/files/0001-fix-google-startup-scripts-use-GOOGLE_STARTUP_SCRIPT.patch deleted file mode 100644 index 8ed5827817..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/app-emulation/google-startup-scripts/files/0001-fix-google-startup-scripts-use-GOOGLE_STARTUP_SCRIPT.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 2748f99730e699b2597653ddef1c4109cae976b2 Mon Sep 17 00:00:00 2001 -From: Brandon Philips -Date: Tue, 1 Apr 2014 16:35:28 -0700 -Subject: [PATCH] fix(google-startup-scripts): use - ${GOOGLE_STARTUP_SCRIPTS_PREFIX} in onboot - -We can't install these scripts into /usr/share/google. So, take a PREFIX -environment variable. ---- - google-startup-scripts/usr/share/google/onboot | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/google-startup-scripts/usr/share/google/onboot b/google-startup-scripts/usr/share/google/onboot -index d740d07..f65b5ab 100755 ---- a/google-startup-scripts/usr/share/google/onboot -+++ b/google-startup-scripts/usr/share/google/onboot -@@ -33,7 +33,7 @@ else - declare -r LOGGER=/bin/logger - fi - --declare -r BOTO_SETUP_SCRIPT=/usr/share/google/boto/boot_setup.py -+declare -r BOTO_SETUP_SCRIPT=${GOOGLE_STARTUP_SCRIPTS_PREFIX}/boto/boot_setup.py - - declare -r CURL_RETRY_LIMIT=10 - declare -r CURL_TIMEOUT=10 -@@ -105,13 +105,13 @@ function download_url() { - - function get_metadata_value() { - local readonly varname=$1 -- /usr/share/google/get_metadata_value ${varname} -+ ${GOOGLE_STARTUP_SCRIPTS_PREFIX}/get_metadata_value ${varname} - return $? - } - - function get_metadata_attribute() { - local readonly varname=$1 -- /usr/share/google/get_metadata_value "attributes/${varname}" -+ ${GOOGLE_STARTUP_SCRIPTS_PREFIX}/get_metadata_value "attributes/${varname}" - return $? - } - -@@ -129,14 +129,14 @@ function run_command_with_retry() { - } - - function first_boot() { -- if [[ -x /usr/share/google/first-boot ]]; then -- /usr/share/google/first-boot -+ if [[ -x ${GOOGLE_STARTUP_SCRIPTS_PREFIX}/first-boot ]]; then -+ ${GOOGLE_STARTUP_SCRIPTS_PREFIX}/first-boot - fi - } - - function virtionet_irq_affinity() { -- if [[ -x /usr/share/google/virtionet-irq-affinity ]]; then -- /usr/share/google/virtionet-irq-affinity -+ if [[ -x ${GOOGLE_STARTUP_SCRIPTS_PREFIX}/virtionet-irq-affinity ]]; then -+ ${GOOGLE_STARTUP_SCRIPTS_PREFIX}/virtionet-irq-affinity - fi - } - --- -1.8.5.2 (Apple Git-48) - diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/google-startup-scripts/google-startup-scripts-1.1.1-r3.ebuild b/sdk_container/src/third_party/coreos-overlay/app-emulation/google-startup-scripts/google-startup-scripts-1.3.2.ebuild similarity index 59% rename from sdk_container/src/third_party/coreos-overlay/app-emulation/google-startup-scripts/google-startup-scripts-1.1.1-r3.ebuild rename to sdk_container/src/third_party/coreos-overlay/app-emulation/google-startup-scripts/google-startup-scripts-1.3.2.ebuild index faa76ad563..621700a224 100644 --- a/sdk_container/src/third_party/coreos-overlay/app-emulation/google-startup-scripts/google-startup-scripts-1.1.1-r3.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/google-startup-scripts/google-startup-scripts-1.3.2.ebuild @@ -19,12 +19,10 @@ RDEPEND="dev-lang/python-oem" S="${WORKDIR}" src_prepare() { - epatch "${FILESDIR}"/0001-fix-google-startup-scripts-use-GOOGLE_STARTUP_SCRIPT.patch + epatch "${FILESDIR}/0001-Allow-location-of-startup-scripts-to-be-overridden.patch" } src_install() { - mkdir -p ${D}/usr/share/oem/google-startup-scripts/usr/share/google/ - cp -Ra ${WORKDIR}/usr/share/google/. ${D}/usr/share/oem/google-startup-scripts/ || die - # We don't install python or gsutil so skip this - rm -R ${D}/usr/share/oem/google-startup-scripts/boto || die + exeinto "/usr/share/oem/google-startup-scripts/" + doexe "${S}"/usr/share/google/* }