Potential i2c group error in am335x-debian-11.5-minimal-armhf-2022-11-01-2gb.img.xz

With am335x-debian-11.5-minimal-armhf-2022-11-01-2gb.img.xz from Debian 11.x (Bullseye) - Monthly Snapshots, the i2c buses belong to the group root (not i2c):

debian@BeagleBone:~$ ls -l /dev/i2c*
crw------- 1 root root 89, 0 Nov  1 07:35 /dev/i2c-0
crw------- 1 root root 89, 1 Nov  1 07:35 /dev/i2c-1
crw------- 1 root root 89, 2 Nov  8 02:42 /dev/i2c-2

With older images, they came belonging to the i2c group by default:

debian@beaglebone:~$ ls -l /dev/i2c*
crw-rw---- 1 root i2c 89, 0 Nov  7 23:48 /dev/i2c-0
crw-rw---- 1 root i2c 89, 1 Nov  7 23:48 /dev/i2c-1
crw-rw---- 1 root i2c 89, 2 Nov  7 23:48 /dev/i2c-2

The fix is simple:

sudo chown :i2c /dev/i2c*
sudo chmod g+rw /dev/i2c*

However, I am wondering, should this fix be promoted to the base Debian 11 image? Why don’t the I2C buses belong to i2c group by default?

1 Like

Hello,

GSoC had something to do w/ it, I think.

Seth

P.S. /dev/bone/i2c/

1 Like

What is GSoC?

Also, thank for the PS, I see /dev/bone/i2c contains symlinks to /dev/i2c, owned by root:

debian@BeagleBone:/dev$ ls -la /dev/bone/i2c
total 0
drwxr-xr-x 2 root root 100 Jan  1  2000 .
drwxr-xr-x 8 root root 160 Nov  1 07:35 ..
lrwxrwxrwx 1 root root  11 Nov  1 07:35 0 -> ../../i2c-0
lrwxrwxrwx 1 root root  11 Nov  8 02:42 2a -> ../../i2c-2
lrwxrwxrwx 1 root root  11 Nov  1 07:35 3 -> ../../i2c-1

What are you suggesting to do with that info though?

1 Like

oh…I know kernel 4.19.x works if you wanted to downgrade.

https://elinux.org/Beagleboard:BeagleBone_cape_interface_spec

google summer of code == GSoC

1 Like

Sorry, thanks for testing, looks like we misplaced a udev rule, I’ll take a look at this…

Update, something is fishy…

debian@BeagleBone:~$ uname -r
5.10.140-ti-r52          
debian@BeagleBone:~$ cat /etc/udev/rules.d/80-i2c-noroot.rules 
# /etc/udev/rules.d/80-i2c-noroot.rules
#
SUBSYSTEM=="i2c", GROUP="gpio", ACTION=="add", \
        RUN+="/bin/chgrp -R gpio '/sys%p'", \
        RUN+="/bin/chmod -R g=u '/sys%p'"
debian@BeagleBone:~$ ls -lha /dev/i2c*
crw-rw---- 1 root i2c 89, 0 Nov  1 21:08 /dev/i2c-0
crw-rw---- 1 root i2c 89, 1 Nov  1 21:08 /dev/i2c-1
crw-rw---- 1 root i2c 89, 2 Nov  1 21:08 /dev/i2c-2
debian@BeagleBone:~$ dpkg -S /etc/udev/rules.d/80-i2c-noroot.rules 
bb-customizations: /etc/udev/rules.d/80-i2c-noroot.rules
debian@BeagleBone:~$ dpkg --list | grep bb-customization
ii  bb-customizations                          1.20220913.0-0~bullseye+20220913              armhf        beagleboard.org customizations

Please run:

sudo beagle-version

Edit 2… so found it, subsystem changed…

udevadm test $(udevadm info --query=path --name=i2c-0)

now: SUBSYSTEM=i2c-dev vs SUBSYSTEM=i2c

now pushed out:

Regards

2 Likes

Thank you for finding and fixing @RobertCNelson!

Is there some way I can “pull in” or test that fix?

I tried sudo apt update && sudo apt upgrade and the group for i2c is still root.


In case you still needed it, here’s the output of sudo beagle-version (from before sudo apt update && sudo apt upgrade):

