BeagleBoneBlack Debian source distribution

Hello,

Is building customized Debian kernel for BeagleBoneBlack is not needed any more, or the old way of building it is already outdated? I tried to google the updated build guide to build one and all are outdated.

Another question is about the source distribution. I think the official one is the one at GitHub - beagleboard/linux: The official BeagleBoard and BeagleBone kernel repository. I also find there are other distributions as well. What is the difference and how to choose?

Thanks!
Crane

Hi @Crane ,

You can find a step by step here: Debian: Getting Started with the BeagleBone Black - Linux Guides - Engineering and Component Solution Forum - TechForum │ Digi-Key

For Debian Buster (10.x) we default to v4.19.x: Files · 4.19 · BeagleBoard.org / Linux · GitLab

For Debian Bullseye (11.x) we default to v5.10.x: Files · 5.10 · BeagleBoard.org / Linux · GitLab

Regards,

Thanks RobertCNelson!

Are the two links of v4.19.x and v5.10.x the distributions used in the step by step guide at the first link?

Regards,
Crane

Correct…

git clone https://github.com/RobertCNelson/ti-linux-kernel-dev ./kernelbuildscripts
cd kernelbuildscripts/

For TI v4.19.x:

#~/kernelbuildscripts/
git checkout origin/ti-linux-4.19.y -b tmp

or for TI v5.10.x:

#~/kernelbuildscripts/
git checkout origin/ti-linux-5.10.y -b tmp

Regards,

After the Linux started, there is no usb0, no usb1 available after running ifconfig.
I checked the .config and the relevant features are selected.
I compared the /etc/network/interfaces with pre-build image and didn’t find anything relevant to usb0 and usb1.
I googled and didn’t find any articles relevant to network configuration before Linux boot.
What do you think might go wrong?

Absolutely nothing…

Auto Loading usb0/usb1 in the factory images, is not a kernel or u-boot configuration…

It’s a user-space configuration done at startup…

In Bullseye, this is now directly tied to systemd-networkd. (pre Bullseye it was a race-condition mess)…

sudo apt update
sudo apt install bb-usb-gadgets
sudo systemctl enable --now bb-usb-gadgets.service

Regards,

Ok got it.
Then I need to connect to the internet using the ethernet port, right? Otherwise, “apt update” won’t work.

Hi @Crane it may already be installed, just not enabled…

Regards,

No, it is not installed.
Dynamically setting IP address failed.
I referred to “Networking Guide for BeagleBone” by Brian Fraser and tried to set static IP address. But it needs root password. It seems both blank and “-” are not valid password. What’s the root’s password?
Thanks!
Crane

That was listed on the page where the Root File System install directions where listed…

password

USB0/USB1 “device” is created thru libcomposite, the bb-usb-gadgets package contains this script to to create a usb composite device: repos/bb-usb-gadgets/suite/bullseye/debian/bb-start-acm-ncm-rndis-old-gadget at master · rcn-ee/repos · GitHub

Regards,

Eventually get BBB connected to the internet.
Installed bb-usb-gadgets package.
But get error message when enabling its service, saying “couldn’t find libcomposite module”. I guess it is relevant what you said, right?

Tried to google some information about libcomposite, but couldn’t find anything that can address my question.
So, how to use the script you shared to help enable the usb gadget service?
Thanks!

Did you change the default kernel configuration? it’s built-in by default…

Regards,

No I didn’t change the default kernel configuration.
Here is the results when enabling it and checking the status:

