Skip to contentSkip to conversation

iproute2: add devlink support to iproute2

PATCH Superseded Scott Branden 3 participants 7 messages Feb 18, 2020 – Feb 19, 2020

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 iproute2: add devlink support to iproute2

Add devlink support to iproute2 recipe.

---
 meta/recipes-connectivity/iproute2/iproute2.inc | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
meta/recipes-connectivity/iproute2/iproute2.inc +6 -2
index fc31b8444e..98793af88e 100644
@@ -15,11 +15,13 @@ inherit update-alternatives bash-completion pkgconfig
 
 CLEANBROKEN = "1"
 
-PACKAGECONFIG ??= "tipc elf"
+PACKAGECONFIG ??= "tipc elf devlink"
 PACKAGECONFIG[tipc] = ",,libmnl,"
 PACKAGECONFIG[elf] = ",,elfutils,"
+PACKAGECONFIG[devlink] = ",,libmnl,"
 
 EXTRA_OEMAKE = "CC='${CC}' KERNEL_INCLUDE=${STAGING_INCDIR} DOCDIR=${docdir}/iproute2 SUBDIRS='lib tc ip bridge misc genl \
+                ${@bb.utils.contains('PACKAGECONFIG', 'devlink', 'devlink', '', d)}                                               \
                 ${@bb.utils.contains('PACKAGECONFIG', 'tipc', 'tipc', '', d)}' SBINDIR='${base_sbindir}' LIBDIR='${libdir}'"
 
 do_configure_append () {
@@ -46,7 +48,8 @@ PACKAGES =+ "${PN}-tc \
              ${PN}-rtacct \
              ${PN}-nstat \
              ${PN}-ss \
-             ${@bb.utils.contains('PACKAGECONFIG', 'tipc', '${PN}-tipc', '', d)}"
+             ${@bb.utils.contains('PACKAGECONFIG', 'tipc', '${PN}-tipc', '', d)} \
+             ${@bb.utils.contains('PACKAGECONFIG', 'devlink', '${PN}-devlink', '', d)}"
 FILES_${PN}-tc = "${base_sbindir}/tc* \
                   ${libdir}/tc/*.so"
 FILES_${PN}-lnstat = "${base_sbindir}/lnstat \
@@ -58,6 +61,7 @@ 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"
 
 ALTERNATIVE_${PN} = "ip"
 ALTERNATIVE_TARGET[ip] = "${base_sbindir}/ip.${BPN}"
Signature · 1 line
2.17.1
#1 lore raw
Quoted 24 lines

-----Original Message-----
From: [email protected] <openembedded-core- [email protected]> On Behalf Of Scott Branden via Openembedded-core
Sent: den 18 februari 2020 23:45
To: [email protected]
Subject: [OE-core] [meta-oe][PATCH v2] iproute2: add devlink support to iproute2

Add devlink support to iproute2 recipe.

---
 meta/recipes-connectivity/iproute2/iproute2.inc | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
meta/recipes-connectivity/iproute2/iproute2.inc +0 -0
index fc31b8444e..98793af88e 100644
@@ -15,11 +15,13 @@ inherit update-alternatives bash-completion pkgconfig
 
 CLEANBROKEN = "1"

meta/recipes-connectivity/iproute2/iproute2.inc inherit update-alternatives bash-completion pkgconfig · line 25

Quoted 10 lines
meta/recipes-connectivity/iproute2/iproute2.inc +3 -1
 
-PACKAGECONFIG ??= "tipc elf"
+PACKAGECONFIG ??= "tipc elf devlink"
 PACKAGECONFIG[tipc] = ",,libmnl,"
 PACKAGECONFIG[elf] = ",,elfutils,"
+PACKAGECONFIG[devlink] = ",,libmnl,"
 
 EXTRA_OEMAKE = "CC='${CC}' KERNEL_INCLUDE=${STAGING_INCDIR} DOCDIR=${docdir}/iproute2 SUBDIRS='lib tc ip bridge misc genl \
+                ${@bb.utils.contains('PACKAGECONFIG', 'devlink', 'devlink', '', d)}                                               \
                 ${@bb.utils.contains('PACKAGECONFIG', 'tipc', 'tipc', '', d)}' SBINDIR='${base_sbindir}' LIBDIR='${libdir}'"

You can simplify the above to:

EXTRA_OEMAKE = "CC='${CC}' KERNEL_INCLUDE=${STAGING_INCDIR} DOCDIR=${docdir}/iproute2 SUBDIRS='lib tc ip bridge misc genl \
                ${@bb.utils.filter('PACKAGECONFIG', 'devlink tipc', d)}' SBINDIR='${base_sbindir}' LIBDIR='${libdir}'"

but I also recommend to reformat it to make it more readable:

EXTRA_OEMAKE = "\
    CC='${CC}' \
    KERNEL_INCLUDE=${STAGING_INCDIR} \
    DOCDIR=${docdir}/iproute2 \
    SUBDIRS='lib tc ip bridge misc genl ${@bb.utils.filter('PACKAGECONFIG', 'devlink tipc', d)}' \
    SBINDIR='${base_sbindir}' \
    LIBDIR='${libdir}' \

"

meta/recipes-connectivity/iproute2/iproute2.inc PACKAGES =+ "${PN}-tc \ · line 52

Quoted 9 lines
meta/recipes-connectivity/iproute2/iproute2.inc +2 -1
 do_configure_append () {
@@ -46,7 +48,8 @@ PACKAGES =+ "${PN}-tc \
              ${PN}-rtacct \
              ${PN}-nstat \
              ${PN}-ss \
-             ${@bb.utils.contains('PACKAGECONFIG', 'tipc', '${PN}-tipc', '', d)}"
+             ${@bb.utils.contains('PACKAGECONFIG', 'tipc', '${PN}-tipc', '', d)} \
+             ${@bb.utils.contains('PACKAGECONFIG', 'devlink', '${PN}-devlink', '', d)}"

Assuming that the tipc and devlink binaries are only created when tipc and devlink are included in SUBDIRS above, which seems reasonable, you can simplify the above and remove the PACKAGECONFIG checks since the packages will only be created if there actually are files to put in them, e.g.:

PACKAGES =+ "\
    ${PN}-tc \
    ${PN}-lnstat \
    ${PN}-ifstat \
    ${PN}-genl \
    ${PN}-rtacct \
    ${PN}-nstat \
    ${PN}-ss \
    ${PN}-tipc \
    ${PN}-devlink \

"

Quoted 12 lines
meta/recipes-connectivity/iproute2/iproute2.inc +1 -1
 FILES_${PN}-tc = "${base_sbindir}/tc* \
                   ${libdir}/tc/*.so"
 FILES_${PN}-lnstat = "${base_sbindir}/lnstat \
@@ -58,6 +61,7 @@ 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"
 
 ALTERNATIVE_${PN} = "ip"
 ALTERNATIVE_TARGET[ip] = "${base_sbindir}/ip.${BPN}"
--
Quoted 1 line

2.17.1

//Peter

#2 lore raw
Quoted 43 lines · Peter Kjellerstedt
Quoted 25 lines

-----Original Message-----
From: [email protected] <openembedded-core- [email protected]> On Behalf Of Scott Branden via Openembedded-core
Sent: den 18 februari 2020 23:45
To: [email protected]
Subject: [OE-core] [meta-oe][PATCH v2] iproute2: add devlink support to iproute2

Add devlink support to iproute2 recipe.

---
 meta/recipes-connectivity/iproute2/iproute2.inc | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
meta/recipes-connectivity/iproute2/iproute2.inc +0 -0
index fc31b8444e..98793af88e 100644
@@ -15,11 +15,13 @@ inherit update-alternatives bash-completion pkgconfig
 
 CLEANBROKEN = "1"

meta/recipes-connectivity/iproute2/iproute2.inc inherit update-alternatives bash-completion pkgconfig · line 25

Quoted 10 lines
meta/recipes-connectivity/iproute2/iproute2.inc +3 -1
 
-PACKAGECONFIG ??= "tipc elf"
+PACKAGECONFIG ??= "tipc elf devlink"
 PACKAGECONFIG[tipc] = ",,libmnl,"
 PACKAGECONFIG[elf] = ",,elfutils,"
+PACKAGECONFIG[devlink] = ",,libmnl,"
 
 EXTRA_OEMAKE = "CC='${CC}' KERNEL_INCLUDE=${STAGING_INCDIR} DOCDIR=${docdir}/iproute2 SUBDIRS='lib tc ip bridge misc genl \
+                ${@bb.utils.contains('PACKAGECONFIG', 'devlink', 'devlink', '', d)}                                               \
                 ${@bb.utils.contains('PACKAGECONFIG', 'tipc', 'tipc', '', d)}' SBINDIR='${base_sbindir}' LIBDIR='${libdir}'"

You can simplify the above to:

EXTRA_OEMAKE = "CC='${CC}' KERNEL_INCLUDE=${STAGING_INCDIR} DOCDIR=${docdir}/iproute2 SUBDIRS='lib tc ip bridge misc genl \
                ${@bb.utils.filter('PACKAGECONFIG', 'devlink tipc', d)}' SBINDIR='${base_sbindir}' LIBDIR='${libdir}'"

but I also recommend to reformat it to make it more readable:

Quoted 8 lines
EXTRA_OEMAKE = "\
    CC='${CC}' \
    KERNEL_INCLUDE=${STAGING_INCDIR} \
    DOCDIR=${docdir}/iproute2 \
    SUBDIRS='lib tc ip bridge misc genl ${@bb.utils.filter('PACKAGECONFIG', 'devlink tipc', d)}' \
    SBINDIR='${base_sbindir}' \
    LIBDIR='${libdir}' \

"

You could take the cleanup one step further by merging the recipe and the .inc file (and then including CCOPTS='${CFLAGS}' directly in the definition of EXTRA_OEMAKE).

Quoted 48 lines

meta/recipes-connectivity/iproute2/iproute2.inc PACKAGES =+ "${PN}-tc \ · line 52

Quoted 9 lines
meta/recipes-connectivity/iproute2/iproute2.inc +2 -1
 do_configure_append () {
@@ -46,7 +48,8 @@ PACKAGES =+ "${PN}-tc \
              ${PN}-rtacct \
              ${PN}-nstat \
              ${PN}-ss \
-             ${@bb.utils.contains('PACKAGECONFIG', 'tipc', '${PN}-tipc', '', d)}"
+             ${@bb.utils.contains('PACKAGECONFIG', 'tipc', '${PN}-tipc', '', d)} \
+             ${@bb.utils.contains('PACKAGECONFIG', 'devlink', '${PN}-devlink', '', d)}"

Assuming that the tipc and devlink binaries are only created when tipc and devlink are included in SUBDIRS above, which seems reasonable, you can simplify the above and remove the PACKAGECONFIG checks since the packages will only be created if there actually are files to put in them, e.g.:

PACKAGES =+ "\
    ${PN}-tc \
    ${PN}-lnstat \
    ${PN}-ifstat \
    ${PN}-genl \
    ${PN}-rtacct \
    ${PN}-nstat \
    ${PN}-ss \
    ${PN}-tipc \
    ${PN}-devlink \

"

Quoted 12 lines
meta/recipes-connectivity/iproute2/iproute2.inc +1 -1
 FILES_${PN}-tc = "${base_sbindir}/tc* \
                   ${libdir}/tc/*.so"
 FILES_${PN}-lnstat = "${base_sbindir}/lnstat \
@@ -58,6 +61,7 @@ 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"
 
 ALTERNATIVE_${PN} = "ip"
 ALTERNATIVE_TARGET[ip] = "${base_sbindir}/ip.${BPN}"
--
Quoted 1 line

2.17.1

//Peter
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#3 lore raw

Hi Andre,

Quoted 51 lines · Andre McCurdy
Quoted 41 lines · Peter Kjellerstedt
Quoted 24 lines

-----Original Message-----
From: [email protected] <openembedded-core- [email protected]> On Behalf Of Scott Branden via Openembedded-core
Sent: den 18 februari 2020 23:45
To: [email protected]
Subject: [OE-core] [meta-oe][PATCH v2] iproute2: add devlink support to iproute2

Add devlink support to iproute2 recipe.

---
  meta/recipes-connectivity/iproute2/iproute2.inc | 8 ++++++--
  1 file changed, 6 insertions(+), 2 deletions(-)
meta/recipes-connectivity/iproute2/iproute2.inc +0 -0
index fc31b8444e..98793af88e 100644
@@ -15,11 +15,13 @@ inherit update-alternatives bash-completion pkgconfig
 
  CLEANBROKEN = "1"

meta/recipes-connectivity/iproute2/iproute2.inc inherit update-alternatives bash-completion pkgconfig · line 25

Quoted 10 lines
meta/recipes-connectivity/iproute2/iproute2.inc +3 -1
 
-PACKAGECONFIG ??= "tipc elf"
+PACKAGECONFIG ??= "tipc elf devlink"
  PACKAGECONFIG[tipc] = ",,libmnl,"
  PACKAGECONFIG[elf] = ",,elfutils,"
+PACKAGECONFIG[devlink] = ",,libmnl,"
 
  EXTRA_OEMAKE = "CC='${CC}' KERNEL_INCLUDE=${STAGING_INCDIR} DOCDIR=${docdir}/iproute2 SUBDIRS='lib tc ip bridge misc genl \
+                ${@bb.utils.contains('PACKAGECONFIG', 'devlink', 'devlink', '', d)}                                               \
                  ${@bb.utils.contains('PACKAGECONFIG', 'tipc', 'tipc', '', d)}' SBINDIR='${base_sbindir}' LIBDIR='${libdir}'"

You can simplify the above to:

EXTRA_OEMAKE = "CC='${CC}' KERNEL_INCLUDE=${STAGING_INCDIR} DOCDIR=${docdir}/iproute2 SUBDIRS='lib tc ip bridge misc genl \
                 ${@bb.utils.filter('PACKAGECONFIG', 'devlink tipc', d)}' SBINDIR='${base_sbindir}' LIBDIR='${libdir}'"

but I also recommend to reformat it to make it more readable:

Quoted 8 lines
EXTRA_OEMAKE = "\
     CC='${CC}' \
     KERNEL_INCLUDE=${STAGING_INCDIR} \
     DOCDIR=${docdir}/iproute2 \
     SUBDIRS='lib tc ip bridge misc genl ${@bb.utils.filter('PACKAGECONFIG', 'devlink tipc', d)}' \
     SBINDIR='${base_sbindir}' \
     LIBDIR='${libdir}' \

"

Quoted 3 lines

You could take the cleanup one step further by merging the recipe and the .inc file (and then including CCOPTS='${CFLAGS}' directly in the definition of EXTRA_OEMAKE).

Sounds like a more involved change that should be taken up in an unrelated cleanup exercise?

Quoted 46 lines
Quoted 46 lines

meta/recipes-connectivity/iproute2/iproute2.inc PACKAGES =+ "${PN}-tc \ · line 52

Quoted 9 lines
meta/recipes-connectivity/iproute2/iproute2.inc +2 -1
  do_configure_append () {
@@ -46,7 +48,8 @@ PACKAGES =+ "${PN}-tc \
               ${PN}-rtacct \
               ${PN}-nstat \
               ${PN}-ss \
-             ${@bb.utils.contains('PACKAGECONFIG', 'tipc', '${PN}-tipc', '', d)}"
+             ${@bb.utils.contains('PACKAGECONFIG', 'tipc', '${PN}-tipc', '', d)} \
+             ${@bb.utils.contains('PACKAGECONFIG', 'devlink', '${PN}-devlink', '', d)}"

Assuming that the tipc and devlink binaries are only created when tipc and devlink are included in SUBDIRS above, which seems reasonable, you can simplify the above and remove the PACKAGECONFIG checks since the packages will only be created if there actually are files to put in them, e.g.:

PACKAGES =+ "\
     ${PN}-tc \
     ${PN}-lnstat \
     ${PN}-ifstat \
     ${PN}-genl \
     ${PN}-rtacct \
     ${PN}-nstat \
     ${PN}-ss \
     ${PN}-tipc \
     ${PN}-devlink \

"

Quoted 12 lines
meta/recipes-connectivity/iproute2/iproute2.inc +1 -1
  FILES_${PN}-tc = "${base_sbindir}/tc* \
                    ${libdir}/tc/*.so"
  FILES_${PN}-lnstat = "${base_sbindir}/lnstat \
@@ -58,6 +61,7 @@ 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"
 
  ALTERNATIVE_${PN} = "ip"
  ALTERNATIVE_TARGET[ip] = "${base_sbindir}/ip.${BPN}"
--
Quoted 1 line

2.17.1

//Peter
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#4 lore raw
Quoted 56 lines · Scott Branden

Hi Andre,

Quoted 53 lines · Andre McCurdy
Quoted 51 lines · Peter Kjellerstedt
Quoted 32 lines

-----Original Message-----
From: [email protected] <openembedded-core- [email protected]> On Behalf Of Scott Branden via Openembedded-core
Sent: den 18 februari 2020 23:45
To: [email protected]
Subject: [OE-core] [meta-oe][PATCH v2] iproute2: add devlink support to iproute2

Add devlink support to iproute2 recipe.

---
  meta/recipes-connectivity/iproute2/iproute2.inc | 8 ++++++--

  1 file changed, 6 insertions(+), 2 deletions(-)
meta/recipes-connectivity/iproute2/iproute2.inc +0 -0
index fc31b8444e..98793af88e 100644
@@ -15,11 +15,13 @@ inherit update-alternatives bash-completion 

pkgconfig

  CLEANBROKEN = "1"

meta/recipes-connectivity/iproute2/iproute2.inc +1 -1
-PACKAGECONFIG ??= "tipc elf"
+PACKAGECONFIG ??= "tipc elf devlink"

  PACKAGECONFIG[tipc] = ",,libmnl,"
  PACKAGECONFIG[elf] = ",,elfutils,"
+PACKAGECONFIG[devlink] = ",,libmnl,"

Quoted 4 lines

  EXTRA_OEMAKE = "CC='${CC}' KERNEL_INCLUDE=${STAGING_INCDIR} DOCDIR=${docdir}/iproute2 SUBDIRS='lib tc ip bridge misc genl \
+                ${@bb.utils.contains('PACKAGECONFIG', 'devlink',
'devlink', '', d)}                                               \
                  ${@bb.utils.contains('PACKAGECONFIG', 'tipc', 'tipc', '', d)}' SBINDIR='${base_sbindir}' LIBDIR='${libdir}'"

You can simplify the above to:

EXTRA_OEMAKE = "CC='${CC}' KERNEL_INCLUDE=${STAGING_INCDIR} DOCDIR=${docdir}/iproute2 SUBDIRS='lib tc ip bridge misc genl \
                 ${@bb.utils.filter('PACKAGECONFIG', 'devlink tipc', d)}' SBINDIR='${base_sbindir}' LIBDIR='${libdir}'"

but I also recommend to reformat it to make it more readable:

EXTRA_OEMAKE = "\
     CC='${CC}' \
     KERNEL_INCLUDE=${STAGING_INCDIR} \
     DOCDIR=${docdir}/iproute2 \
     SUBDIRS='lib tc ip bridge misc genl ${@bb.utils.filter('PACKAGECONFIG', 'devlink tipc', d)}' \
     SBINDIR='${base_sbindir}' \
     LIBDIR='${libdir}' \
"

Quoted 4 lines
Quoted 3 lines

You could take the cleanup one step further by merging the recipe and the .inc file (and then including CCOPTS='${CFLAGS}' directly in the definition of EXTRA_OEMAKE).

Sounds like a more involved change that should be taken up in an unrelated cleanup exercise?

Actually, I see the reason to keep the inc file is so that you can support different versions of iproute2 if needed. Each recipe version would just require the inc file.

#5 lore raw
Quoted 65 lines · Scott Branden
Quoted 63 lines · Scott Branden

Hi Andre,

Quoted 60 lines · Andre McCurdy
Quoted 58 lines · Peter Kjellerstedt
Quoted 37 lines

-----Original Message-----
From: [email protected] <openembedded-core-
[email protected]> On Behalf Of Scott Branden via Openembedded-core
Sent: den 18 februari 2020 23:45
To: [email protected]
Subject: [OE-core] [meta-oe][PATCH v2] iproute2: add devlink support to
iproute2

Add devlink support to iproute2 recipe.

---
  meta/recipes-connectivity/iproute2/iproute2.inc | 8 ++++++--
  1 file changed, 6 insertions(+), 2 deletions(-)
meta/recipes-connectivity/iproute2/iproute2.inc +0 -0
index fc31b8444e..98793af88e 100644
@@ -15,11 +15,13 @@ inherit update-alternatives bash-completion

pkgconfig

CLEANBROKEN = "1"

meta/recipes-connectivity/iproute2/iproute2.inc +2 -1
-PACKAGECONFIG ??= "tipc elf"
+PACKAGECONFIG ??= "tipc elf devlink"
  PACKAGECONFIG[tipc] = ",,libmnl,"
  PACKAGECONFIG[elf] = ",,elfutils,"
+PACKAGECONFIG[devlink] = ",,libmnl,"
 
  EXTRA_OEMAKE = "CC='${CC}' KERNEL_INCLUDE=${STAGING_INCDIR}

DOCDIR=${docdir}/iproute2 SUBDIRS='lib tc ip bridge misc genl \
+ ${@bb.utils.contains('PACKAGECONFIG', 'devlink',

Quoted 3 lines
'devlink', '', d)}                                               \
                  ${@bb.utils.contains('PACKAGECONFIG', 'tipc',

'tipc', '', d)}' SBINDIR='${base_sbindir}' LIBDIR='${libdir}'"