debian@BeagleBone:~$ uname -r
5.10.140-ti-r52
debian@BeagleBone:~$ sudo beagle-version
eeprom:[A335BNLT00C02218SBB12971]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[BeagleBoard.org Debian Bullseye Minimal Image 2022-11-01]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot SPL 2022.04-gd0771d53 (Jul 21 2022 - 02:13:23 +0000)]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot SPL 2019.04-g923f8b8 (Jan 02 2022 - 19:05:15 +0000)]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2019.04-g923f8b8]:[location: dd MBR]
UBOOT: Booted Device-Tree:[am335x-boneblack-uboot-univ.dts]
UBOOT: Loaded Overlay:[BB-ADC-00A0.kernel]
UBOOT: Loaded Overlay:[BB-BONE-eMMC1-01-00A0.kernel]
UBOOT: Loaded Overlay:[BB-HDMI-TDA998x-00A0.kernel]
kernel:[5.10.140-ti-r52]
/boot/uEnv.txt Settings:
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade <pkg>]
pkg:[bb-cape-overlays]:[4.14.20210821.0-0~bullseye+20210821]
pkg:[bb-customizations]:[1.20220913.0-0~bullseye+20220913]
pkg:[bb-usb-gadgets]:[1.20220816.0-0~bullseye+20220816]
pkg:[bb-wl18xx-firmware]:[1.20211222.2-0~bullseye+20211222]
pkg:[kmod]:[28-1]
WARNING:pkg:[librobotcontrol]:[NOT_INSTALLED]
pkg:[firmware-ti-connectivity]:[20210315-3]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal input netdev gpio admin i2c tisdk weston-launch bluetooth cloud9ide]
cmdline:[console=ttyS0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet]
dmesg | grep remote
[    8.734008] remoteproc remoteproc0: wkup_m3 is available
[   35.170141] remoteproc remoteproc0: powering up wkup_m3
[   35.170176] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217148
[   35.170502] remoteproc remoteproc0: remote processor wkup_m3 is now up
[   62.670881] remoteproc remoteproc1: 4a334000.pru is available
[   62.701459] remoteproc remoteproc2: 4a338000.pru is available
dmesg | grep pru
[   62.670881] remoteproc remoteproc1: 4a334000.pru is available
[   62.701459] remoteproc remoteproc2: 4a338000.pru is available
dmesg | grep pinctrl-single
[    8.319440] pinctrl-single 44e10800.pinmux: 142 pins, size 568
dmesg | grep gpio-of-helper
[    8.321127] gpio-of-helper ocp:cape-universal: Failed to get gpio property of 'P8_03'
[    8.321155] gpio-of-helper ocp:cape-universal: Failed to create gpio entry
[    8.936644] gpio-of-helper ocp:cape-universal: Allocated GPIO id=0 name='P8_03'
[    8.936874] gpio-of-helper ocp:cape-universal: Allocated GPIO id=1 name='P8_04'
[    8.937053] gpio-of-helper ocp:cape-universal: Allocated GPIO id=2 name='P8_05'
[    8.937229] gpio-of-helper ocp:cape-universal: Allocated GPIO id=3 name='P8_06'
[    8.937702] gpio-of-helper ocp:cape-universal: Allocated GPIO id=4 name='P8_07'
[    8.937898] gpio-of-helper ocp:cape-universal: Allocated GPIO id=5 name='P8_08'
[    8.938071] gpio-of-helper ocp:cape-universal: Allocated GPIO id=6 name='P8_09'
[    8.938249] gpio-of-helper ocp:cape-universal: Allocated GPIO id=7 name='P8_10'
[    8.938442] gpio-of-helper ocp:cape-universal: Allocated GPIO id=8 name='P8_11'
[    8.938738] gpio-of-helper ocp:cape-universal: Allocated GPIO id=9 name='P8_12'
[    8.939010] gpio-of-helper ocp:cape-universal: Allocated GPIO id=10 name='P8_13'
[    8.939191] gpio-of-helper ocp:cape-universal: Allocated GPIO id=11 name='P8_14'
[    8.939355] gpio-of-helper ocp:cape-universal: Allocated GPIO id=12 name='P8_15'
[    8.939524] gpio-of-helper ocp:cape-universal: Allocated GPIO id=13 name='P8_16'
[    8.939703] gpio-of-helper ocp:cape-universal: Allocated GPIO id=14 name='P8_17'
[    8.939889] gpio-of-helper ocp:cape-universal: Allocated GPIO id=15 name='P8_18'
[    8.940067] gpio-of-helper ocp:cape-universal: Allocated GPIO id=16 name='P8_19'
[    8.940224] gpio-of-helper ocp:cape-universal: Allocated GPIO id=17 name='P8_20'
[    8.940403] gpio-of-helper ocp:cape-universal: Allocated GPIO id=18 name='P8_21'
[    8.940574] gpio-of-helper ocp:cape-universal: Allocated GPIO id=19 name='P8_22'
[    8.940736] gpio-of-helper ocp:cape-universal: Allocated GPIO id=20 name='P8_23'
[    8.940910] gpio-of-helper ocp:cape-universal: Allocated GPIO id=21 name='P8_24'
[    8.941067] gpio-of-helper ocp:cape-universal: Allocated GPIO id=22 name='P8_25'
[    8.941237] gpio-of-helper ocp:cape-universal: Allocated GPIO id=23 name='P8_26'
[    8.941412] gpio-of-helper ocp:cape-universal: Allocated GPIO id=24 name='P8_27'
[    8.941580] gpio-of-helper ocp:cape-universal: Allocated GPIO id=25 name='P8_28'
[    8.941764] gpio-of-helper ocp:cape-universal: Allocated GPIO id=26 name='P8_29'
[    8.941952] gpio-of-helper ocp:cape-universal: Allocated GPIO id=27 name='P8_30'
[    8.942119] gpio-of-helper ocp:cape-universal: Allocated GPIO id=28 name='P8_31'
[    8.942288] gpio-of-helper ocp:cape-universal: Allocated GPIO id=29 name='P8_32'
[    8.942454] gpio-of-helper ocp:cape-universal: Allocated GPIO id=30 name='P8_33'
[    8.942760] gpio-of-helper ocp:cape-universal: Allocated GPIO id=31 name='P8_34'
[    8.942949] gpio-of-helper ocp:cape-universal: Allocated GPIO id=32 name='P8_35'
[    8.943118] gpio-of-helper ocp:cape-universal: Allocated GPIO id=33 name='P8_36'
[    8.943298] gpio-of-helper ocp:cape-universal: Allocated GPIO id=34 name='P8_37'
[    8.943467] gpio-of-helper ocp:cape-universal: Allocated GPIO id=35 name='P8_38'
[    8.943637] gpio-of-helper ocp:cape-universal: Allocated GPIO id=36 name='P8_39'
[    8.943813] gpio-of-helper ocp:cape-universal: Allocated GPIO id=37 name='P8_40'
[    8.943978] gpio-of-helper ocp:cape-universal: Allocated GPIO id=38 name='P8_41'
[    8.944147] gpio-of-helper ocp:cape-universal: Allocated GPIO id=39 name='P8_42'
[    8.944305] gpio-of-helper ocp:cape-universal: Allocated GPIO id=40 name='P8_43'
[    8.944472] gpio-of-helper ocp:cape-universal: Allocated GPIO id=41 name='P8_44'
[    8.944646] gpio-of-helper ocp:cape-universal: Allocated GPIO id=42 name='P8_45'
[    8.944816] gpio-of-helper ocp:cape-universal: Allocated GPIO id=43 name='P8_46'
[    8.945003] gpio-of-helper ocp:cape-universal: Allocated GPIO id=44 name='P9_11'
[    8.945166] gpio-of-helper ocp:cape-universal: Allocated GPIO id=45 name='P9_12'
[    8.945344] gpio-of-helper ocp:cape-universal: Allocated GPIO id=46 name='P9_13'
[    8.945525] gpio-of-helper ocp:cape-universal: Allocated GPIO id=47 name='P9_14'
[    8.945690] gpio-of-helper ocp:cape-universal: Allocated GPIO id=48 name='P9_15'
[    8.945860] gpio-of-helper ocp:cape-universal: Allocated GPIO id=49 name='P9_16'
[    8.946038] gpio-of-helper ocp:cape-universal: Allocated GPIO id=50 name='P9_17'
[    8.946198] gpio-of-helper ocp:cape-universal: Allocated GPIO id=51 name='P9_18'
[    8.946369] gpio-of-helper ocp:cape-universal: Allocated GPIO id=52 name='P9_19'
[    8.946536] gpio-of-helper ocp:cape-universal: Allocated GPIO id=53 name='P9_20'
[    8.946820] gpio-of-helper ocp:cape-universal: Allocated GPIO id=54 name='P9_21'
[    8.946995] gpio-of-helper ocp:cape-universal: Allocated GPIO id=55 name='P9_22'
[    8.947162] gpio-of-helper ocp:cape-universal: Allocated GPIO id=56 name='P9_23'
[    8.947334] gpio-of-helper ocp:cape-universal: Allocated GPIO id=57 name='P9_24'
[    8.947825] gpio-of-helper ocp:cape-universal: Allocated GPIO id=58 name='P9_25'
[    8.948053] gpio-of-helper ocp:cape-universal: Allocated GPIO id=59 name='P9_26'
[    8.948231] gpio-of-helper ocp:cape-universal: Allocated GPIO id=60 name='P9_27'
[    8.948396] gpio-of-helper ocp:cape-universal: Allocated GPIO id=61 name='P9_28'
[    8.948597] gpio-of-helper ocp:cape-universal: Allocated GPIO id=62 name='P9_29'
[    8.948759] gpio-of-helper ocp:cape-universal: Allocated GPIO id=63 name='P9_30'
[    8.948935] gpio-of-helper ocp:cape-universal: Allocated GPIO id=64 name='P9_31'
[    8.949103] gpio-of-helper ocp:cape-universal: Allocated GPIO id=65 name='P9_41'
[    8.949285] gpio-of-helper ocp:cape-universal: Allocated GPIO id=66 name='P9_91'
[    8.949457] gpio-of-helper ocp:cape-universal: Allocated GPIO id=67 name='P9_42'
[    8.949626] gpio-of-helper ocp:cape-universal: Allocated GPIO id=68 name='P9_92'
[    8.949636] gpio-of-helper ocp:cape-universal: ready
END
sudo apt update
sudo apt upgrade
sudo reboot

Regards,

1 Like

Ha sudo reboot did the trick! It’s now part of the gpio group:

debian@BeagleBone:~$ ls -l /dev/i2c*
crw-rw---- 1 root gpio 89, 0 Nov  8 18:17 /dev/i2c-0
crw-rw---- 1 root gpio 89, 1 Nov  8 18:17 /dev/i2c-1
crw-rw---- 1 root gpio 89, 2 Nov  8 18:17 /dev/i2c-2

Thank you both @RobertCNelson and @silver2row, case closed!

1 Like