[U-Boot] Question about booting Linux from efi_loader
Alexander Graf
agraf at suse.de
Wed Oct 31 09:27:32 UTC 2018
On 10/31/2018 03:52 AM, Masahiro Yamada wrote:
> Hi Alex,
>
> Thank you for your help.
>
>
>
> On Tue, Oct 30, 2018 at 10:32 PM Alexander Graf <agraf at suse.de> wrote:
>> Hi Masahiro,
>>
>> On 30.10.18 14:20, Masahiro Yamada wrote:
>>> Hi Alex,
>>>
>>>
>>> Could you teach me a little bit
>>> about efi_loader?
>>>
>>> I guess I am seriously missing something,
>>> but how to pass initramdisk address when you use
>>> bootefi (like when you use 'booti') ?
>>>
>>>
>>> What I did:
>>>
>>>> tftpboot 90000000 Image
>>>> tftpboot 98000000 uniphier-ld11-global.dtb
>>>> bootefi 90000000 98000000
>>> The kernel will start booting,
>>> but fail to mount initramdisk,
>>> obviously because I am not passing initramdisk.
>> This is great news!
>>
>> The way loading an initrd works in UEFI land is that there is either
>>
>> a) A boot loader that loads the initrd on behalf of Linux (like grub)
>>
>> or
>>
>> b) Linux loads the initrd from within its efi stub.
>>
>> For a) you would need to set up a working grub.efi binary and a config.
>> I guess that's a bit much to ask right now? The easiest way to test this
>> path is to use an existing setup, such as a distro image:
>>
>>
>> http://download.opensuse.org/ports/aarch64/tumbleweed/iso/openSUSE-Tumbleweed-NET-aarch64-Current.iso
>>
>> You should be able to dd that onto an SD card / USB stick / anything and
>> it should automatically boot into grub and with a bit of luck also into
>> the kernel.
>
> OK, I tried.
>
> I copied the openSUSE-Tumbleweed-NET-aarch64-Current.iso
> into my USB drive by using 'dd' command.
>
>
>
>
> U-BOOT> tftpboot 98000000 uniphier-ld11-global.dtb
> U-BOOT> usb start
> U-BOOT> load usb 0:1 90000000 /EFI/BOOT/bootaa64.efi
> U-BOOT> bootefi 90000000 98000000
>
>
> Then, I can see GRUB menu like follows on my serial console. Yay!
Awesome :)
>
>
> openSUSE Tumbleweed
>
>
> Boot from Hard Disk
> �
> *Installation
> �│
> Upgrade
> �│
> More ...
> �│
>
>
>
> "Boot from Hard Disk" did not work for my board as is, though.
> Maybe I will need to customize grub.efi
Oh, "Boot from Hard Disk" is really only "exit" - so it should just
return you back to the U-Boot shell. The idea is that distro boot has a
boot order and will try to boot the next medium if grub exits ;). The
interesting entry is "Installation", as that should boot our distro
kernel which might work to some extent ;)
>
>
>> For b) theoretically you should be able to use the "initrd=" kernel
>> command line parameter. I haven't used it myself yet, but I guess it
>> might work? Give it a try :).
>>
>> U-BOOT# setenv bootargs initrd=initrd.gz
>> U-BOOT# bootefi 90000000 98000000
>>
>> That should tell the Linux efi stub to load a file called "initrd.gz"
>> from the same location the Image was loaded from (tftp in your case).
>
> This did not work for me,
> but it would be worth digging into.
Hm :/. I can put it on the list of things to look at :). It really
should work, but I remember that Ard was trying to remove the dtb= and
initrd= options from Linux because people really should load things
using a boot loader ;).
Alex
More information about the U-Boot
mailing list