You can simplify the above to:

EXTRA_OEMAKE = "CC='${CC}' KERNEL_INCLUDE=${STAGING_INCDIR} DOCDIR=${docdir}/iproute2 SUBDIRS='lib tc ip bridge misc genl \

                 ${@bb.utils.filter('PACKAGECONFIG', 'devlink tipc',

d)}' SBINDIR='${base_sbindir}' LIBDIR='${libdir}'"

but I also recommend to reformat it to make it more readable:

EXTRA_OEMAKE = "\
     CC='${CC}' \
     KERNEL_INCLUDE=${STAGING_INCDIR} \
     DOCDIR=${docdir}/iproute2 \
     SUBDIRS='lib tc ip bridge misc genl
${@bb.utils.filter('PACKAGECONFIG', 'devlink tipc', d)}' \
     SBINDIR='${base_sbindir}' \
     LIBDIR='${libdir}' \

"

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

You could take the cleanup one step further by merging the recipe and the .inc file (and then including CCOPTS='${CFLAGS}' directly in the definition of EXTRA_OEMAKE).

Sounds like a more involved change that should be taken up in an unrelated cleanup exercise?

Actually, I see the reason to keep the inc file is so that you can support different versions of iproute2 if needed.
Each recipe version would just require the inc file.

Yes, that's been the historical argument. However we don't typically support multiple versions of a recipe at the same time in oe-core any more and the maintenance effort and potential for bugs (e.g. in this case, casual readers may not realise that the definition of EXTRA_OEMAKE is split between the two files) means we've been gradually cleaning up and merging .inc files into recipes.

