I have a BBB, How do i change the build-in bus driver to a module?

Hello Guys, I have a BBB, How do i change the build-in bus driver to a module?
33 Replies
Marvee Amasi
Marvee Amasi5w ago
It's to tweak things in the kernel, reconfigure the kernel
Marvee Amasi
Marvee Amasi5w ago
What's your current configuration like
melta101
melta1015w ago
Normal 6.12-rc1 kernel that comes with BBB
melta101
melta1015w ago
I was thinking of taking the config folder and Changing that CONFIG=Y to CONFIG=m and then recompile it
Marvee Amasi
Marvee Amasi5w ago
just editing the .config file manually works? You know that it’s easy to miss dependencies
melta101
melta1015w ago
What dependency are there in kernel?
Marvee Amasi
Marvee Amasi5w ago
Just make sure to recompile the kernel, not just the modules tho, since the .config changes might affect other components
melta101
melta1015w ago
Right That's why I am slightly confused
melta101
melta1015w ago
So which all places should I should I change
melta101
melta1015w ago
One is config
melta101
melta1015w ago
Second Is vmlinux
melta101
melta1015w ago
I think even change the path pointing to vmlinux in uEnv.txt
melta101
melta1015w ago
Anything else?
Marvee Amasi
Marvee Amasi5w ago
Oh I meant about some configurations and features
Marvee Amasi
Marvee Amasi5w ago
I will suggest u so it this way
melta101
melta1015w ago
Ah I see!
Marvee Amasi
Marvee Amasi5w ago
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
Marvee Amasi
Marvee Amasi5w ago
Hey what about using use make menuconfig or make nconfig
Marvee Amasi
Marvee Amasi5w ago
instead of directly editing the .config
melta101
melta1015w ago
Yea That better But ryt now I was able to compile with the edited part
melta101
melta1015w ago
So instead of y to m
melta101
melta1015w ago
Main part Is how do I install this kernel from here
melta101
melta1015w ago
And the extra module instead of using insmod
Marvee Amasi
Marvee Amasi5w ago
make modules_install
make install
make modules_install
make install
Marvee Amasi
Marvee Amasi5w ago
This will install d modules and update ur bootloader for you
Marvee Amasi
Marvee Amasi5w ago
Just that you will need to edit the uEnv.txt file on the boot partition to reference the new kernel image
Marvee Amasi
Marvee Amasi5w ago
Next thing is to restart after all said and done
melta101
melta1015w ago
Hey, sorry for the delay in msg, but this would mean that i would have to clone the kernel in BBB?
Marvee Amasi
Marvee Amasi5w ago
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
Marvee Amasi
Marvee Amasi5w ago
Copy the kernel image maybe zImage or Image, copy the modules and the .dtb if you would need that
Marvee Amasi
Marvee Amasi5w ago
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
Marvee Amasi
Marvee Amasi5w ago
Cus cloning or compiling directly on the BBB can be slow
Ming
Ming4w ago
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
uname -a
Linux beaglebone 5.10.168-ti-r62 #1bullseye SMP PREEMPT Tue May 23 20:15:00 UTC 2023 armv7l GNU/Linux
GNU/Linux
uname -a
Linux beaglebone 5.10.168-ti-r62 #1bullseye SMP PREEMPT Tue May 23 20:15:00 UTC 2023 armv7l GNU/Linux
GNU/Linux
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 scp arch/arm/boot zImage <your BBB>:/boot/zImage-melta scp -rp ~/new_modules/lib/modules/* <your BBB>:/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 🙂

Did you find this page helpful?