(newbie) How to compile latest kernel for BBB

The latest kernel for BBB is 6.18.1-bone11. How/where do I download and compile this? I can find standard Linux kernel. But, I need all the Beaglebone additions and patches.

The last full kernel package I downloaded/compiled was 5.10.168-ti-r83 (https://github.com/beagleboard/linux/archive/refs/tags/5.10.168-ti-r83.tar.gz). But, this site doesn’t have the latest kernel v6.18.1.

I found bb-kernel-6.18.1-bone11.zip (https://github.com/RobertCNelson/bb-kernel/archive/refs/tags/6.18.1-bone11.zip). Is this the proper site? At least, for scripts to run?

compiles, kernel_version=6.18.1-bone11

bb-kernel-6.18.1-bone11$ ./build_kernel.sh

Every tag is available here, going back years: GitHub - RobertCNelson/linux-stable-rcn-ee

For 6.18.x

git clone -b am33x-v6.18 https://github.com/RobertCNelson/bb-kernel.git
cd ./bb-kernel/
./build_deb.sh

OK, thanks. It seems the version (6.18.1-bone11) is set in version.sh,

build_prefix="-bone"
KERNEL_REL=6.18
KERNEL_TAG=${KERNEL_REL}.1
BUILD=${build_prefix}11

1. Suppose version goes up to 6.18.9, yet I want to download/compile 6.18.1, do I adjust version.sh accordingly?

2. Right now, make menuconfig is being skipped, because AUTO_BUILD=1. If I want “make menuconfig”, do I set AUTO_BUILD=0 ? And, where? in system.sh.gitlab where it’s being set now, or add to version.sh?

Don’t change version.sh unless you personally want to maintain the patches..

As kernel patches come down the line, just run git pull… you can see how i merge and tag: Commits · RobertCNelson/bb-kernel · GitHub

Every release is tagged… Tags · RobertCNelson/bb-kernel · GitHub which helps as long as you have a host in the same era.. (As tags from a few years ago might need an old verison of ubuntu to build…)

Don’t enable AUTO_BUILD unless you are buiding in CI or want to build it as-is..

Regards,

But, I need access to “make menuconfig”. I want to move all USB Gadget modules into modules, not builtin as they’re now.

  • I’m using “usb_f_hid”, and it works most of the time with “g_multi” loaded but not enabled, but there are corner cases I can’t track down. And, don’t have time anymore.
  • But, with “g_multi” as modules and blacklisted, it works all the time. But, that’s with standard Linux kernel, without your BBB additions/patches.

So, I want all your BBB additions/patches, but with USB Gadget re-compiled as modules. For that, I need access to “make menuconfig”.

oh that shows by default… i got an idea for you thou…

please send me a diff of your defconfig, i’m trying to automate your change..

Regards,

I was wrong. I only looked at the files, and didn’t run build_deb.sh (which later took 1hour git + 5hours compile) when I wrote this. system.sh is copied from system.sh.sample which doesn’t set AUTO_BUILD, so make menuconfig does pop up. Good.

Now, after compiling few kernels, here is one customer’s feedback:

1.

curl --follow -OJ https://github.com/RobertCNelson/bb-kernel/archive/refs/tags/6.18.1-bone11.zip
unzip bb-kernel-6.18.1-bone11.zip
cd bb-kernel-6.18.1-bone11
    ./build_kernel.sh 
  • error – “fatal: --local can only be used inside a git repository”

2.

git clone -b am33x-v6.18 https://github.com/RobertCNelson/bb-kernel.git
cd bb-kernel
    ./build_deb.sh
  • Git took 1 hour… lots of “deltas”.
  • system.sh.sample , therefore system.sh eventually, doesn’t define CC= (cross compile variable). So, it was downloading/using CC=arm-linux-gnueabi-. I have arm-linux-gnueabihf- already installed. I copied over CC=arm-linux-gnueabihf- from system.sh.gitlab.
  • I had to edit version.sh to change version from factory kernel. I don’t want to step on the factory image.
  • make menuconfig did pop up.
  • Compile took 5hours on VM.
  • sudo apt install ./linux-image-6.18.1-bone11-bbb_1xross_armhf.deb
    
  • It automatically changes uname_r= line in /boot/uEnv.txt . It seems it has problems with lines with non-existing kernels (installed, removed from system, but leftover in uEnv.txt).
  • BBB booted okay.

3.

curl --follow -OJ https://github.com/RobertCNelson/linux-stable-rcn-ee/archive/refs/tags/6.18.1-bone11.zip
unzip linux-stable-rcn-ee-6.18.1-bone11.zip
cd linux-stable-rcn-ee-6.18.1-bone11
    make rcn-ee_defconfig
    make menuconfig

Actually, this is what I’m familiar with, and it doesn’t step on factory images. So, I’ll go with this method.

Correction and Update:

I was wrong about my USB Gadget problems. The root cause was wrong kernel configs, not kernel modules stepping on each other. The 2 relevant configs from factory images are:

CONFIG_USB_GADGET=y
CONFIG_USB_CONFIGFS=y

where CONFIGFS is one level below GADGET. I changed to

CONFIG_USB_GADGET=y
CONFIG_USB_CONFIGFS=m

As long as one of them is ‘m’, the resulting kernel modules are the same. But, on few kernels, I had,

CONFIG_USB_GADGET=m
CONFIG_USB_CONFIGFS=m

This makes no difference on kernel modules. But, GADGET=m will flip ‘musb_hdrc’ (Inventra Highspeed Dual Role Controller) from ‘Dual Role’ mode into ‘Host-only’ mode. As you know, USB Gadget relies on USB device mode. Arrgh… one month of wild goose chase!

PS, If this is going to be a back and forth customer and suppler relationship, I’m out…

Regards,