summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Williams <codehelp@debian.org>2015-09-13 20:57:25 +0100
committerNeil Williams <codehelp@debian.org>2015-09-13 20:57:25 +0100
commita60411308e1ceae7dd385fcaa65225d2123a07e1 (patch)
tree16ba54303a813833bbf48ee9df19768988159096
parentbdc4a21b04cb4abace81a2a54d240945b69a50cb (diff)
downloadvmdebootstrap-a60411308e1ceae7dd385fcaa65225d2123a07e1.tar.gz
Update for systemd persistent interface mask
Disable systemd persistent interface names as the actual PCI output is unknowable at the time of creating the network interface details.
-rwxr-xr-xvmdebootstrap13
-rw-r--r--vmdebootstrap.8.in6
2 files changed, 19 insertions, 0 deletions
diff --git a/vmdebootstrap b/vmdebootstrap
index 3cd526d..51c2674 100755
--- a/vmdebootstrap
+++ b/vmdebootstrap
@@ -784,6 +784,17 @@ class VmDebootstrap(cliapp.Application): # pylint: disable=too-many-public-meth
else:
logging.debug('not removing non-existent %s', pathname)
+ def mask_udev_predictable_rules(self, rootdir):
+ """
+ This can be reset later but to get networking using immediately
+ on boot, the interface we're going to use must be kno
+ http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
+ """
+ self.message('Disabling systemd predictable interface names')
+ udev_path = os.path.join(
+ 'etc', 'udev', 'rules.d', '80-net-setup-link.rules')
+ self.runcmd(['chroot', rootdir, 'ln', '-s', '/dev/null', udev_path])
+
def setup_networking(self, rootdir):
self.message('Setting up networking')
ifc_file = os.path.join(rootdir, 'etc', 'network', 'interfaces')
@@ -808,6 +819,8 @@ class VmDebootstrap(cliapp.Application): # pylint: disable=too-many-public-meth
eth.write('\n')
eth.write('auto eth0\n')
eth.write('iface eth0 inet dhcp\n')
+ # force predictable interface names
+ self.mask_udev_predictable_rules(rootdir)
def append_serial_console(self, rootdir):
if self.settings['serial-console']:
diff --git a/vmdebootstrap.8.in b/vmdebootstrap.8.in
index 19f5adc..61286ac 100644
--- a/vmdebootstrap.8.in
+++ b/vmdebootstrap.8.in
@@ -85,6 +85,12 @@ into /etc/network/interfaces.d/setup:
auto eth0
iface eth0 inet dhcp
+For systems running newer versions of systemd, the interface name needs
+to be set in advance of the first boot instead of being dependent on the
+boot itself. See the http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/
+.b vmdebootstrap
+disables this behaviour by symlinking /dev/null to /etc/udev/rules.d/80-net-setup-link.rules
+
.SH BOOTLOADERS
Unless the \-\-no\-extlinux or \-\-grub options are specified, the
image will use