> -----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.
> 
> Signed-off-by: Scott Branden <[email protected]>
> ---
>  meta/recipes-connectivity/iproute2/iproute2.inc | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/recipes-connectivity/iproute2/iproute2.inc
> b/meta/recipes-connectivity/iproute2/iproute2.inc
> index fc31b8444e..98793af88e 100644
> --- a/meta/recipes-connectivity/iproute2/iproute2.inc
> +++ b/meta/recipes-connectivity/iproute2/iproute2.inc
> @@ -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}'"

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}' \
"

> 
>  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 \
"

>  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}"
> --
> 2.17.1

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

Reply via email to