[PATCH 10/12] partitions: dos: implement partition manipulation support

Sascha Hauer s.hauer at pengutronix.de
Wed Feb 28 23:16:24 PST 2024


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 |



More information about the barebox mailing list