#6 lore raw
In reply to Peter Kjellerstedt

Hi Peter,

Quoted 74 lines · Peter Kjellerstedt
Quoted 24 lines

-----Original Message-----
From: [email protected] <openembedded-core- [email protected]> On Behalf Of Scott Branden via Openembedded-core
Sent: den 18 februari 2020 23:45
To: [email protected]
Subject: [OE-core] [meta-oe][PATCH v2] iproute2: add devlink support to iproute2

Add devlink support to iproute2 recipe.

---
  meta/recipes-connectivity/iproute2/iproute2.inc | 8 ++++++--
  1 file changed, 6 insertions(+), 2 deletions(-)
meta/recipes-connectivity/iproute2/iproute2.inc +0 -0
index fc31b8444e..98793af88e 100644
@@ -15,11 +15,13 @@ inherit update-alternatives bash-completion pkgconfig
 
  CLEANBROKEN = "1"

meta/recipes-connectivity/iproute2/iproute2.inc inherit update-alternatives bash-completion pkgconfig · line 25

Quoted 10 lines
meta/recipes-connectivity/iproute2/iproute2.inc +3 -1
 
-PACKAGECONFIG ??= "tipc elf"
+PACKAGECONFIG ??= "tipc elf devlink"
  PACKAGECONFIG[tipc] = ",,libmnl,"
  PACKAGECONFIG[elf] = ",,elfutils,"
