Skip to contentSkip to conversation

iproute2: split ip to individual package

PATCH Superseded Sinan Kaya 2 participants 5 messages Dec 16, 2020 – Dec 17, 2020

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Sinan Kaya

author
#0 lore raw

PATCH v4 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 | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
meta/recipes-connectivity/iproute2/iproute2.inc +7 -2
index 403d264308c..44f336bd580 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,16 @@ PACKAGES =+ "\
     ${PN}-tipc \
 "
 
+PACKAGE_BEFORE_PN = "${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 +76,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 36 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Sinan Kaya
Sent: den 16 december 2020 18:50
To: [email protected]
Cc: Sinan Kaya <[email protected]>
Subject: [OE-core] [meta-oe][PATCH v4] 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 | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
meta/recipes-connectivity/iproute2/iproute2.inc +2 -1
index 403d264308c..44f336bd580 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 \

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

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

This breaks backwards compatibility. The iproute2 package today does not bring in all the sub-packages.

Quoted 21 lines
meta/recipes-connectivity/iproute2/iproute2.inc +3 -2
+
 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 +76,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"
--
Quoted 1 line

2.17.1

If you are this space constrained, I would suggest adding bbappend files to your own layer for these recipes instead. That is what we do so we can control exactly what files we want or not. E.g., this is what we have in our iproute2_%.bbappend:

EXTRA_OEMAKE += "SUBDIRS='lib tc ip'"

do_install_append() {
        # Remove unused files
        rm -f ${D}${base_sbindir}/ifcfg
        rm -f ${D}${base_sbindir}/rtmon
        rm -f ${D}${base_sbindir}/routef
        rm -f ${D}${base_sbindir}/routel
        rm -f ${D}${base_sbindir}/rtpr
}

With the above bbappend, the only binary left in the iproute2 package is in fact "ip".

//Peter

author
#2 lore raw
Quoted 14 lines · Peter Kjellerstedt
Quoted 14 lines
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,16 @@ PACKAGES =+ "\
     ${PN}-tipc \
 "
 
Quoted 6 lines

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

Quoted 2 lines
meta/recipes-connectivity/iproute2/iproute2.inc +2 -0
+PACKAGE_BEFORE_PN = "${IPROUTE2_PACKAGES}"
+RDEPENDS_${PN} += "${IPROUTE2_PACKAGES}"

This breaks backwards compatibility. The iproute2 package today does not bring in all the sub-packages.

OK, Let me fix this.

Quoted 39 lines
Quoted 21 lines
meta/recipes-connectivity/iproute2/iproute2.inc +3 -2
+
 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 +76,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"
--
Quoted 1 line

2.17.1

If you are this space constrained, I would suggest adding bbappend files to your own layer for these recipes instead. That is what we do so we can control exactly what files we want or not. E.g., this is what we have in our iproute2_%.bbappend:

EXTRA_OEMAKE += "SUBDIRS='lib tc ip'"

do_install_append() {
        # Remove unused files
        rm -f ${D}${base_sbindir}/ifcfg
        rm -f ${D}${base_sbindir}/rtmon
        rm -f ${D}${base_sbindir}/routef
        rm -f ${D}${base_sbindir}/routel
        rm -f ${D}${base_sbindir}/rtpr
}
Quoted 2 lines

With the above bbappend, the only binary left in the iproute2 package is in fact "ip".

I do something very similar in my bbappend now. On the other hand, we have an upstream first principle in the company. I would rather try to find an upstream friendly solution that works for everybody without breaking existing users before falling back to bbappend route that I need to maintain forever.

Quoted 3 lines

//Peter

#3 lore raw
Quoted 75 lines

-----Original Message-----
From: Sinan Kaya <[email protected]>
Sent: den 17 december 2020 01:31
To: Peter Kjellerstedt <[email protected]>; openembedded- [email protected]
Subject: Re: [OE-core] [meta-oe][PATCH v4] iproute2: split ip to individual package

