From 178db0c97bed1afeeb81c76ad812ad43a4faebff Mon Sep 17 00:00:00 2001 From: Xinliang Liu Date: Thu, 22 Jun 2017 14:44:40 +0800 Subject: [PATCH] Fix mkfs use wrong label option for vfat For vfat type, mkfs should use '-n' option for label. e.g.: mkfs -t vfat -n LABEL-STRING Change-Id: I1414c5b8e0aeb240c3e6884e35ba75dde677db0c --- diskimage_builder/block_device/level2/mkfs.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/diskimage_builder/block_device/level2/mkfs.py b/diskimage_builder/block_device/level2/mkfs.py index 7bebb8ca..4091d31f 100644 --- a/diskimage_builder/block_device/level2/mkfs.py +++ b/diskimage_builder/block_device/level2/mkfs.py @@ -109,7 +109,11 @@ class FilesystemNode(NodeBase): cmd.extend(['-t', self.type]) if self.opts: cmd.extend(self.opts) - cmd.extend(["-L", self.label]) + + if self.type == "vfat": + cmd.extend(["-n", self.label]) + else: + cmd.extend(["-L", self.label]) if self.type in ('ext2', 'ext3', 'ext4'): cmd.extend(['-U', self.uuid])