]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: Force lba off for FAT16 partitions
authorDarren Hart <dvhart@linux.intel.com>
Tue, 15 Oct 2013 21:46:23 +0000 (14:46 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 16 Oct 2013 12:26:47 +0000 (13:26 +0100)
If fat16 is specified to the mkpart parted command, parted will
default to setting the lba flag which causes certain EFI firmware
to fail to detect the filesystem. lba shouldn't be necessary for
FAT16 filesystems anyway, explicitly disable it.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Cc: Tom Zanussi <tom.zanussi@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/mic/utils/partitionedfs.py

index e8cded26e06e6207248af33cdec1c0fd04345776..59263ba1a580b6ec2682d65c29e9f06a3ebcff48 100644 (file)
@@ -352,6 +352,16 @@ class PartitionedMount(Mount):
                 self.__run_parted(["-s", d['disk'].device, "set",
                                    "%d" % p['num'], flag_name, "on"])
 
+            # Parted defaults to enabling the lba flag for fat16 partitions,
+            # which causes compatibility issues with some firmware (and really
+            # isn't necessary).
+            if parted_fs_type == "fat16":
+                if d['ptable_format'] == 'msdos':
+                    msger.debug("Disable 'lba' flag for partition '%s' on disk '%s'" % \
+                                (p['num'], d['disk'].device))
+                    self.__run_parted(["-s", d['disk'].device, "set",
+                                       "%d" % p['num'], "lba", "off"])
+
         # If the partition table format is "gpt", find out PARTUUIDs for all
         # the partitions. And if users specified custom parition type UUIDs,
         # set them.