-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Problems with building a 4.8/4.9 kernel in 64bit mode, bad file format for "Image" #1788
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Maybe I'm totally wrong and my kernel image is 100% ok, and the problem is just the way I'm booting the kernel through U-Boot. Just installed and tested openSUSE from this SD image
Does anybody have some hints for me how to use boot the 4.8 kernel with U-Boot? Any documentation where I can easily follow all the required steps? Thanks! |
I haven't tried u-boot in awhile, but I think the trick is to rebase the kernel image to use a different load address then the default. The tool you want to use is mkimage and it's included in the "u-boot-tools" package in debian sid on my PC. Essentially, you rename the u-boot loader to be kernel8.img and then have u-boot load the image you create with mkimage. You need to create a u-boot script file to manually load the correct device tree as part of the boot process. BTW, I understand that a version of u-boot is available that has UEFI support. I've heard of people using u-boot to load grub2 which then loads the Linux kernel. The point is to get the fancy menus of grub to work. |
@Electron752 Thanks for the infos. I just found out the kernel will be created by default with UEFI support, that's the reason for the different file format. As soon as create the kernel w/o EFI then the file format looks correct. But it doesn't boot. I'm already using the latest mainline U-Boot v2017.01-rc3 and did verified my settings with successfully booting the 4.5.0 kernel I mentioned above. |
Yes, I think the image format and boot process have changed alot since last april(2016). Back then, you had to cat a special asm stub to the start of the kernel binary. That isn't necessary anymore and I don't think it's supported anymore directly by the RPI firmware/bootloader. Did you check out the mkimage command from u-boot tools? Last time I had u-boot working, it was necessary to run this step to generate a rebased kernel in the special u-boot format. I think by default the load address of the u-boot loader conflicts with the default load address of the kernel image. That's why it's necessary to rebase the kernel image. You also need to modify your u-boot loader script to load the 64 bit version of the device tree. Since you are going through u-boot, it isn't loaded by default. If you try to use the 32 bit version of the device tree, you will not get very far into the boot process. Probably just a black screen. I can probably do a complete writeup on how to use u-boot, but I'm a bit busy ATM and the process of using u-boot is a bit complex. But I think the info I've given should point in the correct direction. I am curious why you want to use u-boot in the first place. For simple booting, it doesn't add much value to the default loader that ships with the RPI. What it does give is more advanced boot options such as network booting and UEFI support. |
Honestly my goal is just to get a 64bit kernel running on the RPi, w/ or w/o U-Boot doesn't really matter. But with U-Boot I do have some more control in the dev process and later I can use PXE boot to speed up the kernel configuration and testing process. BTW, the U-Boot Here is my process so far to use U-Boot:
compile boot script, U-Boot for RPi3 is looking for default script "boot.scr.uimg"
Here it stops forever with my own kernels, I've tested 4.8 and 4.9. |
I'll see what I can do it get u-boot working either later today or possibly the weekend. In the meantime, I have a version of 4.9 that works now. I've created pull request #1790 to update the downstream tree. If you want it sooner, you can get it off my github page at http://www.github.com/Electron752/linux branch rpi-4.9.y+rpi364. Booting without u-boot is very easy. Just build like you have done and copy: This works for me without changing anything in config.txt. But if it doesn't work for you, you may want to try adding: |
Thanks, will try your 4.9 repo later! |
This kernel version works, thanks!!! |
The latest rpi-4.9.y contains #1790. |
@DieterReuter I might delete the temporary branch off my github page in a few days. I generally just use my page as a staging area. |
I close this issue, because it's resolved for me now. |
hi DieterReuter: thanks |
@02350316 I switched to kernel 4.9 repo and don't use u-boot now. So, you just need a kernel with serial output, then it should work. And there has to be the correct .dtb file in place. |
I just tested this again today with the latest mainline U-Boot version compiled for RPi3 in 64bit. This problem already exists, so booting a Raspberry Pi kernel doesn't work with U-Boot right now. U-Boot version: U-Boot 2017.07, built (Jul 23 2017 - 11:52:23 +0000 This seems to be the same issue like #2123. |
hi,DieterReuter |
Hi, I have the same issue when trying to get U-boot working with my RPi 3 and I'm looking for your help guys. When I'm using My U-boot config: Also, I'm not sure if I should use this line: Seriously, I have no clue what to do. Could you guys paste your own config files for U-boot that are working with x86 or x64 defconfig? Thanks! |
hi:admchm |
@02350316 Your post helped me in some ways. My U-boot for x64 defconfig just started working. I used older branch, but it works, finally. Update: |
Closing this issue as questions answered/issue resolved. |
Uh oh!
There was an error while loading. Please reload this page.
I try to build a 64bit kernel for RPi3. Building is just easy and straight forward, but the resulting
Image
kernel image cannot be booted at all. It seems the generated file format is just wrong, but I don't have any glue how to resolve it.This kernel is my build result which won't boot at all:
If I compare it with a running kernel from this tarball http://www.tom-yam.or.jp/rpi3/rpi3-arm64-debian-20160414.img.xz from this forum thread, I get the following file format:
Both kernels have rougly the same size, but different file format.
Any help or pointer greatly appreciated.
And here are my building steps, just to make sure there's no wrong configuration:
The text was updated successfully, but these errors were encountered: