summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Williams <codehelp@debian.org>2016-03-13 14:51:47 +0000
committerNeil Williams <codehelp@debian.org>2016-03-13 14:51:47 +0000
commit615f75d32eace577bf73c8dc14813db6aae338a7 (patch)
tree97a24cf1a79b0a2cc7ee682492e9af9cb7b03fd7
parent203b88e8950ddb9ebc7d3adb70d869f8574c7a42 (diff)
downloadvmdebootstrap-615f75d32eace577bf73c8dc14813db6aae338a7.tar.gz
Create boot partition with proper fs type
- All Linux filesystems should take the type 'Linux' for which the argument to parted is 'ext2'. - vfat and msdos file systems should have 'fat16' or 'fat32' type. Choose 'fat16' which is the earlier default. Sunil Mohan Adapa <sunil@medhas.org> Bug: #815256
-rwxr-xr-xbin/vmdebootstrap6
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/vmdebootstrap b/bin/vmdebootstrap
index 2971260..b65a282 100755
--- a/bin/vmdebootstrap
+++ b/bin/vmdebootstrap
@@ -370,6 +370,9 @@ class VmDebootstrap(cliapp.Application): # pylint: disable=too-many-public-meth
# /boot creation - move into base but keep the check
# needs extent, partoffset, bootsize: no return
if self.settings['bootsize'] and self.settings['bootsize'] is not '0%':
+ boot_fs_type = 'ext2'
+ if self.settings['boottype'] in ('vfat', 'msdos'):
+ boot_fs_type = 'fat16'
if self.settings['grub'] and not partoffset:
partoffset = 1
bootsize = self.settings['bootsize'] / (1024 * 1024)
@@ -377,7 +380,8 @@ class VmDebootstrap(cliapp.Application): # pylint: disable=too-many-public-meth
base.message("Using bootsize %smib: %s bytes" % (bootsize, self.settings['bootsize']))
logging.debug("Starting boot partition at %sMB", bootsize)
runcmd(['parted', '-s', self.settings['image'],
- 'mkpart', 'primary', 'fat16', str(partoffset), str(bootsize)])
+ 'mkpart', 'primary', boot_fs_type, str(partoffset),
+ str(bootsize)])
logging.debug("Starting root partition at %sMB", partoffset)
runcmd(['parted', '-s', self.settings['image'],
'mkpart', 'primary', str(bootsize), extent])