Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Nov 2017 22:43:20 +0000 (UTC)
From:      Steve Wills <swills@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r454294 - in head/net-mgmt: . triton-guesttools triton-guesttools/files
Message-ID:  <201711152243.vAFMhK7r010659@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: swills
Date: Wed Nov 15 22:43:20 2017
New Revision: 454294
URL: https://svnweb.freebsd.org/changeset/ports/454294

Log:
  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

Added:
  head/net-mgmt/triton-guesttools/
  head/net-mgmt/triton-guesttools/Makefile   (contents, props changed)
  head/net-mgmt/triton-guesttools/distinfo   (contents, props changed)
  head/net-mgmt/triton-guesttools/files/
  head/net-mgmt/triton-guesttools/files/patch-etc_rc.d_triton   (contents, props changed)
  head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_add-network-interface   (contents, props changed)
  head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_common.lib   (contents, props changed)
  head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_firstboot   (contents, props changed)
  head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_format-secondary-disk   (contents, props changed)
  head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_get-user-data   (contents, props changed)
  head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_run-operator-script   (contents, props changed)
  head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_run-user-script   (contents, props changed)
  head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_set-hostname   (contents, props changed)
  head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_set-root-authorized-keys   (contents, props changed)
  head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_set-rootpassword   (contents, props changed)
  head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_triton   (contents, props changed)
  head/net-mgmt/triton-guesttools/pkg-descr   (contents, props changed)
  head/net-mgmt/triton-guesttools/pkg-plist   (contents, props changed)
Modified:
  head/net-mgmt/Makefile

Modified: head/net-mgmt/Makefile
==============================================================================
--- head/net-mgmt/Makefile	Wed Nov 15 21:39:00 2017	(r454293)
+++ head/net-mgmt/Makefile	Wed Nov 15 22:43:20 2017	(r454294)
@@ -361,6 +361,7 @@
     SUBDIR += telegraf
     SUBDIR += tornova
     SUBDIR += torrus
+    SUBDIR += triton-guesttools
     SUBDIR += unbound_exporter
     SUBDIR += unifi5
     SUBDIR += victorops-nagios

Added: head/net-mgmt/triton-guesttools/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/triton-guesttools/Makefile	Wed Nov 15 22:43:20 2017	(r454294)
@@ -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>

Added: head/net-mgmt/triton-guesttools/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/triton-guesttools/distinfo	Wed Nov 15 22:43:20 2017	(r454294)
@@ -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

Added: head/net-mgmt/triton-guesttools/files/patch-etc_rc.d_triton
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/triton-guesttools/files/patch-etc_rc.d_triton	Wed Nov 15 22:43:20 2017	(r454294)
@@ -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"

Added: head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_add-network-interface
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_add-network-interface	Wed Nov 15 22:43:20 2017	(r454294)
@@ -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
+ 

Added: head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_common.lib
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_common.lib	Wed Nov 15 22:43:20 2017	(r454294)
@@ -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 - $@"

Added: head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_firstboot
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_firstboot	Wed Nov 15 22:43:20 2017	(r454294)
@@ -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

Added: head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_format-secondary-disk
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_format-secondary-disk	Wed Nov 15 22:43:20 2017	(r454294)
@@ -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

Added: head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_get-user-data
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_get-user-data	Wed Nov 15 22:43:20 2017	(r454294)
@@ -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

Added: head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_run-operator-script
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_run-operator-script	Wed Nov 15 22:43:20 2017	(r454294)
@@ -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

Added: head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_run-user-script
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_run-user-script	Wed Nov 15 22:43:20 2017	(r454294)
@@ -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

Added: head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_set-hostname
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_set-hostname	Wed Nov 15 22:43:20 2017	(r454294)
@@ -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

Added: head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_set-root-authorized-keys
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_set-root-authorized-keys	Wed Nov 15 22:43:20 2017	(r454294)
@@ -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)

Added: head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_set-rootpassword
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_set-rootpassword	Wed Nov 15 22:43:20 2017	(r454294)
@@ -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.

Added: head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_triton
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/triton-guesttools/files/patch-lib_smartdc_triton	Wed Nov 15 22:43:20 2017	(r454294)
@@ -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)

Added: head/net-mgmt/triton-guesttools/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/triton-guesttools/pkg-descr	Wed Nov 15 22:43:20 2017	(r454294)
@@ -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

Added: head/net-mgmt/triton-guesttools/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/triton-guesttools/pkg-plist	Wed Nov 15 22:43:20 2017	(r454294)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711152243.vAFMhK7r010659>