From fa505bfb78994b9ee7b7b2e26e6b89753141afce Mon Sep 17 00:00:00 2001 From: Don Penney Date: Thu, 23 May 2019 12:40:00 -0400 Subject: [PATCH] Set ONBOOT=yes for NICs on install from USB Update the ifcfg file for all network devices in a %post in the USB kickstart to set ONBOOT=yes. This allows network interfaces to attempt DHCP after initial installation, in order to automatically be enabled and accessible (depending on network configuration). Change-Id: Icaabcd2111e44a5bf2326aee0267b775af95933e Closes-Bug: 1830035 Signed-off-by: Don Penney --- bsp-files/kickstarts/post_usb_controller.cfg | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/bsp-files/kickstarts/post_usb_controller.cfg b/bsp-files/kickstarts/post_usb_controller.cfg index 201208f3..0681ed08 100644 --- a/bsp-files/kickstarts/post_usb_controller.cfg +++ b/bsp-files/kickstarts/post_usb_controller.cfg @@ -82,3 +82,19 @@ INSTALL_UUID=`uuidgen` echo $INSTALL_UUID > /mnt/sysimage/www/pages/feed/rel-xxxPLATFORM_RELEASExxx/install_uuid echo "INSTALL_UUID=$INSTALL_UUID" >> /mnt/sysimage/etc/platform/platform.conf %end + +%post + +# This is a USB install, so set ONBOOT=yes for network devices. +# Doing this in the %post so we don't unintentionally setup a +# network device during the installation. +for f in /etc/sysconfig/network-scripts/ifcfg-*; do + if grep -q '^ONBOOT=' ${f}; then + sed -i 's/^ONBOOT=.*/ONBOOT=yes/' ${f} + else + echo "ONBOOT=yes" >> ${f} + fi +done + +%end +