Skip to contentSkip to conversation

wic: Setting partition id value?

DISCUSSION Usman, Fahad 3 participants 5 messages Feb 10, 2016 – Feb 11, 2016

lore
Share & tools
lore
#0 lore raw

Hi,
Is there a way to create a partition with an arbitrary partition id, using wic tool. We want to create a disk image using wic for Altera Cyclone V. It require the partition id to be set to a particular hex value for the partition it reads the boot loader binary from. The partition id does get set automatically to the correct value depending on the value of fstype (eg. 0x83 for ext3 or 0x0c for fat32), but I couldn't find a way to set it to an arbitrary value.

Best regards,
Fahad Usman.

#1 lore raw
Quoted 3 lines · Fahad

Hi,
Is there a way to create a partition with an arbitrary partition id,

using wic tool. We want to create a disk image using wic for Altera Cyclone V. It require the partition id to be set to a particular hex value for the partition it reads the boot loader binary from. The partition id does get set automatically to the correct value depending on the value of fstype (eg. 0x83 for ext3 or 0x0c for fat32), but I couldn't find a way to set it to an arbitrary value.

Quoted 1 line

I ran into this problem as well, but with parted. My hack was to use dd to write the correct type ID into the image's MBR after I finished creating the partitions on the image file.

#2 lore raw
Quoted 1 line · Jon Szymaniak

I ran into this problem as well, but with parted. My hack was to use dd to write the correct type ID into the image's MBR after I finished creating the partitions on the image file.

Thanks Jon Szymaniak,
I was also thinking about a similar solution, the reason wic has this limitation is probably because it uses parted under the hood and parted doesn't allow you to set the partition id to an arbitrary value. A safer way to do this might be with the help of fdisk as it allows you to change partition's system id using the 't' sub command in interactive mode. But I am looking for a way to do this using existing options in wic.

Regards,
Fahad Usman.

#3 lore raw
In reply to Usman, Fahad
Quoted 9 lines · Fahad

Hi,
Is there a way to create a partition with an arbitrary partition id, using wic tool. We want to create a disk image using wic for Altera Cyclone V. It require the partition id to be set to a particular hex value for the partition it reads the boot loader binary from. The partition id does get set automatically to the correct value depending on the value of fstype (eg. 0x83 for ext3 or 0x0c for fat32), but I couldn't find a way to set it to an arbitrary value.

This is not supported by wic, but shouldn't be hard to implement. Please create an issue in bugzilla and assign to me if you want me to do it.

--
Regards,
Ed

#4 lore raw
Quoted 3 lines · Ed Bartosh

This is not supported by wic, but shouldn't be hard to implement. Please create an issue in bugzilla and assign to me if you want me to do it.

Thanks Ed,
I have created this bug, https://bugzilla.yoctoproject.org/show_bug.cgi?id=9096. Do let me know if you need any more information.

--
Regards,
Fahad.