debian@arm:~$ sudo systemctl enable --now bb-usb-gadgets.service
Job for bb-usb-gadgets.service failed because the control process exited with error code.
See “systemctl status bb-usb-gadgets.service” and “journalctl -xe” for details.
debian@arm:~$ sudo systemctl status bb-usb-gadgets.service
? bb-usb-gadgets.service - BeagleBoard.org USB gadgets
Loaded: loaded (/lib/systemd/system/bb-usb-gadgets.service; enabled; vendo>
Active: failed (Result: exit-code) since Wed 2023-03-08 03:26:20 UTC; 36s >
Process: 832 ExecStartPre=/sbin/modprobe libcomposite (code=exited, status=>
CPU: 24ms

Mar 08 03:26:20 arm systemd[1]: Starting BeagleBoard.org USB gadgets…
Mar 08 03:26:20 arm modprobe[832]: modprobe: FATAL: Module libcomposite not fou>
Mar 08 03:26:20 arm systemd[1]: bb-usb-gadgets.service: Control process exited,>
Mar 08 03:26:20 arm systemd[1]: bb-usb-gadgets.service: Failed with result 'exi>
Mar 08 03:26:20 arm systemd[1]: Failed to start BeagleBoard.org USB gadgets.
debian@arm:~$

try:

sudo depmod -a

and then:

lsmod

It says:
debian@arm:~$ sudo /sbin/depmod -a
depmod: ERROR: could not open directory /lib/modules/4.19.94-ti-r73.1: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
debian@arm:~$

Then try to install kernel headers:
debian@arm:~$ sudo apt install linux-headers-$(uname -r)
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
E: Unable to locate package linux-headers-4.19.94-ti-r73.1
E: Couldn’t find any package by glob ‘linux-headers-4.19.94-ti-r73.1’
debian@arm:~$ lsmod
Module Size Used by
debian@arm:~$

There might be something wrong with the image. It doesn’t happen when using the pre-build Debian image.

Indeed not available.
linux-headers-4.19.94-ti-r73/unknown 1bullseye armhf
Linux kernel headers for 4.19.94-ti-r73 on armhf
Would xxx-r73 instead of xxx-r73.1 work?

So someone didn’t copy the kernel modules: Debian: Getting Started with the BeagleBone Black - Linux Guides - Electronic Component and Engineering Solution Forum - TechForum │ Digi-Key

Copy Kernel Modules

#user@localhost:~$
sudo tar xfv ./kernelbuildscripts/deploy/${kernel_version}-modules.tar.gz -C /media/rootfs/

Regards,

I did copy the first time. I save the record. No idea how it gets lost.
Anyway, do it again.

Here is lsmod result:
debian@arm:~$ lsmod
Module Size Used by
pm33xx 16384 0
wkup_m3_ipc 16384 1 pm33xx
wkup_m3_rproc 16384 1
remoteproc 57344 2 wkup_m3_rproc,wkup_m3_ipc
virtio 16384 1 remoteproc
virtio_ring 28672 1 remoteproc
uio_pdrv_genirq 16384 0
uio 20480 1 uio_pdrv_genirq
usb_f_mass_storage 53248 2
usb_f_acm 16384 2
u_serial 20480 3 usb_f_acm
usb_f_ncm 28672 2
usb_f_rndis 32768 4
u_ether 20480 2 usb_f_ncm,usb_f_rndis
libcomposite 65536 18 usb_f_acm,usb_f_ncm,usb_f_mass_storage,usb_f_rndis
debian@arm:~$

It looks it is there, right?
Enable it again and still failed. The reason looks a little different.
debian@arm:~$ sudo systemctl status bb-usb-gadgets.service
? bb-usb-gadgets.service - BeagleBoard.org USB gadgets
Loaded: loaded (/lib/systemd/system/bb-usb-gadgets.service; enabled; vendo>
Active: failed (Result: exit-code) since Thu 2022-10-06 19:49:04 UTC; 3min>
Process: 380 ExecStartPre=/sbin/modprobe libcomposite (code=exited, status=>
Process: 381 ExecStart=/usr/bin/bb-start-usb-gadgets (code=exited, status=2)
CPU: 67ms
No previous regular expression (press RETURN)
Oct 06 19:49:04 arm systemd[1]: Starting BeagleBoard.org USB gadgets…
Oct 06 19:49:04 arm bb-start-usb-gadgets[381]: bb-usb-gadgets: bb-start-acm-ncm>
Oct 06 19:49:04 arm bb-start-usb-gadgets[382]: usb_gadget: Looking for libcompo>
Oct 06 19:49:04 arm bb-start-usb-gadgets[383]: ls: write error: Device or resou>
Oct 06 19:49:04 arm systemd[1]: bb-usb-gadgets.service: Control process exited,>
Oct 06 19:49:04 arm systemd[1]: bb-usb-gadgets.service: Failed with result 'exi>
Oct 06 19:49:04 arm systemd[1]: Failed to start BeagleBoard.org USB gadgets.

debian@arm:~$

reinstall bb-usb-gadgets and it works to find USB0 and USB1 now.