mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-25 00:11:23 +02:00
Merge pull request #1953 from crawford/google-compute-daemon
app-emulation/google-compute-daemon: bump to 1.3.2
This commit is contained in:
commit
1ee0a6097c
@ -1 +1 @@
|
|||||||
DIST google-daemon-1.1.1.tar.gz 15770 SHA256 05a5be0bb4ef8b339d51c8b32dda3a8bd60b5fc9aeac453c26207443a6712703 SHA512 583f60865716fa36e2eb55a6d73137e151e8560ce7c91aa4b03de62466494e3c0e9878bc1356f03eb592df67de3bf250e970a5a9b86a6382fc3013bcc5cd7501 WHIRLPOOL 541774e01b96409f0e517f7a66a7a9d233e753280bd6a16e303baac2a00af896653a8491f4484bf753e41ad83acabd320cf7d4e9b10e5ac3b6418f583fe32770
|
DIST google-daemon-1.3.2.tar.gz 18551 SHA256 f2d9476e8fb9134e6d5774838d6dacc4bff9495f29804e2dba7fdee574248d29 SHA512 26e691227d55f85cbac853a0b07d6e7d2cc4c6722987afe243170775bb7ee6db1b904a5996c97a152d5352c2d08b856a2389cb281ee47ee3fdc49508120404dc WHIRLPOOL c43b733d63ae026f8e9895a63f2548ecddab33f7fc399f853db5180f1ead343432aa923e0e0b0fff278064ac5ad3ce4dfc7b7a064197e762fad6bc6cc49092b6
|
||||||
|
@ -1,29 +1,26 @@
|
|||||||
From dbe7826e27c8f82afbd7acf902812f4d9c8317d6 Mon Sep 17 00:00:00 2001
|
From dba9b86ed013b0520fbd731239c5d93769a6a9f4 Mon Sep 17 00:00:00 2001
|
||||||
From: Brandon Philips <brandon@ifup.co>
|
From: Alex Crawford <alex.crawford@coreos.com>
|
||||||
Date: Fri, 4 Apr 2014 12:12:00 -0700
|
Date: Tue, 10 May 2016 14:40:32 -0700
|
||||||
Subject: [PATCH] feat(accounts): add users to the sudo and docker groups by
|
Subject: [PATCH 1/3] Add users to docker group by default
|
||||||
default
|
|
||||||
|
|
||||||
On CoreOS the sudo group gets passwordless sudo. Add users to this
|
This allows users to use Docker without needing sudo.
|
||||||
group. Docker is used to provide access to gcloud tools, give users
|
|
||||||
access so docker just works for them.
|
|
||||||
---
|
---
|
||||||
google-daemon/usr/share/google/google_daemon/accounts.py | 2 +-
|
google-daemon/usr/share/google/google_daemon/accounts.py | 2 +-
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
diff --git a/google-daemon/usr/share/google/google_daemon/accounts.py b/google-daemon/usr/share/google/google_daemon/accounts.py
|
diff --git a/google-daemon/usr/share/google/google_daemon/accounts.py b/google-daemon/usr/share/google/google_daemon/accounts.py
|
||||||
index 4c572ca..ae00e1b 100755
|
index e14f5c0..31241f9 100755
|
||||||
--- a/google-daemon/usr/share/google/google_daemon/accounts.py
|
--- a/google-daemon/usr/share/google/google_daemon/accounts.py
|
||||||
+++ b/google-daemon/usr/share/google/google_daemon/accounts.py
|
+++ b/google-daemon/usr/share/google/google_daemon/accounts.py
|
||||||
@@ -76,7 +76,7 @@ class Accounts(object):
|
@@ -76,7 +76,7 @@ class Accounts(object):
|
||||||
self.urllib2 = urllib2_module
|
self.urllib2 = urllib2_module
|
||||||
|
|
||||||
self.default_user_groups = self.GroupsThatExist(
|
self.default_user_groups = self.GroupsThatExist(
|
||||||
- ['adm', 'video', 'dip', 'plugdev'])
|
- ['adm', 'video', 'dip', 'plugdev', 'sudo'])
|
||||||
+ ['adm', 'video', 'dip', 'plugdev', 'sudo', 'docker'])
|
+ ['adm', 'video', 'dip', 'plugdev', 'sudo', 'docker'])
|
||||||
|
|
||||||
def CreateUser(self, username, ssh_keys):
|
def UpdateUser(self, username, ssh_keys):
|
||||||
"""Create username on the system, with authorized ssh_keys."""
|
"""Create username on the system, with authorized ssh_keys."""
|
||||||
--
|
--
|
||||||
1.8.5.5
|
2.7.3
|
||||||
|
|
@ -1,40 +0,0 @@
|
|||||||
From 6b9c8b8ae50dd3530c80fdd26fbeef7fc9ae8dff Mon Sep 17 00:00:00 2001
|
|
||||||
From: Ferran Rodenas <frodenas@gmail.com>
|
|
||||||
Date: Tue, 18 Feb 2014 00:21:17 -0800
|
|
||||||
Subject: [PATCH] Fixes authorized_keys file permissions
|
|
||||||
|
|
||||||
Owner and group id are not inherit when calling shutil move. This commit
|
|
||||||
moves setting permissions logic for the authorized_keys file to be sure
|
|
||||||
that the final destination file has the proper permissions.
|
|
||||||
---
|
|
||||||
google-daemon/usr/share/google/google_daemon/accounts.py | 8 ++++----
|
|
||||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/google-daemon/usr/share/google/google_daemon/accounts.py b/google-daemon/usr/share/google/google_daemon/accounts.py
|
|
||||||
index 4c572ca..6f970c4 100755
|
|
||||||
--- a/google-daemon/usr/share/google/google_daemon/accounts.py
|
|
||||||
+++ b/google-daemon/usr/share/google/google_daemon/accounts.py
|
|
||||||
@@ -378,10 +378,6 @@ class Accounts(object):
|
|
||||||
user_lines = [
|
|
||||||
lines[i] for i in range(len(lines)) if i not in google_added_ixs]
|
|
||||||
|
|
||||||
- # Make sure the keys_file has the right perms (u+rw).
|
|
||||||
- self.os.fchmod(keys_file.fileno(), 0600)
|
|
||||||
- self.os.fchown(keys_file.fileno(), uid, gid)
|
|
||||||
-
|
|
||||||
# First write user's entries.
|
|
||||||
for user_line in user_lines:
|
|
||||||
keys_file.write(EnsureTrailingNewline(user_line))
|
|
||||||
@@ -394,5 +390,9 @@ class Accounts(object):
|
|
||||||
# Override the old authorized keys file with the new one.
|
|
||||||
self.system.MoveFile(new_keys_path, authorized_keys_file)
|
|
||||||
|
|
||||||
+ # Make sure the authorized_keys_file has the right perms (u+rw).
|
|
||||||
+ self.os.chmod(authorized_keys_file, 0600)
|
|
||||||
+ self.os.chown(authorized_keys_file, uid, gid)
|
|
||||||
+
|
|
||||||
# Set SELinux context, if applicable to this system
|
|
||||||
self.SetSELinuxContext(authorized_keys_file)
|
|
||||||
--
|
|
||||||
1.8.5.2 (Apple Git-48)
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
|||||||
From 0243ab89cd941f15344ef03b63c96f3f0e1ffa45 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Brandon Philips <brandon@ifup.co>
|
|
||||||
Date: Tue, 1 Apr 2014 11:51:13 -0700
|
|
||||||
Subject: [PATCH] fix(google-daemon): use * for the passwd not !
|
|
||||||
|
|
||||||
useradd defaults to using ! as the "locked" password marker.
|
|
||||||
Unfortunatly, openssh interprets this to mean that it shouldn't let the
|
|
||||||
user in via ssh if PAM is missing. Work around this by using the *
|
|
||||||
marker which also means locked but is allowed by openssh.
|
|
||||||
---
|
|
||||||
google-daemon/usr/share/google/google_daemon/utils.py | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/google-daemon/usr/share/google/google_daemon/utils.py b/google-daemon/usr/share/google/google_daemon/utils.py
|
|
||||||
index 0f17f34..371034d 100755
|
|
||||||
--- a/google-daemon/usr/share/google/google_daemon/utils.py
|
|
||||||
+++ b/google-daemon/usr/share/google/google_daemon/utils.py
|
|
||||||
@@ -69,7 +69,7 @@ class System(object):
|
|
||||||
def UserAdd(self, user, groups):
|
|
||||||
logging.info('Creating account %s', user)
|
|
||||||
result = self.RunCommand([
|
|
||||||
- '/usr/sbin/useradd', user, '-m', '-s', '/bin/bash', '-G',
|
|
||||||
+ '/usr/sbin/useradd', user, '-m', '-s', '/bin/bash', '-p', '*', '-G',
|
|
||||||
','.join(groups)])
|
|
||||||
if self.RunCommandFailed(result, 'Could not create user %s', user):
|
|
||||||
return False
|
|
||||||
--
|
|
||||||
1.8.5.2 (Apple Git-48)
|
|
||||||
|
|
@ -1,16 +1,16 @@
|
|||||||
From 265f951bc8d55bfb988050dda6332511b58e72e8 Mon Sep 17 00:00:00 2001
|
From 1eff70fe7f0083d7aee76e18c89e92fce278a57a Mon Sep 17 00:00:00 2001
|
||||||
From: Brandon Philips <brandon@ifup.co>
|
From: Alex Crawford <alex.crawford@coreos.com>
|
||||||
Date: Tue, 1 Apr 2014 15:18:20 -0700
|
Date: Tue, 10 May 2016 14:45:16 -0700
|
||||||
Subject: [PATCH] hack(address_manager): use CoreOS names and locations
|
Subject: [PATCH 2/3] Use ens4v1 instead of eth0
|
||||||
|
|
||||||
ip is in /usr/bin/ip and the network interface is ens4v1 via
|
The network interface under systemd is ens4v1
|
||||||
http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
|
(http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/).
|
||||||
---
|
---
|
||||||
.../share/google/google_daemon/address_manager.py | 24 +++++++++++-----------
|
.../share/google/google_daemon/address_manager.py | 22 +++++++++++-----------
|
||||||
1 file changed, 12 insertions(+), 12 deletions(-)
|
1 file changed, 11 insertions(+), 11 deletions(-)
|
||||||
|
|
||||||
diff --git a/google-daemon/usr/share/google/google_daemon/address_manager.py b/google-daemon/usr/share/google/google_daemon/address_manager.py
|
diff --git a/google-daemon/usr/share/google/google_daemon/address_manager.py b/google-daemon/usr/share/google/google_daemon/address_manager.py
|
||||||
index 1b3997c..568720d 100644
|
index 7a0e911..ba3be6e 100644
|
||||||
--- a/google-daemon/usr/share/google/google_daemon/address_manager.py
|
--- a/google-daemon/usr/share/google/google_daemon/address_manager.py
|
||||||
+++ b/google-daemon/usr/share/google/google_daemon/address_manager.py
|
+++ b/google-daemon/usr/share/google/google_daemon/address_manager.py
|
||||||
@@ -15,16 +15,16 @@
|
@@ -15,16 +15,16 @@
|
||||||
@ -33,18 +33,18 @@ index 1b3997c..568720d 100644
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
@@ -103,8 +103,8 @@ class AddressManager(object):
|
@@ -106,8 +106,8 @@ class AddressManager(object):
|
||||||
return self.ParseIPAddrs(addrs_data)
|
return self.ParseIPAddrs(addrs_data)
|
||||||
|
|
||||||
def ReadLocalConfiguredAddrs(self):
|
def ReadLocalConfiguredAddrs(self):
|
||||||
- """Fetch list of addresses we've configured on eth0 already."""
|
- """Fetch list of addresses we've configured on eth0 already."""
|
||||||
- cmd = ('/sbin/ip route ls table local type local dev eth0 scope host ' +
|
- cmd = ('{0} route ls table local type local dev eth0 scope host ' +
|
||||||
+ """Fetch list of addresses we've configured on ens4v1 already."""
|
+ """Fetch list of addresses we've configured on ens4v1 already."""
|
||||||
+ cmd = ('/usr/bin/ip route ls table local type local dev ens4v1 scope host ' +
|
+ cmd = ('{0} route ls table local type local dev ens4v1 scope host ' +
|
||||||
'proto %d' % GOOGLE_PROTO_ID)
|
'proto {1:d}').format(self.ip_path, GOOGLE_PROTO_ID)
|
||||||
result = self.system.RunCommand(cmd.split())
|
result = self.system.RunCommand(cmd.split())
|
||||||
if self.IPCommandFailed(result, cmd):
|
if self.IPCommandFailed(result, cmd):
|
||||||
@@ -132,27 +132,27 @@ class AddressManager(object):
|
@@ -135,27 +135,27 @@ class AddressManager(object):
|
||||||
to_remove or None))
|
to_remove or None))
|
||||||
|
|
||||||
def AddAddresses(self, to_add):
|
def AddAddresses(self, to_add):
|
||||||
@ -55,10 +55,10 @@ index 1b3997c..568720d 100644
|
|||||||
|
|
||||||
def AddOneAddress(self, addr):
|
def AddOneAddress(self, addr):
|
||||||
- """Configure one address on eth0."""
|
- """Configure one address on eth0."""
|
||||||
- cmd = '/sbin/ip route add to local %s/32 dev eth0 proto %d' % (
|
- cmd = '%s route add to local %s/32 dev eth0 proto %d' % (
|
||||||
+ """Configure one address on ens4v1."""
|
+ """Configure one address on ens4v1."""
|
||||||
+ cmd = '/usr/bin/ip route add to local %s/32 dev ens4v1 proto %d' % (
|
+ cmd = '%s route add to local %s/32 dev ens4v1 proto %d' % (
|
||||||
addr, GOOGLE_PROTO_ID)
|
self.ip_path, addr, GOOGLE_PROTO_ID)
|
||||||
result = self.system.RunCommand(cmd.split())
|
result = self.system.RunCommand(cmd.split())
|
||||||
self.IPCommandFailed(result, cmd) # Ignore return code
|
self.IPCommandFailed(result, cmd) # Ignore return code
|
||||||
|
|
||||||
@ -73,20 +73,11 @@ index 1b3997c..568720d 100644
|
|||||||
+ """Delete one address from ens4v1."""
|
+ """Delete one address from ens4v1."""
|
||||||
# This will fail if it doesn't match exactly the specs listed.
|
# This will fail if it doesn't match exactly the specs listed.
|
||||||
# That'll help ensure we don't remove one added by someone else.
|
# That'll help ensure we don't remove one added by someone else.
|
||||||
- cmd = '/sbin/ip route delete to local %s/32 dev eth0 proto %d' % (
|
- cmd = '%s route delete to local %s/32 dev eth0 proto %d' % (
|
||||||
+ cmd = '/usr/bin/ip route delete to local %s/32 dev ens4v1 proto %d' % (
|
+ cmd = '%s route delete to local %s/32 dev ens4v1 proto %d' % (
|
||||||
addr, GOOGLE_PROTO_ID)
|
self.ip_path, addr, GOOGLE_PROTO_ID)
|
||||||
result = self.system.RunCommand(cmd.split())
|
result = self.system.RunCommand(cmd.split())
|
||||||
self.IPCommandFailed(result, cmd) # Ignore return code
|
self.IPCommandFailed(result, cmd) # Ignore return code
|
||||||
@@ -168,7 +168,7 @@ class AddressManager(object):
|
|
||||||
return addrs
|
|
||||||
|
|
||||||
def IPCommandFailed(self, result, cmd):
|
|
||||||
- """If an /sbin/ip command failed, log and return True."""
|
|
||||||
+ """If an /usr/bin/ip command failed, log and return True."""
|
|
||||||
if self.system.RunCommandFailed(
|
|
||||||
result, 'Non-zero exit status from: "%s"' % cmd):
|
|
||||||
return True
|
|
||||||
--
|
--
|
||||||
1.8.5.2 (Apple Git-48)
|
2.7.3
|
||||||
|
|
@ -19,13 +19,11 @@ RDEPEND="dev-lang/python-oem"
|
|||||||
S="${WORKDIR}"
|
S="${WORKDIR}"
|
||||||
|
|
||||||
src_prepare() {
|
src_prepare() {
|
||||||
epatch "${FILESDIR}"/0001-Fixes-authorized_keys-file-permissions.patch
|
epatch "${FILESDIR}/0001-Add-users-to-docker-group-by-default.patch"
|
||||||
epatch "${FILESDIR}"/0001-fix-google-daemon-use-for-the-passwd-not.patch
|
epatch "${FILESDIR}/0002-Use-ens4v1-instead-of-eth0.patch"
|
||||||
epatch "${FILESDIR}"/0001-hack-address_manager-use-CoreOS-names-and-locations.patch
|
|
||||||
epatch "${FILESDIR}"/0001-feat-accounts-add-users-to-the-sudo-and-docker-group.patch
|
|
||||||
}
|
}
|
||||||
|
|
||||||
src_install() {
|
src_install() {
|
||||||
mkdir -p ${D}/usr/share/oem/google-compute-daemon/
|
insinto "/usr/share/oem/google-compute-daemon/"
|
||||||
cp -Ra ${WORKDIR}/usr/share/google/google_daemon/. ${D}/usr/share/oem/google-compute-daemon/ || die
|
doins -r "${S}/usr/share/google/google_daemon/."
|
||||||
}
|
}
|
@ -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
|
||||||
|
@ -0,0 +1,163 @@
|
|||||||
|
From 73c4917ef66a0be37b625f00d0c38dffe5cbc70c Mon Sep 17 00:00:00 2001
|
||||||
|
From: Alex Crawford <alex.crawford@coreos.com>
|
||||||
|
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
|
||||||
|
|
@ -1,63 +0,0 @@
|
|||||||
From 2748f99730e699b2597653ddef1c4109cae976b2 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Brandon Philips <brandon@ifup.co>
|
|
||||||
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)
|
|
||||||
|
|
@ -19,12 +19,10 @@ RDEPEND="dev-lang/python-oem"
|
|||||||
S="${WORKDIR}"
|
S="${WORKDIR}"
|
||||||
|
|
||||||
src_prepare() {
|
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() {
|
src_install() {
|
||||||
mkdir -p ${D}/usr/share/oem/google-startup-scripts/usr/share/google/
|
exeinto "/usr/share/oem/google-startup-scripts/"
|
||||||
cp -Ra ${WORKDIR}/usr/share/google/. ${D}/usr/share/oem/google-startup-scripts/ || die
|
doexe "${S}"/usr/share/google/*
|
||||||
# We don't install python or gsutil so skip this
|
|
||||||
rm -R ${D}/usr/share/oem/google-startup-scripts/boto || die
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user