mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Ian Abbott <abbotti@mev.co.uk>
To: ptxdist@pengutronix.de
Cc: Ian Abbott <abbotti@mev.co.uk>
Subject: [ptxdist] [PATCH] image-root-ext: add configuration option to set a volume label
Date: Thu,  6 Jun 2024 18:00:52 +0100	[thread overview]
Message-ID: <20240606170052.1255877-1-abbotti@mev.co.uk> (raw)

genimage supports volume labels for ext2/ext3/ext4 filesystems, so let
us allow it to be configured in PTXdist.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
 config/images/ext.config    | 1 +
 platforms/image-root-ext.in | 8 ++++++++
 rules/image-root-ext.make   | 2 ++
 3 files changed, 11 insertions(+)

diff --git a/config/images/ext.config b/config/images/ext.config
index 0ba21fc72..7082234b0 100644
--- a/config/images/ext.config
+++ b/config/images/ext.config
@@ -2,6 +2,7 @@
 image @IMAGE@ {
 	@EXT_TYPE@ {
 		use-mke2fs = true
+		label = "@LABEL@"
 	}
 	size = @SIZE@
 	mountpoint = "/"
diff --git a/platforms/image-root-ext.in b/platforms/image-root-ext.in
index 950a59c41..a2c2b32cd 100644
--- a/platforms/image-root-ext.in
+++ b/platforms/image-root-ext.in
@@ -44,4 +44,12 @@ config IMAGE_ROOT_EXT_TYPE
 	default "ext3" if IMAGE_ROOT_EXT_EXT3
 	default "ext4" if IMAGE_ROOT_EXT_EXT4
 
+config IMAGE_ROOT_EXT_LABEL
+	string
+	default ""
+	prompt "volume label"
+	help
+	  Set a volume label for the file system if the specified label
+	  is non-empty.  The maximum length of the label is 16 bytes.
+
 endif
diff --git a/rules/image-root-ext.make b/rules/image-root-ext.make
index 4a51efa5c..e8eec464f 100644
--- a/rules/image-root-ext.make
+++ b/rules/image-root-ext.make
@@ -20,6 +20,7 @@ IMAGE_ROOT_EXT_IMAGE	:= $(IMAGEDIR)/root.ext2
 IMAGE_ROOT_EXT_FILES	:= $(IMAGEDIR)/root.tgz
 IMAGE_ROOT_EXT_CONFIG	:= ext.config
 IMAGE_ROOT_EXT_SIZE	:= $(call remove_quotes,$(PTXCONF_IMAGE_ROOT_EXT_SIZE))
+IMAGE_ROOT_EXT_LABEL	:= $(call remove_quotes,$(PTXCONF_IMAGE_ROOT_EXT_LABEL))
 
 # ----------------------------------------------------------------------------
 # Image
@@ -35,6 +36,7 @@ IMAGE_ROOT_EXT_SCALE	:= $(subst %,,$(IMAGE_ROOT_EXT_SIZE))/80/1024/1024
 IMAGE_ROOT_EXT_ENV	+= \
 	SIZE="$(shell echo $$(($(IMAGE_ROOT_EXT_BASE)*$(IMAGE_ROOT_EXT_SCALE)+1))M)"
 endif
+IMAGE_ROOT_EXT_ENV	+= LABEL="$(IMAGE_ROOT_EXT_LABEL)"
 
 ifdef PTXCONF_IMAGE_ROOT_EXT
 $(IMAGE_ROOT_EXT_IMAGE):
-- 
2.43.0




             reply	other threads:[~2024-06-06 17:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-06 17:00 Ian Abbott [this message]
2024-06-15 14:58 ` [ptxdist] [APPLIED] " Michael Olbrich

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=20240606170052.1255877-1-abbotti@mev.co.uk \
    --to=abbotti@mev.co.uk \
    --cc=ptxdist@pengutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox