Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5229

Raspberry Pi OS • Write to /sys/kernel/debug while OverlayFs is enabled

$
0
0
My current setup starts a system service during booting that opens a BLE server.
For that I use the hci0 interface. Since my BLE clients need a "shorter" advertising time I reduce the value in /sys/kernel/debug/bluetooth/hci0/adv_max_interval and _min_ to a value coresponding with 100ms. All of that works pretty well during normal operation.

But once I enable the OverlayFs I am not able to write to /sys/kernel/debug/... anymore.
> Not manually

Code:

sudo nano /sys/kernel/debug/bluetooth/hci0/adv_max_interval[ Error writing /sys/kernel/debug/bluetooth/hci0/adv_max_interval: Invalid argument ]
> and not from the service:

Code:

Sep 25 22:28:50 raspberrypi4 systemd[1]: Started laufsensor.service.Sep 25 22:29:01 raspberrypi4 bash[488]: /var/dev/Laufsensor/PrototypeOnRP4/StartLaufsensor.sh: line 6: /sys/kernel/debug/bluetooth/hci0/adv_min_interval: No such file or directorySep 25 22:29:01 raspberrypi4 bash[488]: /var/dev/Laufsensor/PrototypeOnRP4/StartLaufsensor.sh: line 7: /sys/kernel/debug/bluetooth/hci0/adv_max_interval: No such file or directorySep 25 22:29:06 raspberrypi4 bash[641]: 2024-09-25 22:29:06,831 - __main__ - INFO - Registering GATT application...Sep 25 22:29:06 raspberrypi4 bash[641]: 2024-09-25 22:29:06,892 - __main__ - CRITICAL - Failed to register advertisement: org.bluez.Error.NotPermitted: Maximum advertisements reachedSep 25 22:29:06 raspberrypi4 systemd[1]: laufsensor.service: Succeeded.Sep 25 23:22:50 raspberrypi4 systemd[1]: /lib/systemd/system/laufsensor.service:1: Assignment outside of section. Ignoring.Sep 25 23:22:50 raspberrypi4 systemd[1]: /lib/systemd/system/laufsensor.service:2: Assignment outside of section. Ignoring.Sep 25 23:22:50 raspberrypi4 systemd[1]: /lib/systemd/system/laufsensor.service:3: Assignment outside of section. Ignoring.)
The output of mount is as following:

Code:

Simon@raspberrypi4:/ $ mountsysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)proc on /proc type proc (rw,relatime)udev on /dev type devtmpfs (rw,nosuid,relatime,size=1772412k,nr_inodes=443103,mode=755)devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=388544k,mode=755)overlay on / type overlay (rw,noatime,lowerdir=/lower,upperdir=/upper/data,workdir=/upper/work)securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime)systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=30,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)sunrpc on /run/rpc_pipefs type rpc_pipefs (rw,relatime)tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)/dev/mmcblk0p1 on /boot type vfat (ro,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=388540k,nr_inodes=97135,mode=700,uid=1000,gid=1000)tracefs on /sys/kernel/debug/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)[code]On the other side, when OverlayFs is disabled... everything works:> The service fires up and works (I can find the BLE adverticing in the correct timeing)[code]The service produces debugging output, so nothing to see here...
The output of mount while OverlayFs is disabled is

Code:

Simon@raspberrypi4:~ $ mount/dev/mmcblk0p2 on / type ext4 (rw,noatime)devtmpfs on /dev type devtmpfs (rw,relatime,size=1776952k,nr_inodes=444238,mode=755)proc on /proc type proc (rw,relatime)sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)tmpfs on /run type tmpfs (rw,nosuid,nodev,size=777088k,nr_inodes=819200,mode=755)tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=30,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)sunrpc on /run/rpc_pipefs type rpc_pipefs (rw,relatime)mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)/dev/mmcblk0p1 on /boot type vfat (ro,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=388540k,nr_inodes=97135,mode=700,uid=1000,gid=1000)[code]Any idea, how I can get write access to the /sys/kernel/debug also with overlayFs enabled?

Statistics: Posted by SchumiBW — Wed Sep 25, 2024 10:11 pm



Viewing all articles
Browse latest Browse all 5229

Trending Articles