Skip to contentSkip to conversation

iproute2: split ip to individual package

PATCH Superseded Sinan Kaya 2 participants 5 messages Dec 16, 2020 1 message not in the archive

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Sinan Kaya

author
#0 lore raw

PATCH v2 1/1 iproute2: split ip to individual package

Move the ip tool into its own package. Useful for size constrained systems that only want the ip tool.

---
 meta/recipes-connectivity/iproute2/iproute2.inc | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
meta/recipes-connectivity/iproute2/iproute2.inc +8 -2
index 403d264308c..f4d882d3ece 100644
@@ -46,10 +46,11 @@ do_install () {
 # The .so files in iproute2-tc are modules, not traditional libraries
 INSANE_SKIP_${PN}-tc = "dev-so"
 
-PACKAGES =+ "\
+IPROUTE2_PACKAGES =+ "\
     ${PN}-devlink \
     ${PN}-genl \
     ${PN}-ifstat \
+    ${PN}-ip \
     ${PN}-lnstat \
     ${PN}-nstat \
     ${PN}-rtacct \
@@ -58,12 +59,17 @@ PACKAGES =+ "\
     ${PN}-tipc \
 "
 
+PACKAGES += "${IPROUTE2_PACKAGES}"
+PROVIDES += "${IPROUTE2_PACKAGES}"
+RDEPENDS_${PN} += "${IPROUTE2_PACKAGES}"
+
 FILES_${PN}-tc = "${base_sbindir}/tc* \
                   ${libdir}/tc/*.so"
 FILES_${PN}-lnstat = "${base_sbindir}/lnstat \
                       ${base_sbindir}/ctstat \
                       ${base_sbindir}/rtstat"
 FILES_${PN}-ifstat = "${base_sbindir}/ifstat"
+FILES_${PN}-ip = "${base_sbindir}/ip.${PN} ${sysconfdir}/iproute2"
 FILES_${PN}-genl = "${base_sbindir}/genl"
 FILES_${PN}-rtacct = "${base_sbindir}/rtacct"
 FILES_${PN}-nstat = "${base_sbindir}/nstat"
@@ -71,7 +77,7 @@ FILES_${PN}-ss = "${base_sbindir}/ss"
 FILES_${PN}-tipc = "${base_sbindir}/tipc"
 FILES_${PN}-devlink = "${base_sbindir}/devlink"
 
-ALTERNATIVE_${PN} = "ip"
+ALTERNATIVE_${PN}-ip = "ip"
 ALTERNATIVE_TARGET[ip] = "${base_sbindir}/ip.${BPN}"
 ALTERNATIVE_LINK_NAME[ip] = "${base_sbindir}/ip"
 ALTERNATIVE_PRIORITY = "100"
Signature · 1 line
2.17.1
#1 lore raw
Quoted 28 lines · Sinan Kaya

Move the ip tool into its own package. Useful for size constrained systems that only want the ip tool.

---
 meta/recipes-connectivity/iproute2/iproute2.inc | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
meta/recipes-connectivity/iproute2/iproute2.inc +0 -0
index 403d264308c..f4d882d3ece 100644
@@ -46,10 +46,11 @@ do_install () {
 # The .so files in iproute2-tc are modules, not traditional

libraries
INSANE_SKIP_${PN}-tc = "dev-so"

meta/recipes-connectivity/iproute2/iproute2.inc +2 -1
-PACKAGES =+ "\
+IPROUTE2_PACKAGES =+ "\
     ${PN}-devlink \
     ${PN}-genl \
     ${PN}-ifstat \
+    ${PN}-ip \
     ${PN}-lnstat \
     ${PN}-nstat \
     ${PN}-rtacct \

meta/recipes-connectivity/iproute2/iproute2.inc PACKAGES =+ "\ · line 63

Quoted 5 lines
meta/recipes-connectivity/iproute2/iproute2.inc +2 -0
@@ -58,12 +59,17 @@ PACKAGES =+ "\
     ${PN}-tipc \
 "
 
+PACKAGES += "${IPROUTE2_PACKAGES}"
+PROVIDES += "${IPROUTE2_PACKAGES}"

This doesn't look correct. Why do we need to add all the individual package splits to PROVIDES?

I'm going to guess this is because you want to do:

DEPENDS = "iproute2-ip"

somewhere? If so, that is not how DEPENDS is meant to work, even after this split you'd use:

DEPENDS = "iproute2"

If you want iproute2-ip specifically, you'd use the package namespace, e.g.

RDEPENDS = "iproute2-ip".

or is there some other reason for this? This is basically the issue with some of the other package splits too, its not using the build time verses runtime namespaces correctly.

Cheers,

Richard

author
#2 lore raw
Quoted 19 lines · Richard Purdie
Quoted 19 lines

+++ b/meta/recipes-connectivity/iproute2/iproute2.inc

(quoted diff) +0 -0
@@ -46,10 +46,11 @@ do_install () {
 # The .so files in iproute2-tc are modules, not traditional

libraries
INSANE_SKIP_${PN}-tc = "dev-so"

meta/recipes-connectivity/iproute2/iproute2.inc +2 -1
-PACKAGES =+ "\
+IPROUTE2_PACKAGES =+ "\
     ${PN}-devlink \
     ${PN}-genl \
     ${PN}-ifstat \
+    ${PN}-ip \
     ${PN}-lnstat \
     ${PN}-nstat \
     ${PN}-rtacct \
@@ -58,12 +59,17 @@ PACKAGES =+ "\
     ${PN}-tipc \
 "
 
Quoted 5 lines

meta/recipes-connectivity/iproute2/iproute2.inc PACKAGES =+ "\ · line 63

Quoted 2 lines
meta/recipes-connectivity/iproute2/iproute2.inc +2 -0
+PACKAGES += "${IPROUTE2_PACKAGES}"
+PROVIDES += "${IPROUTE2_PACKAGES}"

This doesn't look correct. Why do we need to add all the individual package splits to PROVIDES?

I want to add iproute2-ip into my IMAGE_INSTALL and not take the rest of the iproute2-$foo packages. If I don't add PROVIDES, build stage fails saying nobody provides iproute2-ip.

Quoted 4 lines

or is there some other reason for this? This is basically the issue with some of the other package splits too, its not using the build time verses runtime namespaces correctly.

If I misunderstood something or am not doing it right, let me know.

author
#5 lore raw
In reply to a message not in the archive
Quoted 9 lines · Sinan Kaya
Quoted 5 lines

meta/recipes-connectivity/iproute2/iproute2.inc PACKAGES =+ "\ · line 63

Quoted 2 lines
meta/recipes-connectivity/iproute2/iproute2.inc +2 -0
+PACKAGES += "${IPROUTE2_PACKAGES}"
+PROVIDES += "${IPROUTE2_PACKAGES}"

This doesn't look correct. Why do we need to add all the individual package splits to PROVIDES?

I want to add iproute2-ip into my IMAGE_INSTALL and not take the rest of the iproute2-$foo packages. If I don't add PROVIDES, build stage fails saying nobody provides iproute2-ip.

Interesting, it worked now. I queued some builds on my side. I will post a new REV.

#3 lore raw
In reply to Sinan Kaya
Quoted 26 lines · Sinan Kaya
Quoted 19 lines · Richard Purdie
Quoted 19 lines

+++ b/meta/recipes-connectivity/iproute2/iproute2.inc

(quoted diff) +0 -0
@@ -46,10 +46,11 @@ do_install () {
 # The .so files in iproute2-tc are modules, not traditional

libraries
INSANE_SKIP_${PN}-tc = "dev-so"

meta/recipes-connectivity/iproute2/iproute2.inc +2 -1
-PACKAGES =+ "\
+IPROUTE2_PACKAGES =+ "\
     ${PN}-devlink \
     ${PN}-genl \
     ${PN}-ifstat \
+    ${PN}-ip \
     ${PN}-lnstat \
     ${PN}-nstat \
     ${PN}-rtacct \
@@ -58,12 +59,17 @@ PACKAGES =+ "\
     ${PN}-tipc \
 "
 
Quoted 5 lines

meta/recipes-connectivity/iproute2/iproute2.inc PACKAGES =+ "\ · line 63

Quoted 2 lines
meta/recipes-connectivity/iproute2/iproute2.inc +2 -0
+PACKAGES += "${IPROUTE2_PACKAGES}"
+PROVIDES += "${IPROUTE2_PACKAGES}"

This doesn't look correct. Why do we need to add all the individual package splits to PROVIDES?

Quoted 3 lines

I want to add iproute2-ip into my IMAGE_INSTALL and not take the rest of the iproute2-$foo packages. If I don't add PROVIDES, build stage fails saying nobody provides iproute2-ip.

IMAGE_INSTALL is a runtime namespace, the same as RPROVIDES/RDEPENDS, not PROVIDES/DEPENDS so using iproute2-ip there should be fine.

Quoted 5 lines
Quoted 3 lines

or is there some other reason for this? This is basically the issue with some of the other package splits too, its not using the build time verses runtime namespaces correctly.

If I misunderstood something or am not doing it right, let me know.

I think IMAGE_INSTALL should work (behind the scenes it adds to RDEPENDS for the image).

Cheers,

Richard