From 934a431ae9fe15bff133c97f0c24b50d145871bb Mon Sep 17 00:00:00 2001 From: Michael Aldridge Date: Mon, 24 Jul 2017 19:55:02 -0700 Subject: [PATCH] New package: GCP-Guest-Environment-20170718 --- .../files/GCP-Guest-Initialization/run | 22 ++++++++++++++++ .../files/GCP-accounts/run | 9 +++++++ .../files/GCP-clock-skew/run | 9 +++++++ .../files/GCP-ip-forwarding/run | 9 +++++++ srcpkgs/GCP-Guest-Environment/template | 25 +++++++++++++++++++ 5 files changed, 74 insertions(+) create mode 100644 srcpkgs/GCP-Guest-Environment/files/GCP-Guest-Initialization/run create mode 100644 srcpkgs/GCP-Guest-Environment/files/GCP-accounts/run create mode 100644 srcpkgs/GCP-Guest-Environment/files/GCP-clock-skew/run create mode 100644 srcpkgs/GCP-Guest-Environment/files/GCP-ip-forwarding/run create mode 100644 srcpkgs/GCP-Guest-Environment/template diff --git a/srcpkgs/GCP-Guest-Environment/files/GCP-Guest-Initialization/run b/srcpkgs/GCP-Guest-Environment/files/GCP-Guest-Initialization/run new file mode 100644 index 00000000000..163298b9fa5 --- /dev/null +++ b/srcpkgs/GCP-Guest-Environment/files/GCP-Guest-Initialization/run @@ -0,0 +1,22 @@ +#!/bin/sh + +# The Google services assert that the init is performing some +# sequencing. Since runit provides no such facility, we will block +# all other services from launching here until we can talk to the +# metadata server. +while ! ping -c1 metadata.google.internal >/dev/null ; do + sleep 5 +done + +# This is supposed to do all kinds of setup tasks to get the machine +# ready for the next phases of startup +google_instance_setup + +# This script does a little more network setup to make sure all +# interfaces are up. We don't really need it since dhcpcd will do +# this anyway, but its nice to use the provided one. +google_network_setup + +# Both of those scripts are one-shots, so we drop privs and just sit +# here now to let the other scripts start. +exec chpst -u nobody:nogroup pause -b GCP-Guest-Initialization diff --git a/srcpkgs/GCP-Guest-Environment/files/GCP-accounts/run b/srcpkgs/GCP-Guest-Environment/files/GCP-accounts/run new file mode 100644 index 00000000000..63a6d7959c7 --- /dev/null +++ b/srcpkgs/GCP-Guest-Environment/files/GCP-accounts/run @@ -0,0 +1,9 @@ +#!/bin/sh + +sv check GCP-Guest-Initialization || exit 1 + +while ! ping -c1 metadata.google.internal >/dev/null ; do + sleep 5 +done + +exec google_accounts_daemon diff --git a/srcpkgs/GCP-Guest-Environment/files/GCP-clock-skew/run b/srcpkgs/GCP-Guest-Environment/files/GCP-clock-skew/run new file mode 100644 index 00000000000..c70f4ce8ab3 --- /dev/null +++ b/srcpkgs/GCP-Guest-Environment/files/GCP-clock-skew/run @@ -0,0 +1,9 @@ +#!/bin/sh + +sv check GCP-Guest-Initialization || exit 1 + +while ! ping -c1 metadata.google.internal >/dev/null ; do + sleep 5 +done + +exec google_clock_skew_daemon diff --git a/srcpkgs/GCP-Guest-Environment/files/GCP-ip-forwarding/run b/srcpkgs/GCP-Guest-Environment/files/GCP-ip-forwarding/run new file mode 100644 index 00000000000..fc5f5671b21 --- /dev/null +++ b/srcpkgs/GCP-Guest-Environment/files/GCP-ip-forwarding/run @@ -0,0 +1,9 @@ +#!/bin/sh + +sv check GCP-Guest-Initialization || exit 1 + +while ! ping -c1 metadata.google.internal >/dev/null ; do + sleep 5 +done + +exec google_ip_forwarding_daemon diff --git a/srcpkgs/GCP-Guest-Environment/template b/srcpkgs/GCP-Guest-Environment/template new file mode 100644 index 00000000000..56a9355e4b3 --- /dev/null +++ b/srcpkgs/GCP-Guest-Environment/template @@ -0,0 +1,25 @@ +# Template file for 'GCP-Guest-Environment' +pkgname=GCP-Guest-Environment +version=20170718 +revision=1 +wrksrc=compute-image-packages-$version +noarch=yes +build_style=python2-module +hostmakedepends="python python-setuptools" +depends="$hostmakedepends python-boto socklog-void" +short_desc="Packages for Google Compute Engine Linux images" +# Though I work for Google, this package is not officially recognized +# or maintained by Google. I maintain this on a best effort basis +# when I have free time. I use my work email for this only because it +# makes a little more sense to me than my VoidLinux email. +maintainer="Michael Aldridge " +license="Apache-2" +homepage="https://github.com/GoogleCloudPlatform/compute-image-packages" +distfiles="https://github.com/GoogleCloudPlatform/compute-image-packages/archive/$version.tar.gz" +checksum=c161a4d5a86e40be981bcb3a31aeb3bf9995b96d8302ef800a0251b17f72b254 + +post_install() { + for _i in Guest-Initialization accounts clock-skew ip-forwarding ; do + vsv GCP-$_i; + done +}