diff mbox series

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

Message ID 20250513060149.3971753-1-dmukhin@ford.com
State New
Headers show
Series [meta-oe,v1] dediprog-flasher: enable native builds | expand

Commit Message

dmkhn@proton.me May 13, 2025, 6:04 a.m. UTC
From: Denis Mukhin <dmukhin@ford.com>

Update dediprog-flasher recipe to support native class variants.

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

Comments

Khem Raj May 13, 2025, 6:40 a.m. UTC | #1
On Mon, May 12, 2025 at 11:04 PM <dmkhn@proton.me> wrote:
>
> From: Denis Mukhin <dmukhin@ford.com>
>
> Update dediprog-flasher recipe to support native class variants.
>
> Signed-off-by: Denis Mukhin <dmukhin@ford.com>
> ---
>  .../dediprog-flasher/dediprog-flasher_1.14.20.bb      | 11 ++++++++---
>  1 file changed, 8 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..4c6d6bf6f1 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,23 @@ 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
>  }
>
> +# NB: /etc/udev/rules.d is packaged outside of ${prefix}
>  FILES:${PN} += " \
> +    /etc/udev \

Please use ${sysconfdir} here instead of hardcoding /etc

> +    ${bindir} \
>      ${datadir}/DediProg \
>  "
>
>  inherit pkgconfig
> +
> +BBCLASSEXTEND = "native nativesdk"
> --
> 2.34.1
>
>
dmkhn@proton.me May 13, 2025, 9:21 p.m. UTC | #2
On Mon, May 12, 2025 at 11:40:18PM -0700, Khem Raj wrote:
> On Mon, May 12, 2025 at 11:04 PM <dmkhn@proton.me> wrote:
> >
> > From: Denis Mukhin <dmukhin@ford.com>
> >
> > Update dediprog-flasher recipe to support native class variants.
> >
> > Signed-off-by: Denis Mukhin <dmukhin@ford.com>
> > ---
> >  .../dediprog-flasher/dediprog-flasher_1.14.20.bb      | 11 ++++++++---
> >  1 file changed, 8 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..4c6d6bf6f1 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,23 @@ 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
> >  }
> >
> > +# NB: /etc/udev/rules.d is packaged outside of ${prefix}
> >  FILES:${PN} += " \
> > +    /etc/udev \
> 
> Please use ${sysconfdir} here instead of hardcoding /etc

nativesdk variant of sysconfdir expands to something like:
    sysconfdir="/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-mysdk-linux/etc"
where
    prefix="/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-mysdk-linux"

dediprog build installs USB udev rules into the host's environment
    /etc/udev/rules.d
i.e. packages udev rules outside of ${prefix}.
So in this case /etc/udev should be open-coded, which is not ideal.

I can expand the comment before FILES:${PN} to explain that better.
Will that work?

> 
> > +    ${bindir} \
> >      ${datadir}/DediProg \
> >  "
> >
> >  inherit pkgconfig
> > +
> > +BBCLASSEXTEND = "native nativesdk"
> > --
> > 2.34.1
> >
> >
Khem Raj May 13, 2025, 9:32 p.m. UTC | #3
On Tue, May 13, 2025 at 2:21 PM <dmkhn@proton.me> wrote:
>
> On Mon, May 12, 2025 at 11:40:18PM -0700, Khem Raj wrote:
> > On Mon, May 12, 2025 at 11:04 PM <dmkhn@proton.me> wrote:
> > >
> > > From: Denis Mukhin <dmukhin@ford.com>
> > >
> > > Update dediprog-flasher recipe to support native class variants.
> > >
> > > Signed-off-by: Denis Mukhin <dmukhin@ford.com>
> > > ---
> > >  .../dediprog-flasher/dediprog-flasher_1.14.20.bb      | 11 ++++++++---
> > >  1 file changed, 8 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..4c6d6bf6f1 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,23 @@ 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
> > >  }
> > >
> > > +# NB: /etc/udev/rules.d is packaged outside of ${prefix}
> > >  FILES:${PN} += " \
> > > +    /etc/udev \
> >
> > Please use ${sysconfdir} here instead of hardcoding /etc
>
> nativesdk variant of sysconfdir expands to something like:
>     sysconfdir="/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-mysdk-linux/etc"
> where
>     prefix="/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-mysdk-linux"
>
> dediprog build installs USB udev rules into the host's environment
>     /etc/udev/rules.d

i think its not a good idea to inject things into the host
environment. This can alter
the behaviour of SDK host which is not desired. Is there any other way for it
to register with udev ?

> i.e. packages udev rules outside of ${prefix}.
> So in this case /etc/udev should be open-coded, which is not ideal.
>
> I can expand the comment before FILES:${PN} to explain that better.
> Will that work?
>
> >
> > > +    ${bindir} \
> > >      ${datadir}/DediProg \
> > >  "
> > >
> > >  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..4c6d6bf6f1 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,23 @@  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
 }
 
+# NB: /etc/udev/rules.d is packaged outside of ${prefix}
 FILES:${PN} += " \
+    /etc/udev \
+    ${bindir} \
     ${datadir}/DediProg \
 "
 
 inherit pkgconfig
+
+BBCLASSEXTEND = "native nativesdk"