Skip to contentSkip to conversation

Logical partition on barebox

DISCUSSION Victorien Vedrine 2 participants 6 messages Dec 10, 2014 – Dec 15, 2014 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Hi,
I'm developping a board with barebox and Linux. For my application, I need 5 partition on my SD card (3 primary and 2 logical).
On barebox prompt, I just see the 3 primary partitions (/dev/disk0.0, /dev/disk0.1, /dev/disk0.2) and 1 extended partition (/dev/disk0.3). Is there a way to see the 2 logical partitions ?

Best regards

Victorien

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#1 lore raw

Hi Victorien,

Quoted 6 lines · Victorien Vedrine

Hi,
I'm developping a board with barebox and Linux. For my application, I need 5 partition on my SD card (3 primary and 2 logical). On barebox prompt, I just see the 3 primary partitions (/dev/disk0.0, /dev/disk0.1, /dev/disk0.2) and 1 extended partition (/dev/disk0.3). Is there a way to see the 2 logical partitions ?

Which barebox version do you use?

barebox supports extended partitions since:

| commit 6fecd2aaca209884a0ec1f58ccc42b91d1d4b828
| Author: Uwe Kleine-König <[email protected]>
| Date:   Fri Nov 8 11:13:41 2013 +0100
| 
|     partitions: dos: parse extended partition
|     
|     DOS MBRs might contain an extended partition that holds several logical
|     partitions. Add these to the partitions of the block device.
|     
|     Signed-off-by: Uwe Kleine-König <[email protected]>
|     Signed-off-by: Sascha Hauer <[email protected]>

If your version is newer then this seems to be a bug.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

Thanks for your answer.
In a first time, I used a barebox version with the last update at the 10/16/2013. I Found the patch which you are talking about and I update barebox to the version of yesterday and I have the same problem. The partitions of my SD card are this one (with fdisk) :

Périphérique Amorçage Début Fin Blocs Id. Système

   /dev/sdg1            2048        6143        2048   53  OnTrack DM6 Aux3
   /dev/sdg2            6144       10239        2048   10  OPUS
   /dev/sdg3           10240       43007       16384    6  FAT16
   /dev/sdg4           43008    15556607     7756800    5  Étendue
   /dev/sdg5           43040      567327      262144   83  Linux
   /dev/sdg6          567360    15556607     7494624    b  W95 FAT32

I use an iMX28 processor and I have this line on device_init fonction to add the SD card :

        add_generic_device("mxs_mci", 0, NULL, IMX_SSP0_BASE, 0x2000,
                   IORESOURCE_MEM, &mci_pdata);

Is there any tests that I can do to find a solution or more informations for a bug ?

Best regards

Victorien

Quoted 25 lines · Sascha Hauer

Hi Victorien,

Quoted 6 lines · Victorien Vedrine

Hi,
I'm developping a board with barebox and Linux. For my application, I need 5 partition on my SD card (3 primary and 2 logical). On barebox prompt, I just see the 3 primary partitions (/dev/disk0.0, /dev/disk0.1, /dev/disk0.2) and 1 extended partition (/dev/disk0.3). Is there a way to see the 2 logical partitions ?

Which barebox version do you use?

barebox supports extended partitions since:

| commit 6fecd2aaca209884a0ec1f58ccc42b91d1d4b828
| Author: Uwe Kleine-König<[email protected]>
| Date:   Fri Nov 8 11:13:41 2013 +0100
|
|     partitions: dos: parse extended partition
|
|     DOS MBRs might contain an extended partition that holds several logical
|     partitions. Add these to the partitions of the block device.
|
|     Signed-off-by: Uwe Kleine-König<[email protected]>
|     Signed-off-by: Sascha Hauer<[email protected]>
Quoted 4 lines

If your version is newer then this seems to be a bug.

Sascha

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 14 lines · Victorien Vedrine

Thanks for your answer.
In a first time, I used a barebox version with the last update at the 10/16/2013. I Found the patch which you are talking about and I update barebox to the version of yesterday and I have the same problem. The partitions of my SD card are this one (with fdisk) :

Périphérique Amorçage  Début         Fin      Blocs    Id. Système /dev/sdg1            2048        6143        2048   53  OnTrack DM6 Aux3 /dev/sdg2            6144       10239        2048   10  OPUS /dev/sdg3           10240       43007       16384    6  FAT16 /dev/sdg4           43008    15556607     7756800    5  Étendue /dev/sdg5           43040      567327      262144   83  Linux /dev/sdg6          567360    15556607     7494624    b  W95 FAT32

Quoted 5 lines

I use an iMX28 processor and I have this line on device_init fonction to add the SD card :

         add_generic_device("mxs_mci", 0, NULL, IMX_SSP0_BASE, 0x2000,
                    IORESOURCE_MEM, &mci_pdata);

This is correct. If your card is shown then you made everything right here.

Quoted 3 lines

Is there any tests that I can do to find a solution or more informations for a bug ?

You could add a #define DEBUG on top of common/partitions/dos.c (above the includes) and see if this gives more information. Otherwise you can do some further debugging this file. Does dos_extended_partition() get called?

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#5 lore raw

Thanks,

I debug common/partitions/dos.c and the problem is "dos_extended_partition() is not executed. I found why :
On dos_partition function there is a test to know the type of partition (line 212). The comment says "partition type 0x05 or 0x0f can be extended and just 0x0f is tested. The type extended partition on my SD card is 0x05 and then it doesn't work. I modify the source code of common/partitions/dos.c with

            if ((pentry.dos_partition_type == 

0x0f)||(pentry.dos_partition_type == 0x05)) {
and now it's work.

Victorien

Quoted 23 lines · Sascha Hauer
Quoted 14 lines · Victorien Vedrine

Thanks for your answer.
In a first time, I used a barebox version with the last update at the 10/16/2013. I Found the patch which you are talking about and I update barebox to the version of yesterday and I have the same problem. The partitions of my SD card are this one (with fdisk) :

Périphérique Amorçage Début Fin Blocs Id. Système
/dev/sdg1 2048 6143 2048 53 OnTrack DM6 Aux3
/dev/sdg2 6144 10239 2048 10 OPUS
/dev/sdg3 10240 43007 16384 6 FAT16
/dev/sdg4 43008 15556607 7756800 5 Étendue
/dev/sdg5 43040 567327 262144 83 Linux
/dev/sdg6 567360 15556607 7494624 b W95 FAT32

Quoted 5 lines

I use an iMX28 processor and I have this line on device_init fonction to add the SD card :

add_generic_device("mxs_mci", 0, NULL, IMX_SSP0_BASE, 0x2000,
IORESOURCE_MEM, &mci_pdata);

This is correct. If your card is shown then you made everything right here.

Quoted 10 lines
Quoted 2 lines

Is there any tests that I can do to find a solution or more informations for a bug ?

You could add a #define DEBUG on top of common/partitions/dos.c (above the includes) and see if this gives more information. Otherwise you can do some further debugging this file. Does dos_extended_partition() get called?

Sascha

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#6 lore raw
Quoted 9 lines · Victorien Vedrine

Thanks,

I debug common/partitions/dos.c and the problem is "dos_extended_partition() is not executed. I found why :
On dos_partition function there is a test to know the type of partition (line 212). The comment says "partition type 0x05 or 0x0f can be extended and just 0x0f is tested. The type extended partition on my SD card is 0x05 and then it doesn't work.
I modify the source code of common/partitions/dos.c with

Quoted 3 lines
            if ((pentry.dos_partition_type ==

0x0f)||(pentry.dos_partition_type == 0x05)) {
and now it's work.

Nice. Care to send a patch to fix this upstream?

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox