Package: vmdebootstrap Version: 1.4-1 Severity: normal Tags: patch -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
When --bootsize and --boottype arguments are passed, the boot partition's file system type in the partition table is always set to fat16. This is not a problem for any tool that I care about as filesystem type is determined by looking at the contents of the partition instead of partition table. It is, however, a nice thing to set the proper file system type in paritition type. The attached patch proposes to default to 'Linux' as type and only use 'fat16' when 'vfat' or 'msdos' are specified as boot partition file system type. - -- System Information: Debian Release: stretch/sid APT prefers unstable APT policy: (500, 'unstable') Architecture: amd64 (x86_64) Foreign Architectures: i386, armhf Kernel: Linux 4.3.0-1-amd64 (SMP w/4 CPU cores) Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages vmdebootstrap depends on: ii debootstrap 1.0.78+nmu1 ii extlinux 3:6.03+dfsg-11 ii kpartx 0.5.0+git1.656f8865-4 ii libjs-sphinxdoc 1.3.5-1 ii mbr 1.1.11-5+b1 ii parted 3.2-15 ii python-cliapp 1.20160109-1 ii python-distro-info 0.14 ii python2.7 2.7.11-3 pn python:any <none> ii qemu-utils 1:2.5+dfsg-5 Versions of packages vmdebootstrap recommends: ii grub2-common 2.02~beta2-36 ii python-guestfs 1:1.32.2-3 ii qemu-system 1:2.5+dfsg-5 ii qemu-user-static 1:2.5+dfsg-5 ii squashfs-tools 1:4.3-3 Versions of packages vmdebootstrap suggests: ii cmdtest 0.22-1 ii pandoc 1.15.1.1~dfsg-2+b3 pn u-boot:armhf <none> - -- no debconf information -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWyGaEAAoJEDbDYUQMm8lxCygP/2FsAkKtHZYoOHsK0z0khVqR BXvBhXWcibQLcJ74pB0xwCvFlGG9fKXKdwPuznNGADved8buAdxA6ozLG4OdBMWn vtnmez0WycoOfRknU0ogtVtiUU6bpCTnOZHVT17ouvDkHCHix8XF/8TKZbnPgGX7 mxqjEu2Ec7Kwj750b7FmnvTc/9EFx59saqc6IaP+kjcl6b3SQW6kkcW/BzHVV6oc 1/Xgoqhfk3dvzOE3bz5Sr9GC57tcfLZvJiYAtVg94Ao9vJIF53Dd+64m27/8kLaz K1bS2eGCR9ijUXxJYSg6FE/3+EWJyuZDEIBI7dUY9E/QZCn4cT2pWk7mjiU9Vjx8 TgKobDxclTDHfAT5x17VWsOs+s/9g6HEtYP1hk/QWEWUORly6NnihrRMaFDYYQOr DSb9bHIaPfNXgFOUZlP0a9C5LXnHYMT8xffFcH2MCJw6RVmck3OG3VO1BOa//O/O vRagEwxMBLQJF0VAx7gJqoc+SLBxGAdq5C/P/XXczWXNbywkG4bavBmo7nyzXAuR bsZcjoecGxy8bh15YTk5u0HAD9l7Qr9qLN4Ygm3oaM7BjNzJsD4yUevdXSD8Y5/E T+J2pnnPNoYpKpw4t/0EydWnJGy7F0sgzVSYG832NS1jMK6bBAvjeF7zDmDbitLU ZiB66IS7xv13md3FGHvw =pJI9 -----END PGP SIGNATURE-----
>From 3dd4f061b4117a89f235c843ff0e729f8317a2cf Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa <su...@medhas.org> Date: Sat, 20 Feb 2016 18:27:41 +0530 Subject: [PATCH 3/3] 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. --- bin/vmdebootstrap | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/vmdebootstrap b/bin/vmdebootstrap index 3016945..9eb1f86 100755 --- a/bin/vmdebootstrap +++ b/bin/vmdebootstrap @@ -373,6 +373,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) @@ -380,7 +383,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]) -- 2.7.0