fs/ext2: add option to specify a filesystem label
authorYann E. MORIN <yann.morin.1998@free.fr>
Sat, 6 Dec 2014 22:40:06 +0000 (23:40 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 7 Dec 2014 21:07:22 +0000 (22:07 +0100)
Filesystems of the ext familly can carry a filesystem label.
Add an option for the user to specify such a label.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Károly Kasza <kaszak@gmail.com>
Tested-by: Karoly Kasza <kaszak@gmail.com>
Reviewed-by: Karoly Kasza <kaszak@gmail.com>
Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
fs/ext2/Config.in
fs/ext2/ext2.mk

index 8751b621e90ca0cd13555ffb9ac08a42e6d9ea96..5b1cd0cd98e0c20e04b279d672b429d519acd25c 100644 (file)
@@ -41,6 +41,9 @@ config BR2_TARGET_ROOTFS_EXT2_REV
        default 0   if BR2_TARGET_ROOTFS_EXT2_2r0
        default 1   if !BR2_TARGET_ROOTFS_EXT2_2r0
 
+config BR2_TARGET_ROOTFS_EXT2_LABEL
+       string "filesystem label"
+
 config BR2_TARGET_ROOTFS_EXT2_BLOCKS
        int "size in blocks (leave at 0 for auto calculation)"
        default 0
index 96b7a4a7fa22d4ec4c929ec16f8d3fe2ac460146..1cac72e0d570ec44701fe6e16f2a5e983c1d7a3a 100644 (file)
@@ -18,6 +18,14 @@ ifneq ($(strip $(BR2_TARGET_ROOTFS_EXT2_RESBLKS)),0)
 EXT2_OPTS += -r $(BR2_TARGET_ROOTFS_EXT2_RESBLKS)
 endif
 
+# Not qstrip-ing the variable, because it may contain spaces, but we must
+# qstrip it when checking. Furthermore, we need to further quote it, so
+# that the quotes do not get eaten by the echo statement when creating the
+# fakeroot script
+ifneq ($(call qstrip,$(BR2_TARGET_ROOTFS_EXT2_LABEL)),)
+EXT2_OPTS += -l '$(BR2_TARGET_ROOTFS_EXT2_LABEL)'
+endif
+
 ROOTFS_EXT2_DEPENDENCIES = host-mke2img
 
 define ROOTFS_EXT2_CMD