diff mbox series

[meta-oe,v2] dediprog-flasher: enable native builds

Message ID 20250514212249.74664-1-dmukhin@ford.com
State Under Review
Headers show
Series [meta-oe,v2] dediprog-flasher: enable native builds | expand

Commit Message

dmkhn@proton.me May 14, 2025, 9:23 p.m. UTC
From: Denis Mukhin <dmukhin@ford.com>

Update dediprog-flasher recipe to support native class variants.

Normally, the recipe comes with a USB udev rule. Do not package USB udev rule
into nativesdk artifacts because this will pollute the host environment, which
is not desired.

Signed-off-by: Denis Mukhin <dmukhin@ford.com>
---
 .../dediprog-flasher_1.14.20.bb               | 20 ++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

Comments

Khem Raj May 14, 2025, 9:49 p.m. UTC | #1
On Wed, May 14, 2025 at 2:23 PM <dmkhn@proton.me> wrote:
>
> From: Denis Mukhin <dmukhin@ford.com>
>
> Update dediprog-flasher recipe to support native class variants.
>
> Normally, the recipe comes with a USB udev rule. Do not package USB udev rule
> into nativesdk artifacts because this will pollute the host environment, which
> is not desired.
>
> Signed-off-by: Denis Mukhin <dmukhin@ford.com>
> ---
>  .../dediprog-flasher_1.14.20.bb               | 20 ++++++++++++++++---
>  1 file changed, 17 insertions(+), 3 deletions(-)
>
> diff --git a/meta-oe/recipes-bsp/dediprog-flasher/dediprog-flasher_1.14.20.bb b/meta-oe/recipes-bsp/dediprog-flasher/dediprog-flasher_1.14.20.bb
> index 83a88ab75f..3d55b34a8d 100644
> --- a/meta-oe/recipes-bsp/dediprog-flasher/dediprog-flasher_1.14.20.bb
> +++ b/meta-oe/recipes-bsp/dediprog-flasher/dediprog-flasher_1.14.20.bb
> @@ -12,18 +12,32 @@ SRC_URI = " \
>      file://0002-Makefile-add-conditional-stripping.patch \
>      "
>
> -EXTRA_OEMAKE = "NOSTRIP=1"
> +EXTRA_OEMAKE = "NOSTRIP=1 DESTDIR=${D} PREFIX=${prefix}"
>
>  PV = "1.0+${SRCPV}"
>
>  S = "${WORKDIR}/git"
>
> -do_install () {
> -    oe_runmake DESTDIR=${D} PREFIX=/usr install
> +do_install() {
> +    oe_runmake install
> +}
> +
> +do_install:append:class-nativesdk() {
> +    # QA override: omit packaging dediprog's udev rule under /etc/udev.
> +    # The file redides outside the nativesdk ${prefix} and must not pollute the
                          ^^^
Typo

> +    # host environment.
> +    rm -rf ${D}/etc
>  }
>
>  FILES:${PN} += " \
> +    ${bindir} \
>      ${datadir}/DediProg \
>  "
>
> +FILES:${PN}:append:class-target = " \

I think we can do away with using target override here.

> +    ${sysconfdir}/udev \
> +"
> +
>  inherit pkgconfig
> +
> +BBCLASSEXTEND += " native nativesdk"
> --
> 2.34.1
>
>
dmkhn@proton.me May 14, 2025, 10:17 p.m. UTC | #2
On Wed, May 14, 2025 at 02:49:07PM -0700, Khem Raj wrote:
> On Wed, May 14, 2025 at 2:23 PM <dmkhn@proton.me> wrote:
> >
> > From: Denis Mukhin <dmukhin@ford.com>
> >
> > Update dediprog-flasher recipe to support native class variants.
> >
> > Normally, the recipe comes with a USB udev rule. Do not package USB udev rule
> > into nativesdk artifacts because this will pollute the host environment, which
> > is not desired.
> >
> > Signed-off-by: Denis Mukhin <dmukhin@ford.com>
> > ---
> >  .../dediprog-flasher_1.14.20.bb               | 20 ++++++++++++++++---
> >  1 file changed, 17 insertions(+), 3 deletions(-)
> >
> > diff --git a/meta-oe/recipes-bsp/dediprog-flasher/dediprog-flasher_1.14.20.bb b/meta-oe/recipes-bsp/dediprog-flasher/dediprog-flasher_1.14.20.bb
> > index 83a88ab75f..3d55b34a8d 100644
> > --- a/meta-oe/recipes-bsp/dediprog-flasher/dediprog-flasher_1.14.20.bb
> > +++ b/meta-oe/recipes-bsp/dediprog-flasher/dediprog-flasher_1.14.20.bb
> > @@ -12,18 +12,32 @@ SRC_URI = " \
> >      file://0002-Makefile-add-conditional-stripping.patch \
> >      "
> >
> > -EXTRA_OEMAKE = "NOSTRIP=1"
> > +EXTRA_OEMAKE = "NOSTRIP=1 DESTDIR=${D} PREFIX=${prefix}"
> >
> >  PV = "1.0+${SRCPV}"
> >
> >  S = "${WORKDIR}/git"
> >
> > -do_install () {
> > -    oe_runmake DESTDIR=${D} PREFIX=/usr install
> > +do_install() {
> > +    oe_runmake install
> > +}
> > +
> > +do_install:append:class-nativesdk() {
> > +    # QA override: omit packaging dediprog's udev rule under /etc/udev.
> > +    # The file redides outside the nativesdk ${prefix} and must not pollute the
>                           ^^^
> Typo

Thanks!

> 
> > +    # host environment.
> > +    rm -rf ${D}/etc
> >  }
> >
> >  FILES:${PN} += " \
> > +    ${bindir} \
> >      ${datadir}/DediProg \
> >  "
> >
> > +FILES:${PN}:append:class-target = " \
> 
> I think we can do away with using target override here.

Oh, that's right, thank you!

> 
> > +    ${sysconfdir}/udev \
> > +"
> > +
> >  inherit pkgconfig
> > +
> > +BBCLASSEXTEND += " native nativesdk"
> > --
> > 2.34.1
> >
> >
diff mbox series

Patch

diff --git a/meta-oe/recipes-bsp/dediprog-flasher/dediprog-flasher_1.14.20.bb b/meta-oe/recipes-bsp/dediprog-flasher/dediprog-flasher_1.14.20.bb
index 83a88ab75f..3d55b34a8d 100644
--- a/meta-oe/recipes-bsp/dediprog-flasher/dediprog-flasher_1.14.20.bb
+++ b/meta-oe/recipes-bsp/dediprog-flasher/dediprog-flasher_1.14.20.bb
@@ -12,18 +12,32 @@  SRC_URI = " \
     file://0002-Makefile-add-conditional-stripping.patch \
     "
 
-EXTRA_OEMAKE = "NOSTRIP=1"
+EXTRA_OEMAKE = "NOSTRIP=1 DESTDIR=${D} PREFIX=${prefix}"
 
 PV = "1.0+${SRCPV}"
 
 S = "${WORKDIR}/git"
 
-do_install () {
-    oe_runmake DESTDIR=${D} PREFIX=/usr install
+do_install() {
+    oe_runmake install
+}
+
+do_install:append:class-nativesdk() {
+    # QA override: omit packaging dediprog's udev rule under /etc/udev.
+    # The file redides outside the nativesdk ${prefix} and must not pollute the
+    # host environment.
+    rm -rf ${D}/etc
 }
 
 FILES:${PN} += " \
+    ${bindir} \
     ${datadir}/DediProg \
 "
 
+FILES:${PN}:append:class-target = " \
+    ${sysconfdir}/udev \
+"
+
 inherit pkgconfig
+
+BBCLASSEXTEND += " native nativesdk"