[OE-core] [PATCH] iproute2: create symbol link '/bin/ip' to '/sbin/ip.iproute2'

Andreas Oberritter obi at opendreambox.org
Fri Jul 13 09:14:31 UTC 2018


On Fri, 13 Jul 2018 02:06:41 +0000
"Bai, Haiqing" <Haiqing.Bai at windriver.com> wrote:

> Yes,  you are right.
> 
> The reasons that why not fix ifupdown like below:
> 1.  Some packages assume 'iproute' is their default dependency, not only 'ifupdown'.
> 
> 2. Of course,  the source code of 'ifupdown' is very ugly,  not only  C code but also configure files used lots of shell command with absolute path:

[...]

> 3.  I have checked all the shell commands used in the current version ,  except "/bin/ip",   other commands' path are right  and same to the path in our rootfs. 

I just noticed that Debian and Ubuntu install ip to /bin and create a symlink from /sbin/ip to /bin/ip. How do other distributions like Fedora handle it?

Where does busybox install it to?

If ip gets provided by both iproute2 and busybox, will there be conflicts? If the new symlink doesn't get handled by update-alternatives, /bin/ip might point to iproute2 and /sbin/ip to busybox at the same time.

I think that the ip binary should be moved to /bin and the symlink in /sbin should be handled by update-alternatives, too, for both busybox and iproute2.

Regards,
Andreas


> 
> B,R
> Haiqing Bai  
> 
> -----Original Message-----
> From: MacLeod, Randy 
> Sent: 2018年7月13日 4:19
> To: Andreas Oberritter; openembedded-core at lists.openembedded.org; Bai, Haiqing
> Subject: Re: [OE-core] [PATCH] iproute2: create symbol link '/bin/ip' to '/sbin/ip.iproute2'
> 
> On 07/11/2018 04:41 AM, Andreas Oberritter wrote:
> > On Wed, 11 Jul 2018 14:01:17 +0800
> > Haiqing Bai <Haiqing.Bai at windriver.com> wrote:
> >   
> >> Some applications which depend on iproute/iproute2 need to
> >> run '/sbin/ip.iproute2' through the symbol link '/bin/ip'
> >> e.g ifupdown.  
> > 
> > Update-alternatives is supposed to create this link already.  
> 
> I assume that update-alternatives is creating
>     /sbin/ip -> /sbin/ip.iproute2
> but for some reason ipupdown is looking for
>     /bin/ip
> 
> Is that right Haiqing ?
> 
> Why not fix ifupdown?
> 
> ../Randy
> 
> >   
> >>
> >> Signed-off-by: Haiqing Bai <Haiqing.Bai at windriver.com>
> >> ---
> >>   meta/recipes-connectivity/iproute2/iproute2.inc | 2 ++
> >>   1 file changed, 2 insertions(+)
> >>
> >> diff --git a/meta/recipes-connectivity/iproute2/iproute2.inc b/meta/recipes-connectivity/iproute2/iproute2.inc
> >> index 4fbfec6f08..71d04a1021 100644
> >> --- a/meta/recipes-connectivity/iproute2/iproute2.inc
> >> +++ b/meta/recipes-connectivity/iproute2/iproute2.inc
> >> @@ -29,6 +29,8 @@ do_configure_append () {
> >>   do_install () {
> >>       oe_runmake DESTDIR=${D} install
> >>       mv ${D}${base_sbindir}/ip ${D}${base_sbindir}/ip.iproute2
> >> +    install -d ${D}${base_bindir}
> >> +    ln -s ${base_sbindir}/ip.iproute2 ${D}${base_bindir}/ip
> >>       install -d ${D}${datadir}
> >>       mv ${D}/share/* ${D}${datadir}/ || true
> >>       rm ${D}/share -rf || true  
> >   
> 
> 




More information about the Openembedded-core mailing list