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

Sascha Hauer s.hauer at pengutronix.de
Tue Feb 20 02:52:47 PST 2024


On Mon, Feb 19, 2024 at 04:20:55PM +0100, Ahmad Fatoum wrote:
> 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 at 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;
> 
> guid*

Fixes, thanks

Sascha

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



More information about the barebox mailing list