* [PATCH v2 1/2] iproute2: install tools to mirror install under Debian/Ubuntu
@ 2020-12-05 8:22 Alan Perry
2020-12-05 8:22 ` [PATCH v2 2/2] iproute2: rearrange FILES to improve readability Alan Perry
2020-12-07 21:49 ` [OE-core] [PATCH v2 1/2] iproute2: install tools to mirror install under Debian/Ubuntu Richard Purdie
0 siblings, 2 replies; 6+ messages in thread
From: Alan Perry @ 2020-12-05 8:22 UTC (permalink / raw)
To: openembedded-core; +Cc: Alan Perry
Many scripts exist that expect the iproute2 tools to be found in
the same directories where they are found in Debian or Ubuntu.
For the iproute2 tools included in the iproute2 recipe, move
them to those directories or create links there.. Also, add
bash-completion files as is done by Debian and Ubuntu.
Signed-off-by: Alan Perry <alanp@snowmoose.com>
---
.../iproute2/iproute2.inc | 23 +++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)
diff --git a/meta/recipes-connectivity/iproute2/iproute2.inc b/meta/recipes-connectivity/iproute2/iproute2.inc
index 403d264308..de5c63a6e3 100644
--- a/meta/recipes-connectivity/iproute2/iproute2.inc
+++ b/meta/recipes-connectivity/iproute2/iproute2.inc
@@ -41,6 +41,23 @@ do_install () {
install -d ${D}${datadir}
mv ${D}/share/* ${D}${datadir}/ || true
rm ${D}/share -rf || true
+
+ install -d ${D}${base_bindir}
+ ln -s /sbin/ip ${D}${base_bindir}/ip
+ mv ${D}${base_sbindir}/ss ${D}${base_bindir}/ss
+
+ install -d ${D}${bindir}
+ mv ${D}${base_sbindir}/nstat ${D}${bindir}/nstat
+ mv ${D}${base_sbindir}/lnstat ${D}${bindir}/lnstat
+ mv ${D}${base_sbindir}/ctstat ${D}${bindir}/ctstat
+ mv ${D}${base_sbindir}/rtstat ${D}${bindir}/rtstat
+ mv ${D}${base_sbindir}/routef ${D}${bindir}/routef
+ mv ${D}${base_sbindir}/routel ${D}${bindir}/routel
+
+ if [ "${base_sbindir}" != "${sbindir}" ]; then
+ install -d ${D}${sbindir}
+ mv ${D}${base_sbindir}/genl ${D}${sbindir}/genl
+ fi
}
# The .so files in iproute2-tc are modules, not traditional libraries
@@ -59,7 +76,8 @@ PACKAGES =+ "\
"
FILES_${PN}-tc = "${base_sbindir}/tc* \
- ${libdir}/tc/*.so"
+ ${libdir}/tc/*.so \
+ ${datadir}/bash-completion/completions/tc"
FILES_${PN}-lnstat = "${base_sbindir}/lnstat \
${base_sbindir}/ctstat \
${base_sbindir}/rtstat"
@@ -69,7 +87,8 @@ FILES_${PN}-rtacct = "${base_sbindir}/rtacct"
FILES_${PN}-nstat = "${base_sbindir}/nstat"
FILES_${PN}-ss = "${base_sbindir}/ss"
FILES_${PN}-tipc = "${base_sbindir}/tipc"
-FILES_${PN}-devlink = "${base_sbindir}/devlink"
+FILES_${PN}-devlink = "${base_sbindir}/devlink \
+ ${datadir}/bash-completion/completions/devlink"
ALTERNATIVE_${PN} = "ip"
ALTERNATIVE_TARGET[ip] = "${base_sbindir}/ip.${BPN}"
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v2 2/2] iproute2: rearrange FILES to improve readability
2020-12-05 8:22 [PATCH v2 1/2] iproute2: install tools to mirror install under Debian/Ubuntu Alan Perry
@ 2020-12-05 8:22 ` Alan Perry
2020-12-07 21:49 ` [OE-core] [PATCH v2 1/2] iproute2: install tools to mirror install under Debian/Ubuntu Richard Purdie
1 sibling, 0 replies; 6+ messages in thread
From: Alan Perry @ 2020-12-05 8:22 UTC (permalink / raw)
To: openembedded-core; +Cc: Alan Perry
Rearranged the PACKAGES list FILES to match the order in PACKAGES
to make the recipe more readable and easier to find the FILES for
a given package.
Signed-off-by: Alan Perry <alanp@snowmoose.com>
---
meta/recipes-connectivity/iproute2/iproute2.inc | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/meta/recipes-connectivity/iproute2/iproute2.inc b/meta/recipes-connectivity/iproute2/iproute2.inc
index de5c63a6e3..30521eba31 100644
--- a/meta/recipes-connectivity/iproute2/iproute2.inc
+++ b/meta/recipes-connectivity/iproute2/iproute2.inc
@@ -75,20 +75,20 @@ PACKAGES =+ "\
${PN}-tipc \
"
-FILES_${PN}-tc = "${base_sbindir}/tc* \
- ${libdir}/tc/*.so \
- ${datadir}/bash-completion/completions/tc"
+FILES_${PN}-devlink = "${base_sbindir}/devlink \
+ ${datadir}/bash-completion/completions/devlink"
+FILES_${PN}-genl = "${base_sbindir}/genl"
+FILES_${PN}-ifstat = "${base_sbindir}/ifstat"
FILES_${PN}-lnstat = "${base_sbindir}/lnstat \
${base_sbindir}/ctstat \
${base_sbindir}/rtstat"
-FILES_${PN}-ifstat = "${base_sbindir}/ifstat"
-FILES_${PN}-genl = "${base_sbindir}/genl"
-FILES_${PN}-rtacct = "${base_sbindir}/rtacct"
FILES_${PN}-nstat = "${base_sbindir}/nstat"
+FILES_${PN}-rtacct = "${base_sbindir}/rtacct"
FILES_${PN}-ss = "${base_sbindir}/ss"
+FILES_${PN}-tc = "${base_sbindir}/tc* \
+ ${libdir}/tc/*.so \
+ ${datadir}/bash-completion/completions/tc"
FILES_${PN}-tipc = "${base_sbindir}/tipc"
-FILES_${PN}-devlink = "${base_sbindir}/devlink \
- ${datadir}/bash-completion/completions/devlink"
ALTERNATIVE_${PN} = "ip"
ALTERNATIVE_TARGET[ip] = "${base_sbindir}/ip.${BPN}"
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [OE-core] [PATCH v2 1/2] iproute2: install tools to mirror install under Debian/Ubuntu
2020-12-05 8:22 [PATCH v2 1/2] iproute2: install tools to mirror install under Debian/Ubuntu Alan Perry
2020-12-05 8:22 ` [PATCH v2 2/2] iproute2: rearrange FILES to improve readability Alan Perry
@ 2020-12-07 21:49 ` Richard Purdie
2020-12-09 22:39 ` Alan Perry
1 sibling, 1 reply; 6+ messages in thread
From: Richard Purdie @ 2020-12-07 21:49 UTC (permalink / raw)
To: Alan Perry, openembedded-core
On Sat, 2020-12-05 at 08:22 +0000, Alan Perry wrote:
> Many scripts exist that expect the iproute2 tools to be found in
> the same directories where they are found in Debian or Ubuntu.
> For the iproute2 tools included in the iproute2 recipe, move
> them to those directories or create links there.. Also, add
> bash-completion files as is done by Debian and Ubuntu.
>
> Signed-off-by: Alan Perry <alanp@snowmoose.com>
> ---
> .../iproute2/iproute2.inc | 23 +++++++++++++++++--
> 1 file changed, 21 insertions(+), 2 deletions(-)
The direction in the patch is worrying me a little.
There is a bash-completion class which splits completion files into
their own package, most "embedded" users don't want them in the main
packages. This patch does something different to what has been done
elsewhere.
Secondly, I'm also not sure that just because debian does something we
should therefore do it, I'm not convinced that scripts should be
hardcoding path assumptions about these tools. IF this is such a
universal need, why doesn't upstream change the default installation
locations? Has it been discussed?
I'd expect there to be opinions on this topic but I'm not seeing much
discussion. I suspect if if does merge there would be push back later
though.
Also, the duplication between bin and sbin for ip is not particularly
good practise.
Cheers,
Richard
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [OE-core] [PATCH v2 1/2] iproute2: install tools to mirror install under Debian/Ubuntu
2020-12-07 21:49 ` [OE-core] [PATCH v2 1/2] iproute2: install tools to mirror install under Debian/Ubuntu Richard Purdie
@ 2020-12-09 22:39 ` Alan Perry
2020-12-09 23:40 ` Andre McCurdy
0 siblings, 1 reply; 6+ messages in thread
From: Alan Perry @ 2020-12-09 22:39 UTC (permalink / raw)
To: Richard Purdie, openembedded-core
On 12/7/20 1:49 PM, Richard Purdie wrote:
> On Sat, 2020-12-05 at 08:22 +0000, Alan Perry wrote:
>> Many scripts exist that expect the iproute2 tools to be found in
>> the same directories where they are found in Debian or Ubuntu.
>> For the iproute2 tools included in the iproute2 recipe, move
>> them to those directories or create links there.. Also, add
>> bash-completion files as is done by Debian and Ubuntu.
>>
>> Signed-off-by: Alan Perry <alanp@snowmoose.com>
>> ---
>> .../iproute2/iproute2.inc | 23 +++++++++++++++++--
>> 1 file changed, 21 insertions(+), 2 deletions(-)
> The direction in the patch is worrying me a little.
>
> There is a bash-completion class which splits completion files into
> their own package, most "embedded" users don't want them in the main
> packages. This patch does something different to what has been done
> elsewhere.
>
> Secondly, I'm also not sure that just because debian does something we
> should therefore do it, I'm not convinced that scripts should be
> hardcoding path assumptions about these tools. IF this is such a
> universal need, why doesn't upstream change the default installation
> locations? Has it been discussed?
>
> I'd expect there to be opinions on this topic but I'm not seeing much
> discussion. I suspect if if does merge there would be push back later
> though.
>
> Also, the duplication between bin and sbin for ip is not particularly
> good practise.
>
Thanks for your comments. I apologize for the delay in responding, but I
needed to do some research first.
I will look at the bash-completion class and make the appropriate
changes there.
As far as the installation path changes, I discussed why those aren't
the defaults with the iproute2 upstream maintainer. The idea is that the
upstream puts everything in /sbin and where is appropriate to install
them for a given distro is left as an exercise for that distro.
The iproute2 recipe is doing that exercise for poky. So, where is the
correct place to install these tools on poky? I'd argue that they should
go in the expected directories for Unix-y OSes. Someone at Debian went
through that analysis and put them where they put them and those mostly
seem like reasonable places to me. It is also where users coming to
poky-based systems will likely expecting to find them.
As far as duplicating ip in bin and sbin, I agree that it isn't good
practice. Having it in both doesn't seem necessary to me.
alan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [OE-core] [PATCH v2 1/2] iproute2: install tools to mirror install under Debian/Ubuntu
2020-12-09 22:39 ` Alan Perry
@ 2020-12-09 23:40 ` Andre McCurdy
2020-12-10 0:00 ` Alan Perry
0 siblings, 1 reply; 6+ messages in thread
From: Andre McCurdy @ 2020-12-09 23:40 UTC (permalink / raw)
To: Alan Perry; +Cc: Richard Purdie, OE Core mailing list
On Wed, Dec 9, 2020 at 2:39 PM Alan Perry <alanp@snowmoose.com> wrote:
> On 12/7/20 1:49 PM, Richard Purdie wrote:
> > On Sat, 2020-12-05 at 08:22 +0000, Alan Perry wrote:
> >> Many scripts exist that expect the iproute2 tools to be found in
> >> the same directories where they are found in Debian or Ubuntu.
> >> For the iproute2 tools included in the iproute2 recipe, move
> >> them to those directories or create links there.. Also, add
> >> bash-completion files as is done by Debian and Ubuntu.
> >>
> >> Signed-off-by: Alan Perry <alanp@snowmoose.com>
> >> ---
> >> .../iproute2/iproute2.inc | 23 +++++++++++++++++--
> >> 1 file changed, 21 insertions(+), 2 deletions(-)
> > The direction in the patch is worrying me a little.
> >
> > There is a bash-completion class which splits completion files into
> > their own package, most "embedded" users don't want them in the main
> > packages. This patch does something different to what has been done
> > elsewhere.
> >
> > Secondly, I'm also not sure that just because debian does something we
> > should therefore do it, I'm not convinced that scripts should be
> > hardcoding path assumptions about these tools. IF this is such a
> > universal need, why doesn't upstream change the default installation
> > locations? Has it been discussed?
> >
> > I'd expect there to be opinions on this topic but I'm not seeing much
> > discussion. I suspect if if does merge there would be push back later
> > though.
> >
> > Also, the duplication between bin and sbin for ip is not particularly
> > good practise.
> >
> Thanks for your comments. I apologize for the delay in responding, but I
> needed to do some research first.
>
> I will look at the bash-completion class and make the appropriate
> changes there.
>
> As far as the installation path changes, I discussed why those aren't
> the defaults with the iproute2 upstream maintainer. The idea is that the
> upstream puts everything in /sbin and where is appropriate to install
> them for a given distro is left as an exercise for that distro.
>
> The iproute2 recipe is doing that exercise for poky. So, where is the
> correct place to install these tools on poky? I'd argue that they should
> go in the expected directories for Unix-y OSes. Someone at Debian went
> through that analysis and put them where they put them and those mostly
> seem like reasonable places to me. It is also where users coming to
> poky-based systems will likely expecting to find them.
>
> As far as duplicating ip in bin and sbin, I agree that it isn't good
> practice. Having it in both doesn't seem necessary to me.
But isn't that duplication all part of aligning with Debian (where
/sbin/ip is a symlink to /bin/ip)? Presumably something relies on the
symlink or Debian wouldn't be doing it.
Based on:
https://sources.debian.org/src/iproute2/5.9.0-1/debian/iproute2.install/
https://sources.debian.org/src/iproute2/5.9.0-1/debian/iproute2.links/
Debian does seem to do quite a lot or rearranging of the installed
files. Open question seems to be whether that rearranging is to align
with requirements which are specific to Debian or something which
other distros might need too?
Based on:
https://centos.pkgs.org/8/centos-baseos-x86_64/iproute-5.3.0-5.el8.x86_64.rpm.html
It looks like Centos installs all binaries under /usr/sbin
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [OE-core] [PATCH v2 1/2] iproute2: install tools to mirror install under Debian/Ubuntu
2020-12-09 23:40 ` Andre McCurdy
@ 2020-12-10 0:00 ` Alan Perry
0 siblings, 0 replies; 6+ messages in thread
From: Alan Perry @ 2020-12-10 0:00 UTC (permalink / raw)
To: Andre McCurdy; +Cc: Richard Purdie, OE Core mailing list
On 12/9/20 3:40 PM, Andre McCurdy wrote:
> On Wed, Dec 9, 2020 at 2:39 PM Alan Perry <alanp@snowmoose.com> wrote:
>> On 12/7/20 1:49 PM, Richard Purdie wrote:
>>> On Sat, 2020-12-05 at 08:22 +0000, Alan Perry wrote:
>>>> Many scripts exist that expect the iproute2 tools to be found in
>>>> the same directories where they are found in Debian or Ubuntu.
>>>> For the iproute2 tools included in the iproute2 recipe, move
>>>> them to those directories or create links there.. Also, add
>>>> bash-completion files as is done by Debian and Ubuntu.
>>>>
>>>> Signed-off-by: Alan Perry <alanp@snowmoose.com>
>>>> ---
>>>> .../iproute2/iproute2.inc | 23 +++++++++++++++++--
>>>> 1 file changed, 21 insertions(+), 2 deletions(-)
>>> The direction in the patch is worrying me a little.
>>>
>>> There is a bash-completion class which splits completion files into
>>> their own package, most "embedded" users don't want them in the main
>>> packages. This patch does something different to what has been done
>>> elsewhere.
>>>
>>> Secondly, I'm also not sure that just because debian does something we
>>> should therefore do it, I'm not convinced that scripts should be
>>> hardcoding path assumptions about these tools. IF this is such a
>>> universal need, why doesn't upstream change the default installation
>>> locations? Has it been discussed?
>>>
>>> I'd expect there to be opinions on this topic but I'm not seeing much
>>> discussion. I suspect if if does merge there would be push back later
>>> though.
>>>
>>> Also, the duplication between bin and sbin for ip is not particularly
>>> good practise.
>>>
>> Thanks for your comments. I apologize for the delay in responding, but I
>> needed to do some research first.
>>
>> I will look at the bash-completion class and make the appropriate
>> changes there.
>>
>> As far as the installation path changes, I discussed why those aren't
>> the defaults with the iproute2 upstream maintainer. The idea is that the
>> upstream puts everything in /sbin and where is appropriate to install
>> them for a given distro is left as an exercise for that distro.
>>
>> The iproute2 recipe is doing that exercise for poky. So, where is the
>> correct place to install these tools on poky? I'd argue that they should
>> go in the expected directories for Unix-y OSes. Someone at Debian went
>> through that analysis and put them where they put them and those mostly
>> seem like reasonable places to me. It is also where users coming to
>> poky-based systems will likely expecting to find them.
>>
>> As far as duplicating ip in bin and sbin, I agree that it isn't good
>> practice. Having it in both doesn't seem necessary to me.
> But isn't that duplication all part of aligning with Debian (where
> /sbin/ip is a symlink to /bin/ip)? Presumably something relies on the
> symlink or Debian wouldn't be doing it.
I was just saying that I could see an argument for leaving that one out.
As noted here, doing so isn't without risk.
>
> Based on:
>
> https://sources.debian.org/src/iproute2/5.9.0-1/debian/iproute2.install/
> https://sources.debian.org/src/iproute2/5.9.0-1/debian/iproute2.links/
>
> Debian does seem to do quite a lot or rearranging of the installed
> files. Open question seems to be whether that rearranging is to align
> with requirements which are specific to Debian or something which
> other distros might need too?
>
> Based on:
>
> https://centos.pkgs.org/8/centos-baseos-x86_64/iproute-5.3.0-5.el8.x86_64.rpm.html
>
> It looks like Centos installs all binaries under /usr/sbin
I don't know that I would characterize rearranging the installed files
as Debian does is "specific to Debian" or moving them as appropriate to
how /bin, /sbin, /usr/bin, and /usr/sbin have been traditionally
distinguished from each other. Where Centos is described to install them
doesn't match that traditional use.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-12-10 0:00 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-05 8:22 [PATCH v2 1/2] iproute2: install tools to mirror install under Debian/Ubuntu Alan Perry
2020-12-05 8:22 ` [PATCH v2 2/2] iproute2: rearrange FILES to improve readability Alan Perry
2020-12-07 21:49 ` [OE-core] [PATCH v2 1/2] iproute2: install tools to mirror install under Debian/Ubuntu Richard Purdie
2020-12-09 22:39 ` Alan Perry
2020-12-09 23:40 ` Andre McCurdy
2020-12-10 0:00 ` Alan Perry
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox