[elbe-devel] [PATCH v2] hdimg: Add support for specifying the first partition offset

Torben Hohn torben.hohn at linutronix.de
Wed Jul 15 17:35:42 CEST 2020


On Wed, Jul 15, 2020 at 04:22:30PM +0200, Kurt Kanzenbach wrote:
> The starting sector for the first partition in an msdos or gpt image is hard
> coded to 2048. Depending on the image layout (bootloader, redundant bootloaders,
> ...) it makes sense to move that offset around. Introduce a new property to
> allow that.
> 
> Suggested-by: Holger Dengler <dengler at linutronix.de>
> Signed-off-by: Kurt Kanzenbach <kurt at linutronix.de>

Reviewed-by: Torben Hohn <torben.hohn at linutronix.de>

> ---
>  elbepack/hdimg.py |  4 +++-
>  schema/dbsfed.xsd | 14 ++++++++++++++
>  2 files changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/elbepack/hdimg.py b/elbepack/hdimg.py
> index 63410ee05d89..f7a49abf8cf7 100644
> --- a/elbepack/hdimg.py
> +++ b/elbepack/hdimg.py
> @@ -432,7 +432,9 @@ def do_image_hd(hd, fslabel, target, grub_version, grub_fw_type=None):
>      else:
>          grub = grubinstaller_base()
>  
> -    current_sector = 2048
> +    current_sector = size_to_int(hd.text("first_partition_sector",
> +                                         default="2048"))
> +
>      for part in hd:
>  
>          if part.tag == "partition":
> diff --git a/schema/dbsfed.xsd b/schema/dbsfed.xsd
> index c7bae9be549c..49aada58bffa 100644
> --- a/schema/dbsfed.xsd
> +++ b/schema/dbsfed.xsd
> @@ -1168,6 +1168,13 @@
>            </documentation>
>          </annotation>
>        </element>
> +      <element name="first_partition_sector" type="rfs:part_size" minOccurs="0" maxOccurs="1">
> +        <annotation>
> +          <documentation>
> +            Starting sector for the first partition
> +          </documentation>
> +        </annotation>
> +      </element>
>        <element name="grub-install" type="rfs:string" minOccurs="0" maxOccurs="1">
>          <annotation>
>            <documentation>
> @@ -1235,6 +1242,13 @@
>            </documentation>
>          </annotation>
>        </element>
> +      <element name="first_partition_sector" type="rfs:part_size" minOccurs="0" maxOccurs="1">
> +        <annotation>
> +          <documentation>
> +            Starting sector for the first partition
> +          </documentation>
> +        </annotation>
> +      </element>
>        <element name="grub-install" type="rfs:string" minOccurs="0" maxOccurs="1">
>          <annotation>
>            <documentation>
> -- 
> 2.20.1
> 

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