Quoted 14 lines · Peter Kjellerstedt
Quoted 14 lines
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,16 @@ PACKAGES =+ "\
     ${PN}-tipc \
 "
 
Quoted 6 lines

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

Quoted 2 lines
meta/recipes-connectivity/iproute2/iproute2.inc +2 -0
+PACKAGE_BEFORE_PN = "${IPROUTE2_PACKAGES}"
+RDEPENDS_${PN} += "${IPROUTE2_PACKAGES}"

This breaks backwards compatibility. The iproute2 package today does not bring in all the sub-packages.

OK, Let me fix this.

Quoted 15 lines
Quoted 15 lines
meta/recipes-connectivity/iproute2/iproute2.inc +2 -0
+
 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 +76,7 @@ FILES_${PN}-ss = "${base_sbindir}/ss"
 FILES_${PN}-tipc = "${base_sbindir}/tipc"
 FILES_${PN}-devlink = "${base_sbindir}/devlink"
 
Quoted 9 lines
Quoted 7 lines
meta/recipes-connectivity/iproute2/iproute2.inc +1 -2
-ALTERNATIVE_${PN} = "ip"
+ALTERNATIVE_${PN}-ip = "ip"
 ALTERNATIVE_TARGET[ip] = "${base_sbindir}/ip.${BPN}"
 ALTERNATIVE_LINK_NAME[ip] = "${base_sbindir}/ip"
 ALTERNATIVE_PRIORITY = "100"
--

2.17.1

If you are this space constrained, I would suggest adding bbappend

files

Quoted 1 line

to your own layer for these recipes instead. That is what we do so we

can

Quoted 1 line

control exactly what files we want or not. E.g., this is what we have

in

Quoted 13 lines

our iproute2_%.bbappend:

EXTRA_OEMAKE += "SUBDIRS='lib tc ip'"

do_install_append() {
        # Remove unused files
        rm -f ${D}${base_sbindir}/ifcfg
        rm -f ${D}${base_sbindir}/rtmon
        rm -f ${D}${base_sbindir}/routef
        rm -f ${D}${base_sbindir}/routel
        rm -f ${D}${base_sbindir}/rtpr
}
Quoted 1 line

With the above bbappend, the only binary left in the iproute2 package

Quoted 8 lines

is in

Quoted 1 line

fact "ip".

I do something very similar in my bbappend now. On the other hand, we have an upstream first principle in the company. I would rather try to find an upstream friendly solution that works for everybody without breaking existing users before falling back to bbappend route that I need to maintain forever.

Well, the problem as I see it is that some of these changes are pretty invasive to the recipes. And when most seem fine with them as they are (based on the fact that there has not been any push to split any of them before AFAIK), the value of these changes are questionable, given that more complicated recipes increase the maintenance burden.

Quoted 1 line
Quoted 1 line

//Peter

//Peter

author
#4 lore raw
Quoted 11 lines · Peter Kjellerstedt
Quoted 5 lines

I do something very similar in my bbappend now. On the other hand, we have an upstream first principle in the company. I would rather try to find an upstream friendly solution that works for everybody without breaking existing users before falling back to bbappend route that I need to maintain forever.

Well, the problem as I see it is that some of these changes are pretty invasive to the recipes. And when most seem fine with them as they are (based on the fact that there has not been any push to split any of them before AFAIK), the value of these changes are questionable, given that more complicated recipes increase the maintenance burden.

The counter argument is that a user should not be required to rework a recipe in bbappend for common tools that everybody uses the same way.

If I was doing something special for my target, it has no business in upstream recipe.

Requesting to have the ip tool out of iproute2 package is a no-brainer IMO and should be supported by default.

I can also go ahead and say that ip tool probably is the most important tool in this package and is actually disappointing to see that it has not been brought out either by PACKAGECONFIG or PACKAGE options. I honestly don't care about the rest of the tools in that package.

At the end of the day, there is room for improvement in the recipe. Whether we can do it safely or not is for reviewers to help here.