diff options
author | Steve Wills <swills@FreeBSD.org> | 2017-11-15 22:43:20 +0000 |
---|---|---|
committer | Steve Wills <swills@FreeBSD.org> | 2017-11-15 22:43:20 +0000 |
commit | bdb90155bbd6e16a5e951cffd0f46258425492b3 (patch) | |
tree | 7523667534087d6ff5d8eaeb14c46ab061892ada /net-mgmt/triton-guesttools | |
parent | 24914bb2ca010bb343a5afd9940417864d599337 (diff) | |
download | ports-bdb90155bbd6e16a5e951cffd0f46258425492b3.tar.gz ports-bdb90155bbd6e16a5e951cffd0f46258425492b3.zip |
net-mgmt/triton-guesttools: create port
FreeBSD guest tools to enabled compatability with SmartOS and Triton.
WWW: https://github.com/joyent/freebsd-kvm-image-builder/tree/master/triton-freebsd-guesttools
Notes
Notes:
svn path=/head/; revision=454294
Diffstat (limited to 'net-mgmt/triton-guesttools')
16 files changed, 242 insertions, 0 deletions
diff --git a/net-mgmt/triton-guesttools/Makefile b/net-mgmt/triton-guesttools/Makefile new file mode 100644 index 000000000000..7b1212cebccb --- /dev/null +++ b/net-mgmt/triton-guesttools/Makefile @@ -0,0 +1,47 @@ +# $FreeBSD$ + +PORTNAME= triton-guesttools +PORTVERSION= 0.0.0.0s2017111501 +CATEGORIES= net-mgmt + +MAINTAINER= swills@FreeBSD.org +COMMENT= FreeBSD guest tools for use with SmartOS + +RUN_DEPENDS= bash:shells/bash \ + mdata-client>0:net-mgmt/mdata-client + +USES= shebangfix +USE_GITHUB= yes +GH_ACCOUNT= joyent +GH_TAGNAME= 34c19b0 +GH_PROJECT= freebsd-kvm-image-builder + +WRKSRC_SUBDIR= triton-freebsd-guesttools +SHEBANG_FILES= ${WRKSRC}/lib/smartdc/add-network-interface \ + ${WRKSRC}/lib/smartdc/common.lib \ + ${WRKSRC}/lib/smartdc/firstboot \ + ${WRKSRC}/lib/smartdc/format-secondary-disk \ + ${WRKSRC}/lib/smartdc/get-user-data \ + ${WRKSRC}/lib/smartdc/run-operator-script \ + ${WRKSRC}/lib/smartdc/run-user-script \ + ${WRKSRC}/lib/smartdc/set-hostname \ + ${WRKSRC}/lib/smartdc/set-root-authorized-keys \ + ${WRKSRC}/lib/smartdc/set-rootpassword \ + ${WRKSRC}/lib/smartdc/triton + +post-extract: + @${RM} -r ${WRKSRC}/usr + +post-patch: + @${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},' ${WRKSRC}/etc/rc.d/triton + +do-build: + @${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},' ${WRKSRC}/etc/rc.d/triton ${WRKSRC}/lib/smartdc/* + +do-install: + ${MKDIR} ${STAGEDIR}${PREFIX}/lib ${STAGEDIR}${PREFIX}/etc/rc.d + ${INSTALL_SCRIPT} ${WRKSRC}/etc/rc.d/triton ${STAGEDIR}${PREFIX}/etc/rc.d + ( cd ${WRKSRC}/lib/ && \ + ${COPYTREE_BIN} smartdc ${STAGEDIR}${PREFIX}/lib ) + +.include <bsd.port.mk> diff --git a/net-mgmt/triton-guesttools/distinfo b/net-mgmt/triton-guesttools/distinfo new file mode 100644 index 000000000000..fabd875878b6 --- /dev/null +++ b/net-mgmt/triton-guesttools/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1510774567 +SHA256 (joyent-freebsd-kvm-image-builder-0.0.0.0s2017111501-34c19b0_GH0.tar.gz) = b901079b40c14101f7568b99d838324f2917a26105f0046b011d19cf71893b0c +SIZE (joyent-freebsd-kvm-image-builder-0.0.0.0s2017111501-34c19b0_GH0.tar.gz) = 89163 diff --git a/net-mgmt/triton-guesttools/files/patch-etc_rc.d_triton b/net-mgmt/triton-guesttools/files/patch-etc_rc.d_triton new file mode 100644 index 000000000000..fd35a573436b --- /dev/null +++ b/net-mgmt/triton-guesttools/files/patch-etc_rc.d_triton @@ -0,0 +1,22 @@ +--- etc/rc.d/triton.orig 2017-05-22 19:41:07 UTC ++++ etc/rc.d/triton +@@ -7,16 +7,18 @@ + . /etc/rc.subr + + name="triton" ++rcvar=triton_enable + + + start_cmd="${name}_start" + stop_cmd=":" + + load_rc_config $name ++: ${triton_enable:=NO} + + triton_start() + { +- /lib/smartdc/triton ++ %%PREFIX%%/lib/smartdc/triton + } + + run_rc_command "$1" diff --git a/net-mgmt/triton-guesttools/files/patch-lib_smartdc_add-network-interface b/net-mgmt/triton-guesttools/files/patch-lib_smartdc_add-network-interface new file mode 100644 index 000000000000..014c170359d6 --- /dev/null +++ b/net-mgmt/triton-guesttools/files/patch-lib_smartdc_add-network-interface @@ -0,0 +1,11 @@ +--- lib/smartdc/add-network-interface.orig 2017-05-22 19:41:07 UTC ++++ lib/smartdc/add-network-interface +@@ -4,7 +4,7 @@ + # This script checks new network interfaces for and enables via DHCP at boot. + + # load common functions and vars +-. /lib/smartdc/common.lib ++. %%PREFIX%%/lib/smartdc/common.lib + + nic_added=n + diff --git a/net-mgmt/triton-guesttools/files/patch-lib_smartdc_common.lib b/net-mgmt/triton-guesttools/files/patch-lib_smartdc_common.lib new file mode 100644 index 000000000000..3ed78b69963f --- /dev/null +++ b/net-mgmt/triton-guesttools/files/patch-lib_smartdc_common.lib @@ -0,0 +1,21 @@ +--- lib/smartdc/common.lib.orig 2017-05-22 19:41:07 UTC ++++ lib/smartdc/common.lib +@@ -3,15 +3,15 @@ + # + # Copyright (c) 2016 Joyent Inc., All rights reserved. + # +-# Common variables used by scripts in /lib/smartdc ++# Common variables used by scripts in %%PREFIX%%/lib/smartdc + + # location of binaries that functions use + LOGGER=/usr/bin/logger +-MDATA_GET='/usr/sbin/mdata-get' ++MDATA_GET='%%PREFIX%%/sbin/mdata-get' + + set -o xtrace + +-# Common functions used by scripts /lib/smartdc ++# Common functions used by scripts %%PREFIX%%/lib/smartdc + + lib_triton_fatal() { + echo "(fatal) - $0 - $@" diff --git a/net-mgmt/triton-guesttools/files/patch-lib_smartdc_firstboot b/net-mgmt/triton-guesttools/files/patch-lib_smartdc_firstboot new file mode 100644 index 000000000000..21c793c36b60 --- /dev/null +++ b/net-mgmt/triton-guesttools/files/patch-lib_smartdc_firstboot @@ -0,0 +1,23 @@ +--- lib/smartdc/firstboot.orig 2017-05-22 19:41:07 UTC ++++ lib/smartdc/firstboot +@@ -4,16 +4,16 @@ + # For scripts that should be run on first boot only + + # load common functions and vars +-. /lib/smartdc/common.lib ++. %%PREFIX%%/lib/smartdc/common.lib + + # Set root password if root_pw is set in the image manifest +-(/lib/smartdc/set-rootpassword) ++(%%PREFIX%%/lib/smartdc/set-rootpassword) + + # Format disk +-(/lib/smartdc/format-secondary-disk) ++(%%PREFIX%%/lib/smartdc/format-secondary-disk) + + # Disable firstboot once all scripts are run + lib_triton_info "Disabling firstboot" +-touch /lib/smartdc/.firstboot-complete-do-not-delete ++touch %%PREFIX%%/lib/smartdc/.firstboot-complete-do-not-delete + + exit 0 diff --git a/net-mgmt/triton-guesttools/files/patch-lib_smartdc_format-secondary-disk b/net-mgmt/triton-guesttools/files/patch-lib_smartdc_format-secondary-disk new file mode 100644 index 000000000000..d75224e19fb4 --- /dev/null +++ b/net-mgmt/triton-guesttools/files/patch-lib_smartdc_format-secondary-disk @@ -0,0 +1,11 @@ +--- lib/smartdc/format-secondary-disk.orig 2017-05-22 19:41:07 UTC ++++ lib/smartdc/format-secondary-disk +@@ -10,7 +10,7 @@ + # By default we provision the whole disk as one partition + + # load common functions and vars +-. /lib/smartdc/common.lib ++. %%PREFIX%%/lib/smartdc/common.lib + + DATADISKDEVICE='vtbd1' + GPART=/sbin/gpart diff --git a/net-mgmt/triton-guesttools/files/patch-lib_smartdc_get-user-data b/net-mgmt/triton-guesttools/files/patch-lib_smartdc_get-user-data new file mode 100644 index 000000000000..358b38c90ee0 --- /dev/null +++ b/net-mgmt/triton-guesttools/files/patch-lib_smartdc_get-user-data @@ -0,0 +1,11 @@ +--- lib/smartdc/get-user-data.orig 2017-05-22 19:41:07 UTC ++++ lib/smartdc/get-user-data +@@ -7,7 +7,7 @@ + # before script "run-user-script" + + # load common functions and vars +-. /lib/smartdc/common.lib ++. %%PREFIX%%/lib/smartdc/common.lib + + lib_triton_info "Retrieving metadata user-data" + $MDATA_GET user-data >/var/tmp/mdata-user-data.new diff --git a/net-mgmt/triton-guesttools/files/patch-lib_smartdc_run-operator-script b/net-mgmt/triton-guesttools/files/patch-lib_smartdc_run-operator-script new file mode 100644 index 000000000000..4c516cd6ae55 --- /dev/null +++ b/net-mgmt/triton-guesttools/files/patch-lib_smartdc_run-operator-script @@ -0,0 +1,11 @@ +--- lib/smartdc/run-operator-script.orig 2017-05-22 19:41:07 UTC ++++ lib/smartdc/run-operator-script +@@ -3,7 +3,7 @@ + # Copyright (c) 2016 Joyent Inc., All rights reserved. + # + +-. /lib/smartdc/common.lib ++. %%PREFIX%%/lib/smartdc/common.lib + + lib_triton_info "Retrieving metadata operator-script..." + $MDATA_GET sdc:operator-script >/var/tmp/mdata-operator-script.new diff --git a/net-mgmt/triton-guesttools/files/patch-lib_smartdc_run-user-script b/net-mgmt/triton-guesttools/files/patch-lib_smartdc_run-user-script new file mode 100644 index 000000000000..d6e62ac652a8 --- /dev/null +++ b/net-mgmt/triton-guesttools/files/patch-lib_smartdc_run-user-script @@ -0,0 +1,11 @@ +--- lib/smartdc/run-user-script.orig 2017-05-22 19:41:07 UTC ++++ lib/smartdc/run-user-script +@@ -10,7 +10,7 @@ + # This script is executed on each system boot + + # load common functions and vars +-. /lib/smartdc/common.lib ++. %%PREFIX%%/lib/smartdc/common.lib + + lib_triton_info "Retrieving metadata user-script..." + $MDATA_GET user-script >/var/tmp/mdata-user-script.new diff --git a/net-mgmt/triton-guesttools/files/patch-lib_smartdc_set-hostname b/net-mgmt/triton-guesttools/files/patch-lib_smartdc_set-hostname new file mode 100644 index 000000000000..4f7712da4516 --- /dev/null +++ b/net-mgmt/triton-guesttools/files/patch-lib_smartdc_set-hostname @@ -0,0 +1,11 @@ +--- lib/smartdc/set-hostname.orig 2017-05-22 19:41:07 UTC ++++ lib/smartdc/set-hostname +@@ -4,7 +4,7 @@ + # Set the hostname of the VM if it's not already configured by the user. + + # load common functions and vars +-. /lib/smartdc/common.lib ++. %%PREFIX%%/lib/smartdc/common.lib + + grep hostname= /etc/rc.conf &>/dev/null + if [[ $? -ne 0 ]]; then diff --git a/net-mgmt/triton-guesttools/files/patch-lib_smartdc_set-root-authorized-keys b/net-mgmt/triton-guesttools/files/patch-lib_smartdc_set-root-authorized-keys new file mode 100644 index 000000000000..78a4f577a56a --- /dev/null +++ b/net-mgmt/triton-guesttools/files/patch-lib_smartdc_set-root-authorized-keys @@ -0,0 +1,11 @@ +--- lib/smartdc/set-root-authorized-keys.orig 2017-05-22 19:41:07 UTC ++++ lib/smartdc/set-root-authorized-keys +@@ -7,7 +7,7 @@ + # By default this script is called on each boot + + # load common functions and vars +-. /lib/smartdc/common.lib ++. %%PREFIX%%/lib/smartdc/common.lib + + if [[ ! -f /root/.ssh/authorized_keys ]]; then + authorized_keys=$($MDATA_GET root_authorized_keys | awk '{ sub(/(ssh-rsa )/,"\n&"); print }' | awk '{ sub(/(ssh-dss )/,"\n&"); print }' 2>>/dev/console) diff --git a/net-mgmt/triton-guesttools/files/patch-lib_smartdc_set-rootpassword b/net-mgmt/triton-guesttools/files/patch-lib_smartdc_set-rootpassword new file mode 100644 index 000000000000..7339d3707c20 --- /dev/null +++ b/net-mgmt/triton-guesttools/files/patch-lib_smartdc_set-rootpassword @@ -0,0 +1,11 @@ +--- lib/smartdc/set-rootpassword.orig 2017-05-22 19:41:07 UTC ++++ lib/smartdc/set-rootpassword +@@ -12,7 +12,7 @@ + # /etc/master.passwd to ensure a root password is not being overwritten. + + # load common functions and vars +-. /lib/smartdc/common.lib ++. %%PREFIX%%/lib/smartdc/common.lib + + # Check /etc/master.passwd. If root pass is set, exit so we don't clobber an + # already set password. diff --git a/net-mgmt/triton-guesttools/files/patch-lib_smartdc_triton b/net-mgmt/triton-guesttools/files/patch-lib_smartdc_triton new file mode 100644 index 000000000000..6ddb02475fd7 --- /dev/null +++ b/net-mgmt/triton-guesttools/files/patch-lib_smartdc_triton @@ -0,0 +1,23 @@ +--- lib/smartdc/triton.orig 2017-05-22 19:41:07 UTC ++++ lib/smartdc/triton +@@ -13,12 +13,12 @@ export PS4='[\D{%FT%TZ}] ${BASH_SOURCE}:${LINENO}: ${F + export BASH_XTRACEFD=4 + set -o xtrace + +-(/lib/smartdc/add-network-interface) +-(/lib/smartdc/set-hostname) +-(/lib/smartdc/set-root-authorized-keys) +-if [ ! -f /lib/smartdc/.firstboot-complete-do-not-delete ] ; then +- (/lib/smartdc/firstboot) ++(%%PREFIX%%/lib/smartdc/add-network-interface) ++(%%PREFIX%%/lib/smartdc/set-hostname) ++(%%PREFIX%%/lib/smartdc/set-root-authorized-keys) ++if [ ! -f %%PREFIX%%/lib/smartdc/.firstboot-complete-do-not-delete ] ; then ++ (%%PREFIX%%/lib/smartdc/firstboot) + fi +-(/lib/smartdc/run-operator-script) +-(/lib/smartdc/get-user-data) +-(/lib/smartdc/run-user-script) ++(%%PREFIX%%/lib/smartdc/run-operator-script) ++(%%PREFIX%%/lib/smartdc/get-user-data) ++(%%PREFIX%%/lib/smartdc/run-user-script) diff --git a/net-mgmt/triton-guesttools/pkg-descr b/net-mgmt/triton-guesttools/pkg-descr new file mode 100644 index 000000000000..8042b2ee43a1 --- /dev/null +++ b/net-mgmt/triton-guesttools/pkg-descr @@ -0,0 +1,3 @@ +FreeBSD guest tools to enabled compatability with SmartOS and Triton. + +WWW: https://github.com/joyent/freebsd-kvm-image-builder/tree/master/triton-freebsd-guesttools diff --git a/net-mgmt/triton-guesttools/pkg-plist b/net-mgmt/triton-guesttools/pkg-plist new file mode 100644 index 000000000000..e941e1295fcb --- /dev/null +++ b/net-mgmt/triton-guesttools/pkg-plist @@ -0,0 +1,12 @@ +etc/rc.d/triton +lib/smartdc/add-network-interface +lib/smartdc/common.lib +lib/smartdc/firstboot +lib/smartdc/format-secondary-disk +lib/smartdc/get-user-data +lib/smartdc/run-operator-script +lib/smartdc/run-user-script +lib/smartdc/set-hostname +lib/smartdc/set-root-authorized-keys +lib/smartdc/set-rootpassword +lib/smartdc/triton |