TT#12206 Set custom boot option "net.ifnames=0" in GRUB in Vagrant boxes

We need to disable consistent network device naming to get our
"eth0" back, otherwise we have "random" interface names (which
are stable across reboots in the same environment, but aren't
really predictable by their names).

See
https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
for more information.

Until we've full support for the new interface names let's
disable this feature in our Vagrant environments.

Change-Id: I0f141e585456d64ee7eba7b7e78af938be26bfc2
changes/11/11711/3
Michael Prokop 8 years ago
parent 6aa501a41c
commit d539011b8d

@ -262,6 +262,19 @@ install_vbox_iso() {
echo "${vbox_checksum} ${vbox_isofile}" | sha256sum --check || die "Error: failed to compute checksum for Virtualbox ISO. Exiting."
}
set_custom_grub_boot_options() {
echo "Adjusting default GRUB boot options (enabling net.ifnames=0)"
sed -ie 's/^GRUB_CMDLINE_LINUX_DEFAULT="\(.*\)"/GRUB_CMDLINE_LINUX_DEFAULT="\1 net.ifnames=0"/' "${TARGET}/etc/default/grub"
echo "Invoking update-grub"
grml-chroot $TARGET update-grub
if [ -d "${TARGET}/etc/.git" ]; then
echo "Commit /etc/default/grub changes using etckeeper"
chroot "$TARGET" etckeeper commit "/etc/default/grub changes"
fi
}
ensure_augtool_present() {
if [ -x /usr/bin/augtool ] ; then
echo "/usr/bin/augtool is present, nothing to do"
@ -1774,6 +1787,12 @@ EOT
fi
case "$DEBIAN_RELEASE" in
stretch)
set_custom_grub_boot_options
;;
esac
if "$CARRIER_EDITION" ; then
echo "Nothing to do on Carrier, /etc/network/interfaces was already set up."
elif ! "$NGCP_INSTALLER" ; then

Loading…
Cancel
Save