Hi Ryan,
I'm replying with a copy to linaro-dev@ as I believe adding support to UEFI into l-m-c will require a new hwpack format, which is something that needs discussion with a wider audience.
On 11/01/12 13:51, Ryan Harkin wrote:
Hi Danilo,
Ok, as we agreed, I've had a hack at the l-m-c script to produce an image with UEFI instead of (or as well as) U-Boot.
I've attached a diff for the changes I made.
As I have no prior experience with this script, my changes are purely for "demo" purposes. You're allowed to laugh at my basic perl skills ;-)
I hope you meant Python? Or did you include some perl code here as well? ;)
The changes are "generic", i.e. don't take into account that platforms like Snowball have special "magic" for U-Boot and will probably need special magic for UEFI. I expect "someone" will make those changes whenever UEFI is developed for such platforms.
Is it implemented for any of our supported platforms already? If not, do you have any idea when that might happen?
Also, the attached diff is only for hacking l-m-c. I haven't done android-l-m-c, although I expect it's similar. And I haven't touched the hwpack creation scripts so far.
I'm writing this before I've gone through the diff, but I'd expect the hwpacks would have to grow some config options for that, which means a new hwpack format. If that's the case, we'll need to invite more people into the discussion and probably agree on what the new hwpack should look like before we change l-m-c. Sounds like a good candidate for a Connect session. :)
So, what have I done? Quite simple, really: I've added a --bootloader option to linaro-media-create. The option takes the values: none, uboot, uefi or all. Default is "uboot" to mimic current behaviour.
What is the desired behaviour of this option?
none - no bootloader is copied to the disk image uboot - only U-Boot images are copied to the disk image uefi - only UEFI images are copied to the disk image all - all bootloaders in the hwpack are copied to the disk image
I'm wondering... do you have any use cases for the none and all options?
If you specify a bootloader that doesn't exist in the hwpack, the script will fail horribly. This is like current behaviour: if uboot is not in
Right, but currently we know that the hwpacks for boards that use u-boot will include the u-boot binary, whereas with your changes users will have to first check that the bootloader they want is in the hwpack.
I wonder if it wouldn't be better to make hwpacks include just one bootloader (whichever is chosen by the hwpack author)?
the hwpack, l-m-c will fail. I think this is only a problem for the 'all' case. As a user, I'd expect the 'all' case to work if UEFI, U-Boot or both were missing. But I'm not sure how best to fix that.
How did I test it?
- un-tar an existing hwpack
- add a 'uefi' directory with the files 'uefi.bin' and 'sec_uefi.bin'
- edit 'metadata' to add the UEFI keys: UEFI=uefi/uefi.bin SEC_UEFI=uefi/sec_uefi.bin UEFI_IN_BOOT_PART=Yes
- re-tar it as before.
- run l-m-c
What next? I'd like you to review my changes and see if they make sense. As mentioned earlier, I'd expect you to have a lot of criticisms about the way I've implemented it, but I hope my example can help you understand the direction I'd like the script to take.
Your implementation seems straightforward to me, but given what I said above, I think there's not much point in discussing the implementation in l-m-c before we have agreed on what the new hwpack format should look like.
Then, I need to work on the hwpack create scripts. I am a bit in the dark with this as I don't know enough about hwpack creation. I believe that to get the scripts to create a hwpack with UEFI inside, I am going to have to package UEFI somehow. This is the area that I am not familiar with: all of the packaging in the ARM LT has been done by either Ricardo or Tixy. So, any links, docs, or hints would be appreciated.
A hwpack is just a bunch of .deb packages, some board-specific configs and the bootloader binary. In the case of UEFI, we'll probably only need a binary file to copy to the boot partition, so in theory there's no need for a .deb package. However, the hwpack creation script will need to get that from somewhere and given it already knows where to get .debs from, that might be easier. We do that for u-boot, but given its special nature, it doesn't need to be in the rootfs, so we just extract the actual bootloader from the .deb and put that in a fixed place for l-m-c to find. I imagine we'd do something similar for UEFI.
On Thu, 2012-01-12 at 17:35 -0300, Guilherme Salgado wrote:
I wonder if it wouldn't be better to make hwpacks include just one bootloader (whichever is chosen by the hwpack author)?
This could make the transition difficult. Some users (like LAVA) require U-Boot, whereas others might want to use the new UEFI.
Also, I think we should support placing multiple versions of the bootloader in the boot partition, together with multiple device-tree blobs. Otherwise, for Versatile Express, we will soon end up having to produce 6 images each month. (6 is the permutation of {A5, A9, A15 CPUs} x {real hardware, fast models} and there are other combinations likely in the future.)
On 01/13/2012 10:38 AM, Jon Medhurst (Tixy) wrote:
On Thu, 2012-01-12 at 17:35 -0300, Guilherme Salgado wrote:
I wonder if it wouldn't be better to make hwpacks include just one bootloader (whichever is chosen by the hwpack author)?
This could make the transition difficult. Some users (like LAVA) require U-Boot, whereas others might want to use the new UEFI.
We don't require U-Boot. If we can somehow script UEFI (remotely tell it to boot from something) then we'll gladly support UEFI as well.
Hi Ryan, Guilherme, all,
У чет, 12. 01 2012. у 17:35 -0300, Guilherme Salgado пише:
I'm wondering... do you have any use cases for the none and all options?
At least the 'all' option should make sense: I remember reading that UEFI can happily live alongside a different boot loader as well, thus allowing one single image to be used for systems supporting either uboot or UEFI.
Ryan, my overall take on this so far is:
- there is still a lot of work done to be able to make this fully usable - we would need sufficient tests (automated, unit and integration tests) to ensure whatever we implemented is not easily broken with future modifications - it would be hard to get all this in a suitable state by the end of January cycle - it would be better if you used a branch and pushed it to lp:~ryanharkin/linaro-image-tools/uefi-support or something (name it whatever you like, it doesn't have to be "uefi-support")
The core question is how urgent this really is?
Cheers, Danilo
On 13 January 2012 10:09, Danilo Šegan danilo.segan@linaro.org wrote:
Hi Ryan, Guilherme, all,
У чет, 12. 01 2012. у 17:35 -0300, Guilherme Salgado пише:
I'm wondering... do you have any use cases for the none and all options?
I don't have a use case for none, but it was easy to add and I considered it might be useful to some.
At least the 'all' option should make sense: I remember reading that UEFI can happily live alongside a different boot loader as well, thus allowing one single image to be used for systems supporting either
uboot
or UEFI.
Indeed. Also, the ALL case is useful for Versatile Express, which doesn't actually use the bootloader off the card at all. However, some people may prefer to use u-boot or vice-versa, so having both is a nice extra and saves having multiple hwpacks.
Also:
On Thu, 2012-01-12 at 17:35 -0300, Guilherme Salgado wrote:
Is it implemented for any of our supported platforms already? If not, do you have any idea when that might happen?
It is implemented on Versatile Express A9. As I mentioned, VE has no way to boot from the MMC card. The image must be programmed into NOR flash on the motherboard. We do this at the moment by copying the image from the disk image. As mentioned, this is a manual step.
There is a BeagleBoard version and Samsung has also released a version of UEFI for their boards, but I don't believe Linaro have been involved so far.
Ryan, my overall take on this so far is:
- there is still a lot of work done to be able to make this fully
usable
- we would need sufficient tests (automated, unit and integration
tests) to ensure whatever we implemented is not easily broken with future modifications
- it would be hard to get all this in a suitable state by the end of
January cycle
- it would be better if you used a branch and pushed it to
lp:~ryanharkin/linaro-image-tools/uefi-support or something (name it whatever you like, it doesn't have to be "uefi-support")
The core question is how urgent this really is?
To follow up on this, Danilo and I have a chat earlier and we agreed that a January release is not really possible. There is too much to consider and decide, plus the implementation on top.
We agreed that I would set up a Connect session for general issues about hwpacks and l-m-c, including this issue; with a follow-up session a day or so later where we concentrate on UEFI requirements.
Regards, Ryan.