summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorNeil Williams <codehelp@debian.org>2016-03-14 19:40:56 +0000
committerNeil Williams <codehelp@debian.org>2016-03-14 19:42:13 +0000
commit3d683971875f4b9fbc98fa03148aa37b3e4fd820 (patch)
treee4bde21c6bf88cf871b365b61fbee26dcad6a868 /bin
parentb5fcad38d623d2a5f6bc0b36d53d2d7b3dbf9f83 (diff)
downloadvmdebootstrap-3d683971875f4b9fbc98fa03148aa37b3e4fd820.tar.gz
Add support for user-specific bootflagsvmdebootstrap-1.5
(Only for the first partition).
Diffstat (limited to 'bin')
-rwxr-xr-xbin/vmdebootstrap7
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/vmdebootstrap b/bin/vmdebootstrap
index 81cc7bf..00c77f8 100755
--- a/bin/vmdebootstrap
+++ b/bin/vmdebootstrap
@@ -74,6 +74,7 @@ class VmDebootstrap(cliapp.Application): # pylint: disable=too-many-public-meth
self.settings.bytesize(['bootsize'], 'create boot partition of size '
'SIZE (%default)', metavar='BOOTSIZE', default='0%')
self.settings.string(['boottype'], 'specify file system type for /boot/', default='ext2')
+ self.settings.string(['bootflag'], 'specify flag to set for /boot/', default='')
self.settings.bytesize(['bootoffset'], 'Space to leave at start of the '
'image for bootloader', default='0')
self.settings.boolean(['use-uefi'], 'Setup image for UEFI boot', default=False)
@@ -227,6 +228,12 @@ class VmDebootstrap(cliapp.Application): # pylint: disable=too-many-public-meth
os.mkdir(self.bootdir)
self.mount(bootdev, self.bootdir)
+ # set user-specified flags, e.g. lba
+ if self.settings['bootflag']:
+ base.message("Setting '%s' flag on first partition." % self.settings['bootflag'])
+ runcmd(['parted', '-s', self.settings['image'],
+ 'set', '1', self.settings['bootflag'], 'on'])
+
def _image_operations(self, rootdir, rootdev):
if not self.settings['image']:
return