Dev/mem virtual device support for libmraa

I found that libmraa depends on the kernel build option dev/mem virtual device support and would like to create a PR where libmraa automaticaly selects that option if it is chosen in make menuconfig. I already added once a library to a target but this seams different.

i found libmraa in /package/feeds/packages/libmraa and the part where i think it has to be added is:

define Package/libmraa
  $(call Package/libmraa/Default)
  TITLE:=Intel IoT lowlevel IO C/C++ library
  DEPENDS:=+libstdcpp +libjson-c @!arc @!armeb @!powerpc     <--- here? 

But I can't find out what its name is.

Is that the right place and where can I find the precise name of dev/mem virtual device support?

This option is in kernelmenu

DEVKMEM is intentionally disabled in official builds, while you can obviously change that setting for your own builds, automatically selecting it from libmraa won't be accepted (as that would effectively revert the global decision to keep it disabled).

1 Like

So how can we overcome the problem that mraa users will always be unable to use it without the knowleadge about that detail.
It took me quite long to recognize and overcome the failure...

Should libmraa been banned?

Alternatively you could realize that there is no bug, if you don't want to lose libmraa altogether.

1 Like

Can you elaborate a bit further? I do not understand what you mean.
What Iwant to do is to make libmraa work...

Access to /dev/kmem on a security-sensitive device is "highly frowned upon", to be polite.

As a result, it is not enabled in "standard" OpenWrt builds.

Neither is it available on a default Debian install, for example.

If you wish to run programs that depend on libmraa under OpenWrt, you will need to build your own firmware from source.

Another option is to select an OS that is more lax about security.

1 Like

With that caveat, instructions on how to use devkmem are in the first link.

Unless you find a way to change libmraa in a way that doesn't require /dev/kmem access anymore, your only option to "fix" the dependency relation would be to remove the libmraa package from the repo. This would mean that even those who do build the kernel with DEVKMEM access allowed (in their personal builds), wouldn't have libmraa available - progress…?!

Alternatively you could accept the status quo, namely that libmraa isn't usable in official builds, but remains available for those who do build their own firmware.


I only want to automatically add DEVMEM if the user makes an own firmware and includes libmraa.
No official Builds. Does that difference exist?

Packages can’t change kernel config when installed or built. The kernel has a single config for all devices on the same target/sub-target. Since /dev/kmem, as far as I know, can’t be built as a module, you can’t “install” it as a dependency.


If you want to "warn" other users, you could find all the packages that depend on libmraa and add to their description something along the lines of:

WARNING: This package will not run on unmodified OpenWrt builds.

libmraa requires /dev/kmem which is disabled for security reasons. 
Users who understand and accept the severe risks of enabling /dev/kmem 
will need to build a custom kernel and ROM from source to use this package.

You can find the packages that depend on libmraa with something like

find feeds -name Makefile -exec fgrep -H libmraa {} \;

then finding all that depend on those packages, ...

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.