[elbe-devel] elbe gpt disk partition names

Torben Hohn torben.hohn at linutronix.de
Tue Jan 4 14:19:26 CET 2022


On Tue, Jan 04, 2022 at 12:18:44PM +0000, Steih, Martin wrote:
> I hope I am not requesting this wrong, but would it be possible to add the following patch (or something more suitable) to support partition names with gpt images?

I believe that we should use a different tag.
The filesystem label should be different from the partitionlabel in many
cases. (Thinking about A/B updates here)




> 
> diff --git a/elbepack/hdimg.py b/elbepack/hdimg.py
> index 696225925..0e6ebed72 100644
> --- a/elbepack/hdimg.py
> +++ b/elbepack/hdimg.py
> @@ -331,11 +331,16 @@ def create_partition(
>          fs = simple_fstype("fat32")
>          ppart = parted.Partition(disk, ptype, fs, geometry=g)
> +
>          if disk.type != "gpt":
>              ppart.setFlag(_ped.PARTITION_LBA)
>      else:
>          ppart = parted.Partition(disk, ptype, geometry=g)
> +    if disk.type == "gpt" and \
> +        part.text("label") in fslabel:
> +        ppart.set_name(fslabel[part.text("label")].label)
> +
>      cons = parted.Constraint(exactGeom=g)
>      disk.addPartition(ppart, cons)
> 

> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel


-- 
Torben Hohn
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99

Hinweise zum Datenschutz finden Sie hier (Informations on data privacy 
can be found here): https://linutronix.de/kontakt/Datenschutz.php

Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen | 
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700 
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner


More information about the elbe-devel mailing list