svn commit: r366232 - releng/12.2/release/tools

Colin Percival cperciva at FreeBSD.org
Mon Sep 28 17:32:18 UTC 2020


Author: cperciva
Date: Mon Sep 28 17:32:18 2020
New Revision: 366232
URL: https://svnweb.freebsd.org/changeset/base/366232

Log:
  MFS r366028: Spawn the DHCPv6 client in EC2 instances via rtsold.
  
  Approved by:	re (gjb)
  Sponsored by:	https://www.patreon.com/cperciva

Modified:
  releng/12.2/release/tools/ec2.conf
Directory Properties:
  releng/12.2/   (props changed)

Modified: releng/12.2/release/tools/ec2.conf
==============================================================================
--- releng/12.2/release/tools/ec2.conf	Mon Sep 28 17:19:57 2020	(r366231)
+++ releng/12.2/release/tools/ec2.conf	Mon Sep 28 17:32:18 2020	(r366232)
@@ -6,7 +6,7 @@
 # Packages to install into the image we're creating.  This is a deliberately
 # minimalist set, providing only the packages necessary to bootstrap further
 # package installation as specified via EC2 user-data.
-export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs dual-dhclient-daemon ebsnvme-id"
+export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs isc-dhcp44-client ebsnvme-id"
 
 # Include the amazon-ssm-agent package in amd64 images, since some users want
 # to be able to use it on systems which are not connected to the Internet.
@@ -63,9 +63,19 @@ vm_extra_pre_umount() {
 	# via EC2 user-data.
 	echo 'firstboot_pkgs_list="awscli"' >> ${DESTDIR}/etc/rc.conf
 
-	# Enable IPv6 on all interfaces, and use DHCP on both IPv4 and IPv6.
+	# Enable IPv6 on all interfaces, and spawn DHCPv6 via rtsold
 	echo 'ipv6_activate_all_interfaces="YES"' >> ${DESTDIR}/etc/rc.conf
-	echo 'dhclient_program="/usr/local/sbin/dual-dhclient"' >> ${DESTDIR}/etc/rc.conf
+	echo 'rtsold_enable="YES"' >> ${DESTDIR}/etc/rc.conf
+	echo 'rtsold_flags="-M /usr/local/libexec/rtsold-M -a"' >> ${DESTDIR}/etc/rc.conf
+
+	# Provide a script which rtsold can use to launch DHCPv6
+	mkdir -p ${DESTDIR}/usr/local/libexec
+	cat > ${DESTDIR}/usr/local/libexec/rtsold-M <<'EOF'
+#!/bin/sh
+
+/usr/local/sbin/dhclient -6 -nw -N -cf /dev/null $1
+EOF
+	chmod 755 ${DESTDIR}/usr/local/libexec/rtsold-M
 
 	# The EC2 console is output-only, so while printing a backtrace can
 	# be useful, there's no point dropping into a debugger or waiting


More information about the svn-src-all mailing list