0

I am tying to load a dtbo at runtime with cat my.dtbo > sys/kernel/config/device-tree/overlays/dtbo.

However the dir sys/kernel/config/device-tree/overlays does not exist and creating it with mkdir -p sys/kernel/config/device-tree/overlays says 'Operation not permitted'.

What am I missing?


The Kernel configs should be correct:

$ zcat /proc/config.gz | grep CONFIGFS_FS
CONFIG_CONFIGFS_FS=y
$ zcat /proc/config.gz | grep CONFIG_OF_OVERLAY
CONFIG_OF_OVERLAY=y

I have also tried to mount the configfs:

$ mount -t configfs none /sys/kernel/config/
mount: /sys/kernel/config: none already mounted on /sys/fs/bpf.

In /sys/fs/bpf I can create the device-tree/overlay' directory. But cat my.dtbo > sys/fs/bpp/device-tree/overlays/dtboreturns still aPermission denied`

Im am using a Phyboard Pollux, with an i.MX 8M plus with Yocto:

$ lsb_release -a
Distributor ID: ampliPHY
Description:    ampliPHY GNU/Linux BSP-Yocto-NXP-i.MX8MP-PD22.1.0 (hardknott)
Release:        BSP-Yocto-NXP-i.MX8MP-PD22.1.0
Codename:       hardknott

The loading with U-Boot does work. So the problem is not with the dtbo file

flobue
  • 69
  • 1
  • 6
  • What type of filesystem is actually mounted on `/sys/fs/bpf`? Does `mount -t configfs configfs /sys/kernel/config` work? You are supposed to create a directory for the overlay inside the `[your-configfs-mountpoint]/device-tree/overlays` directory and then write the `my.dtbo` file to the `dtbo` file in that created directory. E.g. if configfs is mounted on `/sys/kernel/config`, the `/sys/kernel/config/device-tree/overlays` directory should have already been created automatically. (cont....) – Ian Abbott May 10 '23 at 17:37
  • (...cont) Then `mkdir /sys/kernel/config/device-tree/overlays/my` should create `/sys/kernel/config/device-tree/overlays/my/dtbo` automatically, and `cat my.dtbo > /sys/kernel/config/device-tree/overlays/my/dtbo` should load the overlay from the `my.dtbo` file. – Ian Abbott May 10 '23 at 17:40
  • 1
    You also need to enable `CONFIG_OF_CONFIGFS` in the kernel patched to support the DT-Overlay configfs interface. Does your kernel have the required patch series to support that? – Ian Abbott May 10 '23 at 17:45
  • Thanks for your answer. `$ mount -t configfs configfs /sys/kernel/config` return 32. However `$ mount | grep configfs` returns `configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)`. I have no idea why, this is not mounted at a different location. For the past two days it was always mounted on `/sys/fs/bpf`. I cannot find the `CONFIG_OF_CONFIGS` flag in the menuconfig. Here I found probably a [workaround](https://stackoverflow.com/questions/50877808/configfs-do-not-mount-device-tree-overlays) to this. However I didnt have the time to try it yet. Thanks! – flobue May 11 '23 at 11:54
  • I use the series of patches at branch [topic/overlays](https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git/log/?h=topic/overlays) (for latest kernel), or look for older `topic/overlays-vX.YY-rcN` branches (for older kernels) at [renesas-drivers.git](https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git/refs/heads) – Ian Abbott May 11 '23 at 17:42

0 Answers0