Ifplugd instead of Connmand

Hello,

I am investigating of use old Ifplugd instead of Connmand utility. I am doing this for save of resources and backward compatibility. Connmand requires use of Glib2 and this asks lot of device resources. On the other hand, we need only tricker notifies plugging and unplugging ethernet cable and ifplugd is enough in this situation. Ifplug is also easier to fit in our own application.

Backround: I have set up OE environment with these instructions and mostly all works perfectly: High performance, low power Embedded Computing Systems | Toradex Developer Center

Bitbake does find connman utility, connman it is possible to install and connman goes well, I have seen. But as i said, I am trying to use lighter alternative, ifplugd, because it it enough in our situation.

Ifpludg is possible to install from Busybox package with:

bitbake busybox -c menuconfig

Ifplugd installs and is possible to use, but no configuration files is installed.

With Buildroot environment, it also uses Busybox package and there is also option to choose ifplugd to compile. When I chose ifplugd in this way, this goes well and there is installed a new folder and three files regarding ifplugd:

/etc/ifplugd/

/etc/ifplugd/ifplugd.action

/etc/ifplugd/ifplugd.conf

/etc/init.d/S45ifplugd

My question is: is there automatic way to do this possible with Toradex OE environment also? Does upper level OE overwrite down level Busubox installation and so ifplugd configuration files are not installed? Is there way to avoid this?

BR Ossi Syri Ouman Oy

The configuration files you mention above seem to originate from the non-Busybox variant of ifplugd (see ifplugd 0.28). There seem to be no recipe to build this variant of ifplugd currently.

There are some example scripts provided in the source repository: ifplugd_if « var_service « examples - busybox - BusyBox: The Swiss Army Knife of Embedded Linux
However I am not sure if those are generic enough to be installed by default…

So you have two options:

  • Either create a new recipe which builds the non-Busybox variant (and installs those configuration files)
  • Use the Busybox variant and use/install the example configuration files.

Busybox installs configuration files depending on configuration options (see busybox.inc). Something along this lines should allow to install

if grep -q "CONFIG_IFPLUGD=y" ${B}/.config; then
	install -d ${D}${sysconfdir}/ifplugd
	install -m 644 ${WORKDIR}/... ${D}${sysconfdir}/ifplugd/...
	...
fi

Depending on your exact needs, systemd might have some viable solutions too, see NetworkTarget