[U-Boot] Question about booting Linux from efi_loader

Masahiro Yamada yamada.masahiro at socionext.com
Wed Oct 31 02:52:06 UTC 2018


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!


           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


>
> 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.





-- 
Best Regards
Masahiro Yamada


More information about the U-Boot mailing list