[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#824954: Re:flash-kernel: please provide a way to integrate with GRUB



Hello,

For FreedomBox, I experimented with building a single UEFI image for
multiple arm64 boards as described for SUSE[1]. I tested a single UEFI
arm64 image for Rock64, RockPro64 and Raspberry Pi 3B+.

As part this, u-boot will reside on an SPI flash with OS on an eMMC, an
SD card, a USB disk or an NVMe drive. Alternatively, u-boot will reside
on an SD card with OS on a different drive. We can build these tiny
u-boot based firmware images separately or in cases like Raspberry Pi,
provide a build script or provide external references on how to get the
images.

The main OS image will have grub-efi with EFI partition and will not
contain u-boot or u-boot boot script. When u-boot starts from SPI flash
(or SD card), due to distroboot, it will load the DTB file from /dtb of
EFI partition and execute Grub EFI. Grub is responsible for loading the
kernel and initrd while DTB is loaded and passed on to the kernel via
Grub by u-boot. I had to do two hacks to make this happen:

1) Copy /boot/efi/EFI/debian/grubaa64.efi to
/boot/efi/EFI/boot/bootaa64.efi.

2) Copy /usr/lib/linux-image-$(latest)/ to /boot/efi/dtb/. For this I
wrote a small kernel hook script.

flash-kernel could introduce a new 'mode' of operation, say 'efi-dtb',
to help with hack number two. It will have to copy the latest kernel
dtbs recursively to /boot/efi/dtb.

FreedomBox is currently building an image for each of the boards it
supports. Being able to build a single image for all boards of an
architecture is a great simplification. Further more, image will contain
completely free software even for boards like Raspberry Pi (because
non-free firmware need not be shipped by the project).

Links:

1) https://www.suse.com/media/article/UEFI%20on%20Top%20of%20U-Boot.pdf

Thanks,

-- 
Sunil

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: