mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 1/3] partitions: efi: Allow to create barebox environment partition
Date: Mon, 19 Feb 2024 15:51:57 +0100	[thread overview]
Message-ID: <20240219145159.1962618-2-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20240219145159.1962618-1-s.hauer@pengutronix.de>

We have a GUID for partitions to use for barebox environment. Add an
option for parted to create these.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 commands/parted.c       | 2 +-
 common/partitions/efi.c | 3 +++
 include/efi/partition.h | 3 +++
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/commands/parted.c b/commands/parted.c
index 02bb1cff0c..6af18cdc57 100644
--- a/commands/parted.c
+++ b/commands/parted.c
@@ -360,7 +360,7 @@ BAREBOX_CMD_HELP_TEXT("")
 BAREBOX_CMD_HELP_TEXT("<unit> can be one of \"s\" (sectors), \"B\" (bytes), \"kB\", \"MB\", \"GB\", \"TB\",")
 BAREBOX_CMD_HELP_TEXT("\"KiB\", \"MiB\", \"GiB\" or \"TiB\"")
 BAREBOX_CMD_HELP_TEXT("<type> must be \"gpt\"")
-BAREBOX_CMD_HELP_TEXT("<fstype> can be one of  \"ext2\", \"ext3\", \"ext4\", \"fat16\" or \"fat32\"")
+BAREBOX_CMD_HELP_TEXT("<fstype> can be one of  \"ext2\", \"ext3\", \"ext4\", \"fat16\", \"fat32\" or \"bbenv\"")
 BAREBOX_CMD_HELP_TEXT("<name> for MBR partition tables can be one of \"primary\", \"extended\" or")
 BAREBOX_CMD_HELP_TEXT("\"logical\". For GPT this is a name string.")
 BAREBOX_CMD_HELP_END
diff --git a/common/partitions/efi.c b/common/partitions/efi.c
index 67d4978244..d102370b24 100644
--- a/common/partitions/efi.c
+++ b/common/partitions/efi.c
@@ -559,6 +559,7 @@ static __maybe_unused struct partition_desc *efi_partition_create_table(struct b
 
 static guid_t partition_linux_data_guid = PARTITION_LINUX_DATA_GUID;
 static guid_t partition_basic_data_guid = PARTITION_BASIC_DATA_GUID;
+static guid_t partition_barebox_env_gui = PARTITION_BAREBOX_ENVIRONMENT_GUID;
 
 static const guid_t *fs_type_to_guid(const char *fstype)
 {
@@ -572,6 +573,8 @@ static const guid_t *fs_type_to_guid(const char *fstype)
 		return &partition_basic_data_guid;
 	if (!strcmp(fstype, "fat32"))
 		return &partition_basic_data_guid;
+	if (!strcmp(fstype, "bbenv"))
+		return &partition_barebox_env_gui;
 
 	return NULL;
 }
diff --git a/include/efi/partition.h b/include/efi/partition.h
index 40ff4c557f..184b4fd961 100644
--- a/include/efi/partition.h
+++ b/include/efi/partition.h
@@ -57,6 +57,9 @@
 #define PARTITION_LINUX_LVM_GUID \
 	GUID_INIT( 0xe6d6d379, 0xf507, 0x44c2, \
 		0xa2, 0x3c, 0x23, 0x8f, 0x2a, 0x3d, 0xf9, 0x28)
+#define PARTITION_BAREBOX_ENVIRONMENT_GUID \
+	GUID_INIT( 0x6c3737f2, 0x07f8, 0x45d1, \
+		0xad, 0x45, 0x15, 0xd2, 0x60, 0xaa, 0xb2, 0x4d)
 
 /* based on linux/include/genhd.h */
 struct legacy_partition {
-- 
2.39.2




  reply	other threads:[~2024-02-19 14:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-19 14:51 [PATCH 0/3] use environment partitions in GPT Sascha Hauer
2024-02-19 14:51 ` Sascha Hauer [this message]
2024-02-19 15:20   ` [PATCH 1/3] partitions: efi: Allow to create barebox environment partition Ahmad Fatoum
2024-02-20 10:52     ` Sascha Hauer
2024-02-19 14:51 ` [PATCH 2/3] bootsource: add function to get device_node we booted from Sascha Hauer
2024-02-19 14:59   ` Marco Felsch
2024-02-19 15:21     ` Sascha Hauer
2024-02-20 10:56       ` Sascha Hauer
2024-02-19 14:51 ` [PATCH 3/3] environment: use barebox environment from GPT partitions Sascha Hauer
2024-02-19 15:06 ` [PATCH 0/3] use environment partitions in GPT Marco Felsch

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=20240219145159.1962618-2-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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