Re: [PATCH 1/3] partitions: efi: Allow to create barebox environment partition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 19.02.24 15:51, Sascha Hauer wrote:
> 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@xxxxxxxxxxxxxx>
> ---
>  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;

guid*

>  
>  	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 {

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux