Allow to create barebox state partitions with the GUID
4778ed65-bf42-45fa-9c5b-287a1dc4aab1.

Signed-off-by: Sascha Hauer <[email protected]>
---
 commands/parted.c       | 2 +-
 common/partitions/efi.c | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/commands/parted.c b/commands/parted.c
index f03dc37c05..dd79def62a 100644
--- a/commands/parted.c
+++ b/commands/parted.c
@@ -435,7 +435,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\" or \"msdos\"")
-BAREBOX_CMD_HELP_TEXT("<fstype> can be one of  \"ext2\", \"ext3\", \"ext4\", 
\"fat16\", \"fat32\" or \"bbenv\"")
+BAREBOX_CMD_HELP_TEXT("<fstype> can be one of  \"ext2\", \"ext3\", \"ext4\", 
\"fat16\", \"fat32\", \"bbenv\" or \"barebox-state\"")
 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_TEXT("<end> can be \"max\" it will take all remaining space")
diff --git a/common/partitions/efi.c b/common/partitions/efi.c
index 88d8a2d739..56a3a4c43f 100644
--- a/common/partitions/efi.c
+++ b/common/partitions/efi.c
@@ -17,6 +17,7 @@
 #include <init.h>
 #include <asm/unaligned.h>
 #include <crc.h>
+#include <state.h>
 #include <linux/ctype.h>
 
 #include <efi/partition.h>
@@ -616,6 +617,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_guid = PARTITION_BAREBOX_ENVIRONMENT_GUID;
+static guid_t partition_barebox_state_guid = BAREBOX_STATE_PARTITION_GUID;
 
 static const guid_t *fs_type_to_guid(const char *fstype)
 {
@@ -631,6 +633,8 @@ static const guid_t *fs_type_to_guid(const char *fstype)
                return &partition_basic_data_guid;
        if (!strcmp(fstype, "bbenv"))
                return &partition_barebox_env_guid;
+       if (!strcmp(fstype, "barebox-state"))
+               return &partition_barebox_state_guid;
 
        return NULL;
 }
-- 
2.47.3


Reply via email to