diff options
author | Neil Williams <codehelp@debian.org> | 2015-12-31 12:59:01 +0000 |
---|---|---|
committer | Neil Williams <codehelp@debian.org> | 2015-12-31 12:59:01 +0000 |
commit | 78f8e6657ba4fef04919dad889257d7f341c035b (patch) | |
tree | 9a3f4911d0dfb0f95e6843b9a50fb16b9bc368fd /vmdebootstrap/filesystem.py | |
parent | b7c3af89b3cd5c64717f008bb5e59d15752c5725 (diff) | |
download | vmdebootstrap-78f8e6657ba4fef04919dad889257d7f341c035b.tar.gz |
Add support for systemd-networkd
When masking udev/systemd predictable network interface
names, the initramfs must be updated or the mask will not
be effective.
Add support for systemd-networkd using predictable network
interface names - can be extended using customisation scripts.
Diffstat (limited to 'vmdebootstrap/filesystem.py')
-rw-r--r-- | vmdebootstrap/filesystem.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/vmdebootstrap/filesystem.py b/vmdebootstrap/filesystem.py index 106fa56..ad7575c 100644 --- a/vmdebootstrap/filesystem.py +++ b/vmdebootstrap/filesystem.py @@ -70,11 +70,15 @@ class Filesystem(Base): runcmd(["chown", "-R", self.settings["owner"], filename]) def update_initramfs(self): + if not rootdir: + raise cliapp.AppException("rootdir not set") + if not os.path.exists( + os.path.join(rootdir, 'usr', 'sbin', 'update-initramfs')): + self.message("Error: Unable to run update-initramfs.") + return if not self.settings['no-update-initramfs']: return rootdir = self.devices['rootdir'] - if not rootdir: - raise cliapp.AppException("rootdir not set") cmd = os.path.join('usr', 'sbin', 'update-initramfs') if os.path.exists(os.path.join(str(rootdir), cmd)): self.message("Updating the initramfs") |