summaryrefslogtreecommitdiff
path: root/vmdebootstrap
diff options
context:
space:
mode:
authorNeil Williams <codehelp@debian.org>2014-10-16 19:52:58 +0100
committerNeil Williams <codehelp@debian.org>2014-10-16 19:52:58 +0100
commita65a39682832c1ed93e3ae66817b516ff0ec7279 (patch)
treeda8304ef8e439266801c78a7ec4d68bb53b416ea /vmdebootstrap
parentfe3a9a3f12c52e88bd48a8453b8f43174c7afcc2 (diff)
downloadvmdebootstrap-a65a39682832c1ed93e3ae66817b516ff0ec7279.tar.gz
Run update-initramfs -u after installing kernel
The kernel package can be installed with the rest of the package but ensure that the initramfs is updated after all packages are installed.
Diffstat (limited to 'vmdebootstrap')
-rwxr-xr-xvmdebootstrap16
1 files changed, 11 insertions, 5 deletions
diff --git a/vmdebootstrap b/vmdebootstrap
index fafd78a..bf82e3a 100755
--- a/vmdebootstrap
+++ b/vmdebootstrap
@@ -1,6 +1,7 @@
#!/usr/bin/python
# Copyright 2011-2013 Lars Wirzenius
# Copyright 2012 Codethink Limited
+# Copyright 2014 Neil Williams <codehelp@debian.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -26,7 +27,7 @@ import tempfile
import time
-__version__ = '0.3'
+__version__ = '0.4'
class VmDebootstrap(cliapp.Application):
@@ -53,10 +54,7 @@ class VmDebootstrap(cliapp.Application):
'set up foreign debootstrap environment using provided program (ie binfmt handler)')
self.settings.string(['variant'],
'select debootstrap variant it not using the default')
- self.settings.boolean(
- ['extlinux'],
- 'install extlinux?',
- default=True)
+ self.settings.boolean(['extlinux'], 'install extlinux?', default=True)
self.settings.string(['tarball'], "tar up the disk's contents in FILE",
metavar='FILE')
self.settings.string(['mirror'],
@@ -163,6 +161,8 @@ class VmDebootstrap(cliapp.Application):
if self.settings['configure-apt']:
self.configure_apt(rootdir)
self.customize(rootdir)
+ self.update_initramfs(rootdir)
+
if self.settings['image']:
if self.settings['grub']:
self.install_grub2(rootdev, rootdir)
@@ -250,6 +250,12 @@ class VmDebootstrap(cliapp.Application):
self.runcmd(['parted', '-s', self.settings['image'],
'set', '1', 'boot', 'on'])
+ def update_initramfs(self, rootdir):
+ cmd = os.path.join('usr', 'sbin', 'update-initramfs')
+ if os.path.exists(os.path.join(rootdir, cmd)):
+ self.message("Updating the initramfs")
+ self.runcmd(['chroot', rootdir, cmd, '-u'])
+
def install_mbr(self):
if os.path.exists("/sbin/install-mbr"):
self.message('Installing MBR')