Topics

[WIC] Multiple WKS Files


Rudolf J Streif
 

eMMC devices commonly have three hardware partitions: two boot
partitions and a user partition. I was looking for a convenient way to
have wic build an image for the boot partition and one for the user
partition. However, that does not seem to be possible right out of the
box. The variable WKS_FILE only accepts one file and not a list. The
class image_types_wic.bbclass uses WKS_FILES internally but that seems
to be a search list and the code only builds the file it finds first.

Is my understanding correct?

Any smart ideas to make this work?

Thanks,
Rudi


Joshua Watt
 



On Sat, May 2, 2020, 1:22 PM Rudolf J Streif <rudolf.streif@...> wrote:
eMMC devices commonly have three hardware partitions: two boot
partitions and a user partition. I was looking for a convenient way to
have wic build an image for the boot partition and one for the user
partition. However, that does not seem to be possible right out of the
box. The variable WKS_FILE only accepts one file and not a list. The
class image_types_wic.bbclass uses WKS_FILES internally but that seems
to be a search list and the code only builds the file it finds first.

I think part of the problem is that wks files are tied to a rootfs image, so it's not currently possible to have multiple because there is no way to differentiate them. Also because of that it's a little odd to have a wks file that doesn't reference the rootfs it's built with.

You might be able to do it by making a simple dummy image recipe for the boot partition(s), then overriding the WKS_FILE variable for the image with a pn override in the machine.conf file (e.g. WKS_FILE_pn-my-emmc-boot = "emmc-boot.wks" )


Is my understanding correct?

Any smart ideas to make this work?

Thanks,
Rudi






Rudolf J Streif
 


On 5/2/20 2:47 PM, Joshua Watt wrote:


On Sat, May 2, 2020, 1:22 PM Rudolf J Streif <rudolf.streif@...> wrote:
eMMC devices commonly have three hardware partitions: two boot
partitions and a user partition. I was looking for a convenient way to
have wic build an image for the boot partition and one for the user
partition. However, that does not seem to be possible right out of the
box. The variable WKS_FILE only accepts one file and not a list. The
class image_types_wic.bbclass uses WKS_FILES internally but that seems
to be a search list and the code only builds the file it finds first.

I think part of the problem is that wks files are tied to a rootfs image, so it's not currently possible to have multiple because there is no way to differentiate them. Also because of that it's a little odd to have a wks file that doesn't reference the rootfs it's built with.

You might be able to do it by making a simple dummy image recipe for the boot partition(s), then overriding the WKS_FILE variable for the image with a pn override in the machine.conf file (e.g. WKS_FILE_pn-my-emmc-boot = "emmc-boot.wks" )

Thank you, Joshua. I might try your idea. I have noticed that it is tied to the rootfs as I tried to use ondisk/ondrive to create images for different partitions. But that did not work. Actually, the use of the ondisk/ondrive parameter is not entirely obvious to me (but I also have not dissected the code to figure it out).

It might be worthwhile looking into enhancing wic to be able to create multiple images. Devices now also use universal flash storage (UFS) which supports multiple logical disks like a SCSI drive once it is provisioned.



Is my understanding correct?

Any smart ideas to make this work?

Thanks,
Rudi







    
-- 
-----
Rudolf J Streif
CEO/CTO ibeeto
+1.855.442.3386 x700


Joshua Watt
 


On 5/4/20 11:14 AM, Rudolf J Streif wrote:


On 5/2/20 2:47 PM, Joshua Watt wrote:


On Sat, May 2, 2020, 1:22 PM Rudolf J Streif <rudolf.streif@...> wrote:
eMMC devices commonly have three hardware partitions: two boot
partitions and a user partition. I was looking for a convenient way to
have wic build an image for the boot partition and one for the user
partition. However, that does not seem to be possible right out of the
box. The variable WKS_FILE only accepts one file and not a list. The
class image_types_wic.bbclass uses WKS_FILES internally but that seems
to be a search list and the code only builds the file it finds first.

I think part of the problem is that wks files are tied to a rootfs image, so it's not currently possible to have multiple because there is no way to differentiate them. Also because of that it's a little odd to have a wks file that doesn't reference the rootfs it's built with.

You might be able to do it by making a simple dummy image recipe for the boot partition(s), then overriding the WKS_FILE variable for the image with a pn override in the machine.conf file (e.g. WKS_FILE_pn-my-emmc-boot = "emmc-boot.wks" )

Thank you, Joshua. I might try your idea. I have noticed that it is tied to the rootfs as I tried to use ondisk/ondrive to create images for different partitions. But that did not work. Actually, the use of the ondisk/ondrive parameter is not entirely obvious to me (but I also have not dissected the code to figure it out).

I haven't used it a whole lot because of the way we provision our devices, but I think its mostly so that wic can create a valid fstab in the root file system that will mount all the partitions. This way, the root file system image can remain generic and work with different partitions layouts specified in the wks file.

It might be worthwhile looking into enhancing wic to be able to create multiple images. Devices now also use universal flash storage (UFS) which supports multiple logical disks like a SCSI drive once it is provisioned.

Yes, that would be really nice. I don't think that wic currently has any concept of "hardware partitions" (e.g. the emmc boot partitions or the UFS SCSI LUNs), just GPT/MBR partitions. I'm not sure how you would add support for it.




Is my understanding correct?

Any smart ideas to make this work?

Thanks,
Rudi






-- 
-----
Rudolf J Streif
CEO/CTO ibeeto
+1.855.442.3386 x700