From 0a2bd6ae4527d7dbe4d31d45dd0d90186f2d2835 Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Fri, 6 Nov 2015 09:45:29 +0000 Subject: Support alternative initramfs implementations Debian bug #801214 --- vmdebootstrap/filesystem.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'vmdebootstrap') diff --git a/vmdebootstrap/filesystem.py b/vmdebootstrap/filesystem.py index a26145c..f703f42 100644 --- a/vmdebootstrap/filesystem.py +++ b/vmdebootstrap/filesystem.py @@ -70,13 +70,14 @@ class Filesystem(Base): runcmd(["chown", "-R", self.settings["owner"], filename]) def update_initramfs(self): - rootdir = self.devices['rootdir'] - if not rootdir: + if not self.devices['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") - runcmd(['chroot', rootdir, cmd, '-u']) + runcmd([ + 'chroot', self.devices['rootdir'], 'dpkg-trigger', + '--by-package', 'vmdebootstrap', 'update-initramfs']) + runcmd([ + 'chroot', self.devices['rootdir'], + 'dpkg', '--triggers-only', '-a']) def setup_kpartx(self): bootindex = None -- cgit v1.2.1