How do I compile an arbitrary kernel for U-Boot?
#1
Question 
I have been trying to get a DVD drive to work with the RockPRO64, but for some reason the kernel is not properly operating the drive and the open/close button does not work.
I researched the problem, and it seems like this is a general problem with the Linux kernel or its modules on multiple architectures — some versions of the "linux" package in Manjaro/Arch properly provided CD drive support and some did not. So, now I simply have to compile kernels from source until I get the right one.  [2]

The only problem is, after a week or so of trying to compile kernels and comb through source code for rockpro U-Boot packages I still have no idea how to compile a kernel for U-Boot that actually boots. I have tried "mkimage" and putting a regular compiled kernel stripped of debug information into mkimage, but the kernel always fails to boot and restarts the CPU. I read and re-read the documentation for the U-Boot packages and saw that I'm apparently supposed to have a kernel tree with "make uImage" or "make pImage", but none of the kernel.org trees had this so I'm not sure where to get this source tree.  [1]
I am also confused where the blobless package "uboot-rockpro64-foss" finds the kernel if it does not install one to /boot, or in any case where my kernel is on disk after I boot into a Manjaro partition.

How do I compile a kernel from source into an "Image" file loaded by extlinux.conf?
Is that even the same kernel that loads when I boot my eMMC and run "uname -a" to describe the kernel? How do I compile and use a new one?


[1] edit 6/07: so, apparently new kernel trees have "make Image". I tried this with kernel version 6.4.0-rc4 and it did not boot past what seems to be the Secondary Program Loader (SPL).

[2] edit 6/17: well now I feel really stupid. The problem with the DVD drive was that I kept trying to plug it into a USB 2.0 port and it really needed a USB 3.0 port. I just never figured this out because I always had something else in the single one the ROCKPro has.
That said, it would still probably be helpful to people to know how to compile a kernel, so I will still test it if anybody figures out how. I have already been messing with creating distro images for a while now.
  Reply
#2
The default target built with the arm64 ARCH should give you a arch/arm64/boot/Image, that's the image that u-boot is capable of booting.

Occasional Linux Kernel Contributor, Avid Wiki Updater, Ask Me About Quartz64
Open Hardware Quartz64 Model A TOSLink Adapter
Pi-bus GPIO Extender For ROCKPro64 And Quartz64 Model A
Plebian GNU/Linux
  Reply
#3
(06-12-2023, 01:54 AM)CounterPillow Wrote: The default target built with the arm64 ARCH should give you a arch/arm64/boot/Image, that's the image that u-boot is capable of booting.

I took that file and copied it to a fresh SD card install, moving the existing "Image" to a new name. The "Image" there to begin with booted, the compiled "Image" did not boot and part way through booting the power light on the monitor shut off.

(This is the same 6.4 kernel from above)
  Reply
#4
You should use a USB-to-Serial adapter to debug this, making sure to disable any quiet or loglevel options in your kernel command line. A monitor is not a good way to get kernel messages.

Occasional Linux Kernel Contributor, Avid Wiki Updater, Ask Me About Quartz64
Open Hardware Quartz64 Model A TOSLink Adapter
Pi-bus GPIO Extender For ROCKPro64 And Quartz64 Model A
Plebian GNU/Linux
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Boot/Shutdown on timer captainmorgan 8 7,839 11-01-2023, 12:08 PM
Last Post: Nikolay_Po
Exclamation Ethernet regression on Linux Kernel 6.5.4? Deathcrow 3 1,617 09-22-2023, 04:27 AM
Last Post: diederik
  RockPro64 boot questions misterc 3 2,422 01-13-2023, 06:21 PM
Last Post: misterc
  Is some u-boot required on the SPI for installing debian with the official installer? callegar 1 1,786 10-25-2022, 10:07 AM
Last Post: ratzzupaltuff
  [OS] SkiffOS and Buildroot for Rockpro64 w/ 5.17 kernel paralin1 1 2,253 05-08-2022, 03:26 PM
Last Post: paralin1
  Kernel OOPs triggered by big writes to ext4 FS ajtravis 1 1,845 04-04-2022, 05:29 PM
Last Post: ajtravis
  How I Got Fedora Linux to Boot From eMMC (or microSD, for that matter) whitecat23 4 5,573 01-03-2022, 10:32 AM
Last Post: whitecat23
  Overlays not loading at boot - ROCKPRO64 on Armbian rookieone 0 1,600 09-28-2021, 04:10 AM
Last Post: rookieone
  Manjaro ARM - Built-in ethernet was broken with kernel 5.14.1-1 (over now) Dendrocalamus64 2 2,791 09-11-2021, 08:58 PM
Last Post: t4_4t
Question cannot boot openSUSE - what am I doing wrong? Mentaluproar 2 3,012 08-12-2021, 04:58 AM
Last Post: igorp

Forum Jump:


Users browsing this thread: 2 Guest(s)