+PACKAGECONFIG[devlink] = ",,libmnl,"
 
  EXTRA_OEMAKE = "CC='${CC}' KERNEL_INCLUDE=${STAGING_INCDIR} DOCDIR=${docdir}/iproute2 SUBDIRS='lib tc ip bridge misc genl \
+                ${@bb.utils.contains('PACKAGECONFIG', 'devlink', 'devlink', '', d)}                                               \
                  ${@bb.utils.contains('PACKAGECONFIG', 'tipc', 'tipc', '', d)}' SBINDIR='${base_sbindir}' LIBDIR='${libdir}'"

You can simplify the above to:

EXTRA_OEMAKE = "CC='${CC}' KERNEL_INCLUDE=${STAGING_INCDIR} DOCDIR=${docdir}/iproute2 SUBDIRS='lib tc ip bridge misc genl \
                 ${@bb.utils.filter('PACKAGECONFIG', 'devlink tipc', d)}' SBINDIR='${base_sbindir}' LIBDIR='${libdir}'"

but I also recommend to reformat it to make it more readable:

EXTRA_OEMAKE = "\
     CC='${CC}' \
     KERNEL_INCLUDE=${STAGING_INCDIR} \
     DOCDIR=${docdir}/iproute2 \
     SUBDIRS='lib tc ip bridge misc genl ${@bb.utils.filter('PACKAGECONFIG', 'devlink tipc', d)}' \
     SBINDIR='${base_sbindir}' \
     LIBDIR='${libdir}' \

