mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] image-root-ext: add configuration option to set a volume label
@ 2024-06-06 17:00 Ian Abbott
  2024-06-15 14:58 ` [ptxdist] [APPLIED] " Michael Olbrich
  0 siblings, 1 reply; 2+ messages in thread
From: Ian Abbott @ 2024-06-06 17:00 UTC (permalink / raw)
  To: ptxdist; +Cc: Ian Abbott

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-06-15 14:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-06 17:00 [ptxdist] [PATCH] image-root-ext: add configuration option to set a volume label Ian Abbott
2024-06-15 14:58 ` [ptxdist] [APPLIED] " Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox