[yocto] [meta-raspberrypi][PATCH] Add networkd as default for RaspberryPi

Herve Jourdain herve.jourdain at neuf.fr
Thu Jul 23 15:45:29 PDT 2015


Well, I'm using Poky as a "distribution", at least for my tests...
But there might be a reason why it's not included there, I believe.
The problem to include it at the distribution level is you need to make assumptions as to what kind of network/network interfaces will be found.
On a raspberrypi, we know there will be at least an Ethernet available, so starting networkd and resolved makes sense.
But at the Poky distribution level, it can run on any kind of hardware, including those without any network capability.
So I believe it can't really be easily done at the distribution layer itself either, unless there is some kind of understanding networking will be required.

Therefore, my problem: if we want raspberrypi to start network out of the box, because we know it has the HW to support it, then we should do something at the raspberrypi layer, if it can not be supported at the distribution layer.

As I mentioned, I had initially kept that in a custom layer of mine.
But if it stays there, that means anyone starting poky on a raspberrypi using system will have to do its own layer with the bbappend, similar to that.
So I'm trying to find a way to make this work out of the box, with systemd, on raspberrypi, for everyone, and I'm not sure what's the best way to achieve this indeed.

BR,

Herve

-----Original Message-----
From: Mauro Carvalho Chehab [mailto:mchehab at osg.samsung.com] 
Sent: jeudi 23 juillet 2015 20:28
To: Herve Jourdain
Cc: 'Andrei Gherzan'; 'Petter Mabäcker'; yocto at yoctoproject.org
Subject: Re: [yocto] [meta-raspberrypi][PATCH] Add networkd as default for RaspberryPi

Em Thu, 23 Jul 2015 18:25:29 +0200
Herve Jourdain <herve.jourdain at neuf.fr> escreveu:

> Hi Mauro,
> 
> Well, that's precisely one of my concerns. I believe that one of the Tizen layers might do just that. 

Yes, it does. It is at the meta-tizen layer.

> Maybe it should be at the Yocto layer.
>
> But it seems not to be with the one I'm using. And just enabling system - which can be done at distro level - is not enough, there is a need for a bbappend and a config file.
> So honestly, since I was experimenting with system, I stumbled on this one, and I had initially put that patch in another layer - custom one.
> 
> The question that remains is how do we make sure that Poky on raspberry pi has network enabled by default when people switch to system? Since I don't know where else to put it, I decided to propose the patch for the raspberrypi layer, knowing it probably makes more sense to put it somewhere else.

I'd say that it should not be at the Yocto layer, but at the layer specific for your distribution.

> 
> BR,
> 
> Herve
> 
> -----Original Message-----
> From: Mauro Carvalho Chehab [mailto:mchehab at osg.samsung.com]
> Sent: jeudi 23 juillet 2015 18:00
> To: Herve Jourdain
> Cc: 'Andrei Gherzan'; 'Petter Mabäcker'; yocto at yoctoproject.org
> Subject: Re: [yocto] [meta-raspberrypi][PATCH] Add networkd as default 
> for RaspberryPi
> 
> Em Thu, 23 Jul 2015 17:32:35 +0200
> Herve Jourdain <herve.jourdain at neuf.fr> escreveu:
> 
> > This patch adds systemd-networkd for RaspberryPi in the 
> > meta-raspberrypi layer, in order to have Ethernet and Networking work out of the box.
> > 
> >  
> > 
> > This said, I’m not 100% sure if it should be enabled in 
> > meta-raspberrypi, instead of another custom layer.
> > 
> > But something similar needs to be added somewhere, and with the 
> > current version of Yocto on RaspberryPi, without this patch, network 
> > just doesn’t start…
> 
> I guess putting it at BSP is not right. Ethernet network does work on Tizen on Yocto:
> 	http://blogs.s-osg.org/tizen-rpi2-now-supporting-3d-acceleration/
> 
> Regards,
> Mauro
> 
> 
> > 
> >  
> > 
> > Signed-off-by: Herve Jourdain <herve.jourdain at neuf.fr 
> > <mailto:herve.jourdain at neuf.fr> >
> > 
> > ---
> > 
> > diff -Naur
> > meta-raspberrypi.orig/recipes-core/systemd/files/eth.network
> > meta-raspberrypi/recipes-core/systemd/files/eth.network
> > 
> > --- meta-raspberrypi.orig/recipes-core/systemd/files/eth.network
> > 1970-01-01 08:00:00.000000000 +0800
> > 
> > +++ meta-raspberrypi/recipes-core/systemd/files/eth.network    2015-07-22
> > 12:01:53.587830690 +0800
> > 
> > @@ -0,0 +1,6 @@
> > 
> > +[Match]
> > 
> > +Name=eth*
> > 
> > +
> > 
> > +[Network]
> > 
> > +DHCP=v4
> > 
> > +
> > 
> > diff -Naur
> > meta-raspberrypi.orig/recipes-core/systemd/systemd_%.bbappend
> > meta-raspberrypi/recipes-core/systemd/systemd_%.bbappend
> > 
> > --- meta-raspberrypi.orig/recipes-core/systemd/systemd_%.bbappend
> > 1970-01-01 08:00:00.000000000 +0800
> > 
> > +++ meta-raspberrypi/recipes-core/systemd/systemd_%.bbappend
> > 2015-07-22 12:05:07.307838546 +0800
> > 
> > @@ -0,0 +1,17 @@
> > 
> > +FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
> > 
> > +
> > 
> > +EXTRA_OECONF += "--disable-ldconfig"
> > 
> > +
> > 
> > +PACKAGECONFIG += "networkd resolved"
> > 
> > +
> > 
> > +CFLAGS_append_arm = " -fno-lto"
> > 
> > +
> > 
> > +SRC_URI += "file://eth.network"
> > 
> > +
> > 
> > +FILES_${PN} += "{sysconfdir}/systemd/network/*"
> > 
> > +
> > 
> > +do_install_append() {
> > 
> > +    install -d ${D}${sysconfdir}/systemd/network/
> > 
> > +    install -m 0644 ${WORKDIR}/*.network 
> > + ${D}${sysconfdir}/systemd/network/
> > 
> > +}
> > 
> > +
> > 
> >  
> > 
> 




More information about the yocto mailing list