How to configure networking using systemd in Yocto Project

OK
but I added “BB_DANGLINGAPPENDS_WARNONLY ?= “true”” line to “conf/local.conf” file and change it to warning and do the bitbake building. I can’t see *.network files in the systemd/network directory, so I added manually in the OS and rebooted. all things are OK and working fine.

Good to hear. Changing it to a warning is fine to get a successful build but as you discovered that will result in the config files not being available on the target.

Hi,

I have tried above steps but i m getting error while testing the ethernet connection.

$root > ifconfig eth0
ifconfig: eth0: error fetching interface information: Device not found

can some one help on this?

Hi @Amrun-Nisha-R, welcome to Mender hub.
What board are you using for this? What does “ifconfig -a” show?

Drew

Hi Drew,

I m using DART-MX8M board (imx8mq-var-dart). When I gave command ifconfig -a , I got below error.

It looks like your filesystem is corrupt. The original invocation of ifconfig worked above but now it is giving filesystem errors.

Note that it doesn’t look like that board has an ethernet interface so the original report of “Device not found” is likely correct.

Drew

Sorry Drew,

I have uploaded the wrong image. This is the error message that i got from the board.

image

OK. That means there is no network interface with a proper driver and firmware. Did you follow the instructions from here for the build? I think if you make sure the DISTRO is set to fslc-xwayland then all the appropriate bits will be installed.

Drew

Actually I m using DISTRO as fsl_wayland to build the core-image-minimal and I have followed the instructions from the variscite http://variwiki.com/index.php?title=Yocto_Build_Release&release=RELEASE_SUMO_V2.1_DART-MX8M . And also I didn’t need X11 configurations.

I don’t think core-image-minimal includes extra drivers and firmware blobs by default. You may have better luck using core-image-base.

Drew

Hi Drew,
What are all the drivers need to be added in the core-image-minimal?
And how can i add those things based on the configuration files?
How can i enable the connman service in core-image minimal?

Here’s a thread from the Yocto mailing list that discusses this a bit: https://yocto.yoctoproject.narkive.com/4SX0Ghao/basic-question-core-image-minimal-v-s-core-image-base

Basically core-image-minimal is intended to be the absolute bare minimum to get a system to boot. core-image-base is intended to be more usable as a full-fledged Linux system.

Looking at a diff between core-image-minimal.bb and core-image-base.bb it appears that the substantive difference in core-image-base is:

IMAGE_INSTALL = "packagegroup-core-boot ${CORE_IMAGE_EXTRA_INSTALL}"

So adding those two packages should get you what you need. But that will be virtually the same as just using core-image-base. Is there a reason you want to modify core-image-minimal instead of using core-image-base?

Drew

Actually core-image-minimal is 16MB size but core-image-base is 92.5MB. And also I didn’t need all the services of core-image-base. I only have minimum requirement like enable ethernet driver and also I have size constraint. I have tried with those package update. If you append "IMAGE_INSTALL = “packagegroup-extended”, then the core-image-minimal also having the 92.5MB size. I have tried by adding the individual packages from the package extendend but nothing is working fine.

In that case you probably need to investigate what Variscite has set for the MACHINE_EXTRA_RRECOMMENDS variable. That may contain the packages needed. I suggest a followup on their forums since it will be heavily dependent on how they implemented the platform layer.

Drew

To whome it may concern: My problems from above seem to have been because I was running thud. I just upgraded to zeus which broke my network config. Changing back to your filename for the conf file worked.

So everthing worked for me on thud using the filename “wpa_supplicant-wlan0.conf” and now it works on zeus with filename “wpa_supplicant-nl80211-wlan0.conf”.

Hi Hub Members,
According to Variscite (http://variwiki.com/index.php?title=Static_IP_Address):
ConnMan is the default Yocto network manager.
Systemd-networkd will conflict with it.
Do you recommend to use it and turn off ConnMan? Why? How?
Thank You
Israel

This is really going to be driven by your products requirements as to what you need and which gives you what you need. :slight_smile:

Personally i use Systemd-networkd (on variscite products as well custom ones) as i have to use it so heavily for others parts of my headless embedded products, local and cloud corporate servers. I had no need for anything else. But as i mentioned your requirements may differ.

@drewmoseley,
I found your excellent slides that can be helpful for this page’s visitors.

Thanks for finding that. It slipped my mind.

I didn’t realize that connman was the default but my local setups mostly use systemd-networkd. connman and NetworkManager may be better for devices that are going to be used in more dynamic situations as systemd-networkd doesn’t have any good frontends that I am aware of and mainly require editing config files.

Drew

10 posts were split to a new topic: Issues with systemd-networkd