TT#105151 Revert "TT#105151 Stop adding "net.ifnames=0" to grub config"

This reverts commit cd50e4934c.

In principle this works fine when using
/etc/udev/rules.d/70-persistent-net.rules, but it turns out that in the
test infrastructure (including {ce,pro,carrier}-trunk.mgm machines and
build-matrix) we remove the generated rules in many places:

  if $VAGRANT; then
    ...
    # MACs are different on buildbox and on local VirtualBox
    # see http://ablecoder.com/b/2012/04/09/vagrant-broken-networking-when-packaging-ubuntu-boxes/
    echo "Removing '${TARGET_UDEV_PERSISTENT_NET_RULES}'"
    rm -f "${TARGET_UDEV_PERSISTENT_NET_RULES:?}"

So in this way, the interfaces that we get are ens18 in our infra for
{ce,pro,carrier}-trunk.mgm machines, and so the generated
/etc/network/interfaces usint the fixed names "eth*" (in process to be
renamed "neth*") cannot be found in those systems, and all
build-install-vm jobs fail.

In a local vagrant machine (ce-trunk from just before the change) we
have names like these for the network devices:

  root@spce:~# dmesg | grep rename
  [    2.051263] e1000 0000:00:09.0 enp0s9: renamed from eth1
  [    2.065876] e1000 0000:00:03.0 enp0s3: renamed from eth0
  [    3.950540] e1000 0000:00:03.0 eth0: renamed from enp0s3
  [    4.049842] e1000 0000:00:09.0 eth1: renamed from enp0s9

In this boot session from which the logs above are taken, was booted
with grub without "net.ifnames=0", and udev "70-persistent-net.rules"
generated in place with the right infromation, and then of course things
work fine.

So we need some solution this before moving on with the change now
reverted.

Change-Id: I25d3b9c175b92214670ebb63a7916b60e0e4e5f9
mr9.5.1
Manuel Montecelo 5 years ago
parent cd50e4934c
commit ab62171c49

@ -195,6 +195,19 @@ ensure_recent_package_versions() {
done
}
set_custom_grub_boot_options() {
echo "Adjusting default GRUB boot options (enabling net.ifnames=0)"
sed -i '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"
grml-chroot "${TARGET}" etckeeper commit "/etc/default/grub changes"
fi
}
die() {
echo "$@" >&2
set_deploy_status "error"
@ -2220,6 +2233,8 @@ EOT
grml-chroot "${TARGET}" /bin/bash /tmp/retrieve_authorized_keys.sh
fi
set_custom_grub_boot_options
if "$VAGRANT" ; then
echo "Bootoption vagrant present, executing vagrant_configuration."
vagrant_configuration

Loading…
Cancel
Save