Become a leader in the IoT community!
New DevHeads get a 320-point leaderboard boost when joining the DevHeads IoT Integration Community. In addition to learning and advising, active community leaders are rewarded with community recognition and free tech stuff. Start your Legendary Collaboration now!
It’s to tweak things in the kernel, reconfigure the kernel
What’s your current configuration like
Normal 6.12-rc1 kernel that comes with BBB
I was thinking of taking the config folder and Changing that CONFIG=Y to CONFIG=m and then recompile it
just editing the .config file manually works? You know that it’s easy to miss dependencies
What dependency are there in kernel?
Just make sure to recompile the kernel, not just the modules tho, since the .config changes might affect other components
Right
That’s why I am slightly confused
So which all places should I should I change
One is config
Second Is vmlinux
I think even change the path pointing to vmlinux in uEnv.txt
Anything else?
Oh I meant about some configurations and features
I will suggest u so it this way
Ah
I see!
Since you are using 6.12-rc1 just firstly export the current configuration you have , to ensure u are working with the exact config for your current kernel
Hey what about using use make menuconfig or make nconfig
instead of directly editing the .config
Yea
That better
But ryt now I was able to compile with the edited part
So instead of y to m
Main part
Is how do I install this kernel from here
And the extra module instead of using insmod
“`make modules_install
make install“`
This will install d modules and update ur bootloader for you
Just that you will need to edit the uEnv.txt file on the boot partition to reference the new kernel image
Next thing is to restart after all said and done
Hey, sorry for the delay in msg,
but this would mean that i would have to clone the kernel in BBB?
Uhmm well not necessarily tho , you don’t need to clone the kernel source on the BBB itself. If you compiled the kernel and modules on another system like your PC, just transfer the necessary files to the BBB
Copy the kernel image maybe zImage or Image, copy the modules and the
.dtb if you would need that
Place these guys you copied in the their own locations on the BBB and update the uEnv.txt file to point to the new kernel
Cus cloning or compiling directly on the BBB can be slow
There is a bit of documentation at:
https://docs.beagleboard.org/books/beaglebone-cookbook/07kernel/kernel.html
To re-compile the kernel:
1. Get hold of a suitable toolchain **on your main Linux PC**
`sudo apt install gcc-arm-linux-gnueabihf`
2. Get hold of the kernel **on your PC**
`git clone git://github.com/beagleboard/linux.git`
3. Find out what version of the kernel you are running **on your BBB**
The key bit of info is the `5.10.168-ti-r62`
That tells me it is the 5.10 kernel
4. Checkout the kernel version **on your PC**
`cd linux`
`get checkout -b 5.10.y`
_Replace with your version_
5. Get the kernel configuration file **from the BBB**
There is a compressed copy of the kernel `.config` in the `/proc` directory
`cp /proc/config.gz .`
`gunzip config.gz`
`mv config melta_defconfig`
Copy this `melta_defconfig` over to your PC in te directory `linux/arch/arm/configs`
6. Set up the kernel configuration **on your PC**
`make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- melta_defconfig`
7. Use the menuconfig system to change the driver to a Module
It is safer to use the menuconfig rather than just editing the file is the menuconfig system (hopefully!) knows about any potential dependancies
`make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- menuconfig`
You will need ncurses-devel installed
8. Re-compile the kernel & modules
`make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j4 zImage modules`
The `j4` is how many CPU cores to use for the compile. Use as many as you actually have
8. Collect the modules
`mkdir ~/new_modules`
`make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=~/new_modules`
9. Copy the kernel & modules to your BBB:/boot/zImage-melta` :/lib/modules`
`scp arch/arm/boot zImage
`scp -rp ~/new_modules/lib/modules/*
10. Ask your BBB to use the new kernel
Edit `/boot/uEnv.txt`
Change the `uname_r` line to the name of your new kernel
e.g. `uname_r=zImage-melta`
11. Reboot the BBB and see if it works
12. (Optional) Re-flash the SD Card of the BBB as you realise that I wrote the instructions from memory, missed some step and have bricked the board 🙂
CONTRIBUTE TO THIS THREAD