metal/bsp-files/kickstarts/post_usb_controller.cfg
Joseph Richard 9e388d3bc3 Set IPV6_AUTOCONF=no on initial onboot devices
This commit sets IPV6_AUTOCONF=no from the anaconda installer for
all interfaces that are enabled during the initial install.

Once the puppet manifest is applied, and it updates the networking
config scripts for the system, this will be overwritten by that config,
which disables it for all configured interfaces,

IPv6 auto-configuration is causing an issue during backup and restore,
where router advertisements are causing the default route to be deleted,
which causes the calico pod to fail to initialize.

Closes-bug: 1845707
Change-Id: I519ad0d92c66a636df0d10e79c6962296683520d
Signed-off-by: Joseph Richard <joseph.richard@windriver.com>
2019-10-15 17:35:46 -04:00

107 lines
3.1 KiB
INI

%pre --erroronfail
# Source common functions
. /tmp/ks-functions.sh
if [ -d /mnt/install/source ]; then
srcdir=/mnt/install/source
else
srcdir=/run/install/repo
fi
touch /tmp/repo-include
if [ -d ${srcdir}/patches ]; then
echo "repo --name=updates --baseurl=file://${srcdir}/patches/" > /tmp/repo-include
fi
%end
# Repository arguments from %pre
%include /tmp/repo-include
%post --erroronfail
# Source common functions
. /tmp/ks-functions.sh
mgmt_dev=none
# Persist the boot device to the platform configuration. This will get
# overwritten when config_controller is run.
echo management_interface=$mgmt_dev >> /etc/platform/platform.conf
# persist the default http port number to platform configuration. This
# will get overwritten when config_controller is run.
echo http_port=8080 >> /etc/platform/platform.conf
# Build networking scripts
cat << EOF > /etc/sysconfig/network-scripts/ifcfg-lo
DEVICE=lo
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
BROADCAST=127.255.255.255
ONBOOT=yes
IPV6_AUTOCONF=no
NAME=loopback
EOF
%end
# Note, this section is different and replaced with a wget
# if doing the initial install off the network
%post --nochroot
if [ -d /mnt/install/source ]; then
srcdir=/mnt/install/source
else
srcdir=/run/install/repo
fi
if [ -d $srcdir/Packages ] ; then
mkdir -p /mnt/sysimage/www/pages/feed/rel-xxxPLATFORM_RELEASExxx
cp -r $srcdir/Packages /mnt/sysimage/www/pages/feed/rel-xxxPLATFORM_RELEASExxx/Packages
cp -r $srcdir/repodata /mnt/sysimage/www/pages/feed/rel-xxxPLATFORM_RELEASExxx/repodata
cp $srcdir/*.cfg /mnt/sysimage/www/pages/feed/rel-xxxPLATFORM_RELEASExxx
fi
if [ -d $srcdir/patches ]; then
mkdir -p /mnt/sysimage/www/pages/updates/rel-xxxPLATFORM_RELEASExxx
cp -r $srcdir/patches/Packages /mnt/sysimage/www/pages/updates/rel-xxxPLATFORM_RELEASExxx/Packages
cp -r $srcdir/patches/repodata /mnt/sysimage/www/pages/updates/rel-xxxPLATFORM_RELEASExxx/repodata
mkdir -p /mnt/sysimage/opt/patching
cp -r $srcdir/patches/metadata /mnt/sysimage/opt/patching/metadata
mkdir -p /mnt/sysimage/opt/patching/packages/xxxPLATFORM_RELEASExxx
find /mnt/sysimage/www/pages/updates/rel-xxxPLATFORM_RELEASExxx/Packages -name '*.rpm' \
| xargs --no-run-if-empty -I files cp --preserve=all files /mnt/sysimage/opt/patching/packages/xxxPLATFORM_RELEASExxx/
fi
# Create a uuid specific to this installation
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
if grep -q '^IPV6_AUTOCONF=' ${f}; then
sed -i 's/^IPV6_AUTOCONF=.*/IPV6_AUTOCONF=no/' ${f}
else
echo "IPV6_AUTOCONF=no" >> ${f}
fi
done
%end