Re: replace etc/network/interfaces with symbolic link


Bryan Evenson
 

Aurèle,

-----Original Message-----
From: Aurele Traynard [mailto:aurele.traynard@...]
Sent: Monday, February 09, 2015 4:59 AM
To: Bryan Evenson
Cc: yocto@...
Subject: Re: [yocto] replace etc/network/interfaces with symbolic link

Thank you for all answers, I looked


In fact I found another problem, even if I modify the original recipe I can't get
a modified rpm, or rootfs...
I commented lines concerning interfaces files but it seems that nothing is
modified in the rootfs and in the rpm...
if someone understands what I missed...

the bitbake file :
http://git.yoctoproject.org/cgit.cgi/poky/plain/meta/recipes-core/init-
ifupdown/init-ifupdown_1.0.bb
and I commented out :
#install -m 0644 ${WORKDIR}/interfaces
${D}${sysconfdir}/network/interfaces
#CONFFILES_${PN} = "${sysconfdir}/network/interfaces"

If you comment those lines out, then ${sysconfdir}/network/interfaces should not be in the built RPM. So either there is a .bbappend that is adding the file back in, or the package isn't being rebuilt. Try checking the following to see what may be happening:

1. Check the creation date on the init-ifupdown RPM. If the RPM has not been re-created since the last time you modified the recipe, then the RPM is not being rebuilt with your changes. If you are not running a PR server, then you need to increment the PR version in your .bbappend. See http://www.yoctoproject.org/docs/1.7.1/dev-manual/dev-manual.html#working-with-a-pr-service for details on the PR service and how to handle PRs without the PR service. Note that if you are on an older poky branch that the steps for handling the PR service may be slightly different. Read the version of documentation that matches your current branch.
2. If the RPM is being rebuilt, extract the RPM on your build machine to look at its contents. If the interfaces file is still there, then there is still something not working right with the do_install step. Under tmp/work/<MACHINE>/init-ifupdown/<PV-PR>/temp/, open the file run.do_install (the filename will have a PID appended to the end, so it'll be named something like run.do_install.15612. If there are multiple in the temp directory, make sure you look at the latest one). In this file is the final do_install script that is run when performing the install step for the recipe. If this does not look like what you want, then something between the main recipe and the .bbappends are building the do_install step incorrectly.

Since you are removing files that the original recipe adds, the cleanest approach may be to leave the original recipe untouched and to replace the do_install step in your .bbappend. If you modify the main recipe, later on if you switch to a different poky branch you'll lose your changes.

Regards,
Bryan

Aurèle


2015-02-06 20:38 GMT+01:00 Bryan Evenson <bevenson@...
<mailto:bevenson@...> >:


Aurele,

One possible issue is ${sysconfdir}/network/interfaces is listed in the
CONFFILES in the original recipe. It may still be installing this file because it is
listed under CONFFILES. Try adding:

CONFFILES_${PN} = ""

To your bbappend.

Regards,
Bryan


> -----Original Message-----
> From: yocto-bounces@... <mailto:yocto-
bounces@...> [mailto:yocto- <mailto:yocto->
> bounces@... <mailto:bounces@...> ]
On Behalf Of Aurele Traynard
> Sent: Friday, February 06, 2015 10:55 AM
> To: yocto@... <mailto:yocto@...>
> Subject: [yocto] replace etc/network/interfaces with symbolic link
>
> Hi,
>
>
> I'm trying to find a clean way to replace /etc/network/interfaces
with a
> symbolic link. (it comes with init-ifupdown recipe) I tried with a
bbappend
> but nothing appear in final filesystem and /etc/network/interfaces
still
> exists...
>
>
> I'm sure the following code is completely wrong, but I don't know
how to do
> this with the right way...
> do_install_append () {
> mkdir -p datas/network
>
> install -d 0755 ${D}/datas
> install -d 0755 ${D}/datas/network
> install -m 0755 ${D}${sysconfdir}/network/interfaces
${D}/datas/network
> #mv ${D}${sysconfdir}/network/interfaces ${D}/datas/network
> rm ${D}${sysconfdir}/network/interfaces
> ln -sf /datas/network/interfaces
${D}${sysconfdir}/network/interfaces
>
> }
> FILES_${PN} += "/datas/ /datas/network/interfaces"
>
>
> thanks for any help
>


Join {yocto@lists.yoctoproject.org to automatically receive all group messages.