mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: Barebox List <barebox@lists.infradead.org>
Subject: Re: [PATCH 10/12] partitions: dos: implement partition manipulation support
Date: Thu, 29 Feb 2024 08:16:24 +0100	[thread overview]
Message-ID: <ZeAvSGrfIDLwIXH1@pengutronix.de> (raw)
In-Reply-To: <7df5436f-a405-49ae-9876-52751d0fd905@pengutronix.de>

On Wed, Feb 28, 2024 at 06:37:45PM +0100, Ahmad Fatoum wrote:
> Hello Sascha,
> 
> On 19.02.24 09:31, Sascha Hauer wrote:
> > -		pentry = xzalloc(sizeof(*pentry));
> > +		dpart = xzalloc(sizeof(*dpart));
> > +		dpart->boot_indicator = table[i].boot_indicator;
> > +		memcpy(dpart->chs_begin, table[i].chs_begin, sizeof(table[i].chs_begin));
> > +		dpart->type = table[i].type;
> > +		memcpy(dpart->chs_end, table[i].chs_end, sizeof(table[i].chs_end));
> > +
> > +		pentry = &dpart->part;
> >  
> >  		pentry->first_sec = first_sec;
> >  		pentry->size = get_unaligned_le32(&table[i].partition_size);
> >  		pentry->dos_partition_type = table[i].type;
> > +		pentry->num = i + 1;
> 
> I suspect this breaks my boot script for MBR systems.
> Please revert to zero-based numbering.

Err, right. This wasn't really done on purpose. I just wanted the
numbering of parted consistent to the Linux output and haven't thought
about the implication on the numbering barebox uses internally.

I've sent patches to revert it back. This means parted now has a
different numbering than its Linux pendant, but I think this is still
better than having parted in barebox start at 1 while barebox internally
uses 0.

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 |



  reply	other threads:[~2024-02-29  7:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-19  8:31 [PATCH 00/12] Partition table " Sascha Hauer
2024-02-19  8:31 ` [PATCH 01/12] partitions: dos: save indention level Sascha Hauer
2024-02-19  8:31 ` [PATCH 02/12] partition: allocate struct partition_desc in parser Sascha Hauer
2024-02-19  8:31 ` [PATCH 03/12] partition: allocate struct partition " Sascha Hauer
2024-02-19  8:31 ` [PATCH 04/12] partition: efi: keep raw data Sascha Hauer
2024-02-19  8:31 ` [PATCH 05/12] uuid: implement random uuid/guid Sascha Hauer
2024-02-19  8:31 ` [PATCH 06/12] linux/sizes.h: add more defines Sascha Hauer
2024-02-19  8:31 ` [PATCH 07/12] partition: add PARTITION_LINUX_DATA_GUID define Sascha Hauer
2024-02-19  8:31 ` [PATCH 08/12] partitions: move parser.h to include/partitions.h Sascha Hauer
2024-02-19  8:31 ` [PATCH 09/12] partitions: implement partition manipulation support Sascha Hauer
2024-02-19  8:31 ` [PATCH 10/12] partitions: dos: " Sascha Hauer
2024-02-28 17:37   ` Ahmad Fatoum
2024-02-29  7:16     ` Sascha Hauer [this message]
2024-02-19  8:31 ` [PATCH 11/12] partitions: efi: " Sascha Hauer
2024-02-28 17:36   ` Ahmad Fatoum
2024-02-19  8:31 ` [PATCH 12/12] commands: add parted Sascha Hauer
2024-02-19  9:38   ` Ulrich Ölmann
2024-02-20 10:47 ` [PATCH 00/12] Partition table manipulation support Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZeAvSGrfIDLwIXH1@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox