grub-devel
[Top][All Lists]
Advanced

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

Re: [RFC 1/1] mkimage: revert "Align efi sections on 4k boundary"


From: Julien ROBIN
Subject: Re: [RFC 1/1] mkimage: revert "Align efi sections on 4k boundary"
Date: Fri, 19 Apr 2019 17:32:55 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

Thanks Heinrich, so I tested with your approach and u-boot.bin.

The reason why I had no version of arm-efi grub working was because I had to add --with-platform=efi while playing "./configure [...]"
On arm64-efi it's fine to forgot it but not in arm-efi builds.

Now I can confirm the same problem and confirm also that the suggested RFC about grub/include/grub/efi/pe32.h makes it start on arm-efi (with the u-boot method but also with various QEMU-EFI-ARM firmwares I recently found).
Unfortunately, the suggested RFC about grub/include/grub/efi/pe32.h also breaks compatibility with the Asus NovaGo TP370QL I have here, at least (Qualcomm Snapdragon 835, arm64-efi)

I updated my summary file so anyone can easily drive the arm-efi tests on future modifications, with a simple x86_64 computer, qemu, and some minutes of work. https://sorel.pixconfig.fr/GRUB/commands.txt.

Have a nice week end
Julien


PS : may be making a summary of all architectures/configurations tests tutorials would be useful ? Even if it's just QEMU (it would even be a lot of work), and used on new releases or wide changes, or just from time to time to see if no accident happened in any recent changes. It would also be an awesome tutorial for people starting to deal with grub


On 4/19/19 5:29 AM, Heinrich Schuchardt wrote:
On 4/19/19 12:02 AM, Julien ROBIN wrote:
Hi, I don't know if others folks are easily able to test and reproduce
the issue and test suggested patch, so I did some builds, and tests
based on the EFI file produced by grub-mkstandalone using -O arm-efi :
it's a trivial way to test what code version is working or not with
qemu-system-arm for example.

Unfortunately, with or without applying the RFC suggested reverting
patch, and even with the Grub 2.02 version, using qemu-system-arm and an
efi firmware for it, *I can't get any efi version of grub working fine
on qemu and arm (32 bits) :*
https://image.noelshack.com/fichiers/2019/16/4/1555617325-screenshot-from-2019-04-18-21-51-22.png

I did the comparison by building for

  * --target=arm-linux-gnueabihf, grub-mkstandalone using -O arm-efi
    (naming the resulting file bootarm.efi)
    and
  * --target=aarch64-linux-gnu, grub-mkstandalone using -O arm64-efi
    (naming the resulting file bootaa64.efi). I also did make sure that
    I wasn't mixing wrong files during the process.

I placed more details here  : https://sorel.pixconfig.fr/GRUB/ (commands
for having everything build and started, qemu EFI firmwares, resulting
files with current grub and 2.02 of 32 and 64 bits) for those who
quickly want to do their own tests.

Heinrich, did you succeeded to get an arm-efi version of grub booting on
some qemu-system-arm machine ? Are you using another qemu arm efi
firmware ? I'm using this one : https://efi.akeo.ie/QEMU_EFI/

The firmware I am using is U-Boot which is available as

git clone git://git.denx.de/u-boot-efi.git
cd u-boot
make qemu_arm_defconfig
make

To use it with QEMU:

qemu-system-arm -bios u-boot.bin -machine virt -cpu cortex-a15 ...



Also, debian-9.8.0-armhf-netinst.iso and even
debian-10-2019-04-18-JR-armhf-NETINST-1.iso (created using easy-build
and a local updated mirror), does not seem to contain any EFI boot
loader (Debian for armhf isn't using efi) so I wasn't able to confront
any debian armhf efi thing.
You will need a FAT formatted partition mounted at /boot/efi

sudo -s
apt-get install qemu-arm-efi
grub-install --target=arm-efi
update grub

To boot with GRUB you can use these commands on the U-Boot console:

load mmc 0:2 ${fdt_addr_r} dtb
load mmc 0:1 ${kernel_addr_r} EFI/debian/grubarm.efi
bootefi ${kernel_addr_r} ${fdt_addr_r}

If you want to build the Debian packages yourself on your 32bit ARM system:

wget
http://deb.debian.org/debian/pool/main/g/grub2/grub2_2.02+dfsg1.orig.tar.xz
wget
http://deb.debian.org/debian/pool/main/g/grub2/grub2_2.02+dfsg1-16.debian.tar.xz
tar -xJf grub2_2.02+dfsg1.orig.tar.xz
tar -xJf grub2_2.02+dfsg1-16.debian.tar.xz
cp -R debian grub-2.02+dfsg1/
cd grub-2.02+dfsg1/
sudo apt-get install \
debhelper patchutils python flex bison po-debconf help2man texinfo \
gcc-8 xfonts-unifont libfreetype6-dev gettext libdevmapper-dev \
libsdl1.2-dev xorriso cpio parted libfuse-dev ttf-dejavu-core \
liblzma-dev wamerican pkg-config bash-completion
dpgk-buildpackage
cd ..
ls *.deb

You can install the built packages with
sudo dpkg -i \
grub2-common_2.02+dfsg1-16_armhf.deb \
grub-common_2.02+dfsg1-16_armhf.deb \
grub-efi-arm_2.02+dfsg1-16_armhf.deb \
grub-efi-arm-bin_2.02+dfsg1-16_armhf.deb

Best regards

Heinrich



Finally, I can confirm the qemu efi arm firmware is working at least
enough for having this efi file running :
https://github.com/pbatard/uefi-simple but it's probably because the
qemu efi arm firmware comes from here ;) so it's not very surprising if
it work with it.

If I can help with my time for testing things, feel free to ask me!
Best regards,
Julien ROBIN


On 4/18/19 5:14 PM, Heinrich Schuchardt wrote:
On 4/18/19 12:41 PM, Daniel Kiper wrote:
On Wed, Apr 17, 2019 at 07:50:09AM +0200, Heinrich Schuchardt wrote:
Since this commit a51f953f4ee8 ("mkimage: Align efi sections on 4k
boundary") grubarm.efi crashes. Let's revert it.

Everywhere or on a specific machines?

I observed the issue on a TinkerBoard (Rockchip RK3288 CPU) and on
qemu-arm-system -machine virt with the current Debian Buster GRUB.

Best regards

Heinrich


Daniel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]