"

meta/recipes-connectivity/iproute2/iproute2.inc PACKAGES =+ "${PN}-tc \ · line 52

Quoted 8 lines
meta/recipes-connectivity/iproute2/iproute2.inc +2 -1
  do_configure_append () {
@@ -46,7 +48,8 @@ PACKAGES =+ "${PN}-tc \
               ${PN}-rtacct \
               ${PN}-nstat \
               ${PN}-ss \
-             ${@bb.utils.contains('PACKAGECONFIG', 'tipc', '${PN}-tipc', '', d)}"
+             ${@bb.utils.contains('PACKAGECONFIG', 'tipc', '${PN}-tipc', '', d)} \
+             ${@bb.utils.contains('PACKAGECONFIG', 'devlink', '${PN}-devlink', '', d)}"

Assuming that the tipc and devlink binaries are only created when tipc and devlink are included in SUBDIRS above, which seems reasonable, you can simplify the above and remove the PACKAGECONFIG checks since the packages will only be created if there actually are files to put in them, e.g.:

PACKAGES =+ "\
     ${PN}-tc \
     ${PN}-lnstat \
     ${PN}-ifstat \
     ${PN}-genl \
     ${PN}-rtacct \
     ${PN}-nstat \
     ${PN}-ss \
     ${PN}-tipc \
     ${PN}-devlink \
Quoted 1 line

"

OK, all of this can be put in with this commit change - thanks.

Quoted 14 lines
Quoted 12 lines
meta/recipes-connectivity/iproute2/iproute2.inc +1 -1
  FILES_${PN}-tc = "${base_sbindir}/tc* \
                    ${libdir}/tc/*.so"
  FILES_${PN}-lnstat = "${base_sbindir}/lnstat \
@@ -58,6 +61,7 @@ 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"
 
  ALTERNATIVE_${PN} = "ip"
  ALTERNATIVE_TARGET[ip] = "${base_sbindir}/ip.${BPN}"
--
Quoted 1 line

2.17.1

//Peter