All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 3/4] fs/ext2: add option to specify a filesystem label
Date: Mon,  1 Sep 2014 15:44:34 +0200	[thread overview]
Message-ID: <022d65d9ce3bcfec00ca00deef51dd6fe4ab9636.1409579021.git.yann.morin.1998@free.fr> (raw)
In-Reply-To: <cover.1409579021.git.yann.morin.1998@free.fr>

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>
---
 fs/ext2/Config.in    | 3 +++
 fs/ext2/ext2.mk      | 4 ++++
 fs/ext2/genext2fs.sh | 9 ++++++++-
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/fs/ext2/Config.in b/fs/ext2/Config.in
index adba6f3..65828f2 100644
--- a/fs/ext2/Config.in
+++ b/fs/ext2/Config.in
@@ -42,6 +42,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
diff --git a/fs/ext2/ext2.mk b/fs/ext2/ext2.mk
index b474e43..b0eb25f 100644
--- a/fs/ext2/ext2.mk
+++ b/fs/ext2/ext2.mk
@@ -18,6 +18,10 @@ ifneq ($(strip $(BR2_TARGET_ROOTFS_EXT2_RESBLKS)),0)
 EXT2_OPTS += -m $(BR2_TARGET_ROOTFS_EXT2_RESBLKS)
 endif
 
+ifneq ($(strip $(BR2_TARGET_ROOTFS_EXT2_LABEL)),0)
+EXT2_OPTS += -L $(call qstrip,$(BR2_TARGET_ROOTFS_EXT2_LABEL))
+endif
+
 ROOTFS_EXT2_DEPENDENCIES = host-genext2fs host-e2fsprogs
 
 define ROOTFS_EXT2_CMD
diff --git a/fs/ext2/genext2fs.sh b/fs/ext2/genext2fs.sh
index f682b24..598aee2 100755
--- a/fs/ext2/genext2fs.sh
+++ b/fs/ext2/genext2fs.sh
@@ -8,6 +8,7 @@ CALC_BLOCKS=1
 CALC_INODES=1
 EXT_OPTS=
 EXT_OPTS_O=
+LABEL=
 
 # Backward compatibility
 if [ -n "${GEN}" -o -n "${REV}" ]; then
@@ -17,13 +18,14 @@ fi
 # Tell getopts to stop after all existing options,
 # and not parse the ones we add
 set -- "${@}" --
-while getopts x:d:D:b:i:N:m:g:e:zfqUPhVvG:R: f
+while getopts x:d:D:b:i:N:m:g:e:zfqUPhVvG:R:L: f
 do
     case $f in
         # The following options are specific to our wrapper,
         # so do not pass them to the real genext2fs.
         G) GEN=$OPTARG; continue ;;
         R) REV=$OPTARG; continue ;;
+        L) LABEL=$OPTARG; continue ;;
         # Any other option is recognised by the real genext2fs,
         # so we want to keep them.
         b) CALC_BLOCKS=0 ;;
@@ -133,6 +135,11 @@ if [ ${GEN} -ge 4 ]; then
     EXT_OPTS_O="${EXT_OPTS_O},extents,uninit_bg,dir_index"
 fi
 
+# Set a label if specified
+if [ -n "${LABEL}" ]; then
+    EXT_OPTS="${EXT_OPTS} -L ${LABEL}"
+fi
+
 # Add our -O options (there will be at most one leading comma, remove it)
 if [ -n "${EXT_OPTS_O}" ]; then
     EXT_OPTS="${EXT_OPTS} -O ${EXT_OPTS_O#,}"
-- 
1.9.1

  parent reply	other threads:[~2014-09-01 13:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-01 13:44 [Buildroot] [PATCH 0/4] fs/ext2: misc enhancements (branch yem/fs-vol-id) Yann E. MORIN
2014-09-01 13:44 ` [Buildroot] [PATCH 1/4] fs/ext2: enhance option parsing in our genext2fs wrapper Yann E. MORIN
2014-09-01 13:44 ` [Buildroot] [PATCH 2/4] fs/ext2: pass the ext GEN and REV as options Yann E. MORIN
2014-09-01 13:44 ` Yann E. MORIN [this message]
2014-09-01 13:44 ` [Buildroot] [PATCH 4/4] fs/ext2: add support for specifying UUID Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=022d65d9ce3bcfec00ca00deef51dd6fe4ab9636.1409579021.git.yann.morin.1998@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.