[yocto] interfaces file on a per-image basis

Allan Matthew amatthew at 3drobotics.com
Wed Jul 23 16:14:11 PDT 2014


Thanks Nicolas!  Option 3 worked perfectly.  I just added two interfaces
files (interfaces-client, interfaces-server) to my init-ifupdown bbappend,
and using a ROOTFS_POSTPROCESS_COMMAND in my image recipe I replace the
/etc/network/interfaces file with one of the two depending on the image.

*Allan Matthew*
Embedded Software Engineer, 3DRx
*3D Robotics*
(858) 225-1414
website <http://www.3dr.com/> | facebook
<http://www.facebook.com/3drobotics> | instagram
<http://www.instagram.com/3drobotics>


On Wed, Jul 23, 2014 at 3:38 PM, Nicolas Dechesne <
nicolas.dechesne at linaro.org> wrote:

> On Thu, Jul 24, 2014 at 12:25 AM, Allan Matthew <amatthew at 3drobotics.com>
> wrote:
> > I have two separate images, call them server and client.  The client will
> > have one /network/interfaces file and the server will have another.  I
> can
> > successfully override the init-ifupdown in my own bbappend in my layer
> and
> > use one of my interface files, but I can't figure out how to pick between
> > two interface files depending on the image I'm building.  Is there a
> > variable I should be able to examine to determine which interfaces file I
> > should use in my .bbappend?
>
> nope you can't really do that. each recipe (.bb file) is built
> independently. it's true for 'normal' recipe (component, libs, ..) but
> also images which are .bb files too. so when you build init-ifupdown,
> bitbake doesn't know if the package will be installed in image-server
> or image-client.
>
> >
> > The only other option I've found is to use two separate machines, which
> is
> > not a great option for me because the hardware and almost all of the
> > packages are identical between my client and server, so I'd like to just
> be
> > able to build two separate images instead of changing machine types as
> well.
>
> well, machine conf are used to identify h/w settings. so in your case,
> it would be wrong as you guessed. if the underlying h/w is the same,
> you should use the same machine.
>
> i can see a couple of options:
> - create multiple init-ifupdown packages (duplicate them) and pick one
> or the other in the image recipe. or maybe you can split the network
> interface config from init-ifdown (e.g. remove the file from this
> package), and create 2 new packages that provide this file and pick
> the one you need in your image.
> - you can use  ROOTFS_POSTPROCESS_COMMAND to run a custom script that
> will modify the image accordingly
>
> there are certainly other options ...
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20140723/463d9c80/attachment.html>


More information about the yocto mailing list