Make KERNEL_DEVMEM [=y] the default on targets with GPIOs

Could we please have KERNEL_DEVMEM [=y] as the default for targets with GPIOs? I guess this mostly applies to SBCs like Raspberry Pi, etc, but there may be others.

Back story: this is because I want to run pigpiod on a Raspberry Pi and that daemon needs /dev/mem to work.

I will attempt to make a pigpio package but such a package would be pretty useless if the end user would have to rebuild their kernel to use it.

devmem by default is not wanted for security reasons, the predominant usage of OpenWrt is being a router after all. Export your GPIOs instead (may require a dts overlay).

2 Likes

I figured security might be an issue which is why I said to only apply this to targets with GPIOs like SBCs. Not the sort of device that is likely to be used in a high security environment.

Raspbian comes with /dev/mem out of the box so I'm guessing many people don't share this concern.

Sadly pigpiod (aka. Raspberry Pi remote GPIO) needs /dev/mem.

BTW, when you mention 'export' of GPIO, are you referring to the sysfs (/sys/class/gpio) interface? Just that seems to have been deprecated long ago in preference to the char interface.

Both the RPi4 and rockchip are often used as router with OpenWrt.

You are wrong, no system nowadays ships with unrestricted memory access.