diff mbox series

[v4,1/9] package/nxp: new package directory

Message ID 20200205105227.13698-1-jerry.huang@nxp.com
State Superseded
Headers show
Series [v4,1/9] package/nxp: new package directory | expand

Commit Message

Changming Huang Feb. 5, 2020, 10:52 a.m. UTC
The "nxp" directory is intended to contain all NXP
QorIQ (including PowerPC and LayerScape serial) related packages,
together with their download site and version info.

Signed-off-by: Changming Huang <jerry.huang@nxp.com>
---
changes since v3:
no changes.

changes since v2:
1. change the sub-direcotry to "nxp".
2. add helper.mk macro to extract compressed file.

changes since v1:
no changes.
---
 package/Config.in     |  1 +
 package/nxp/Config.in |  4 ++++
 package/nxp/helper.mk | 32 ++++++++++++++++++++++++++++++++
 3 files changed, 37 insertions(+)
 create mode 100644 package/nxp/Config.in
 create mode 100644 package/nxp/helper.mk

Comments

Heiko Thiery Feb. 5, 2020, 2:08 p.m. UTC | #1
Hi Changming,

> +################################################################################
> +#
> +# helper
> +#
> +################################################################################
> +
> +# Helper for self-extracting binaries distributed by NXP.
> +#
> +# The --force option makes sure it doesn't fail if the source
> +# directory already exists. The --auto-accept skips the license check,
> +# as it is not needed in Buildroot because we have legal-info. Since
> +# there's a EULA in the binary file, we extract it in this macro, and
> +# it should therefore be added to the LICENSE_FILES variable of
> +# packages using this macro. Also, remember to set REDISTRIBUTE to
> +# "NO". Indeed, this is a legal minefield: the EULA specifies that the
> +# Board Support Package includes software and hardware (sic!) for
> +# which a separate license is needed...
> +#
> +# $(1): full path to the archive file
> +#
> +define NXP_EXTRACT_HELPER
> +       awk 'BEGIN      { start = 0; } \
> +            /^EOEULA/  { start = 0; } \
> +                       { if (start) print; } \
> +            /<<EOEULA/ { start = 1; }' \
> +           $(1) > $(@D)/EULA
> +       cd $(@D) && sh $(1) --force --auto-accept
> +       find $(@D)/$(basename $(notdir $(1))) -mindepth 1 -maxdepth 1 -exec mv {} $(@D) \;
> +       rmdir $(@D)/$(basename $(notdir $(1)))
> +endef
> +
> +include $(sort $(wildcard package/nxp/*/*.mk))

This seems to be a duplication of the FREESCALE_IMX_EXTRACT_HELPER, isn't it?

Do we then can remove the other one and use only the new "nxp" one?

By the way is there a plan to move all NXP specific packages (qoriq
and imx) to the nxp subdir?

--
Heiko
Changming Huang Feb. 6, 2020, 3:41 a.m. UTC | #2
Best Regards
Jerry Huang

> -----Original Message-----
> From: Heiko Thiery <heiko.thiery@gmail.com>
> Sent: Wednesday, February 5, 2020 10:09 PM
> To: Jerry Huang <jerry.huang@nxp.com>
> Cc: buildroot@busybox.net; olteanv@gmail.com; Michael Walle
> <michael@walle.cc>; geomatsi@gmail.com; matthew.weber@collins.com;
> Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Subject: [EXT] Re: [Buildroot] [PATCH v4 1/9] package/nxp: new package
> directory
> 
> Caution: EXT Email
> 
> Hi Changming,
> 
> >
> +###############################################################
> ######
> > +###########
> > +#
> > +# helper
> > +#
> >
> +###############################################################
> ######
> > +###########
> > +
> > +# Helper for self-extracting binaries distributed by NXP.
> > +#
> > +# The --force option makes sure it doesn't fail if the source #
> > +directory already exists. The --auto-accept skips the license check,
> > +# as it is not needed in Buildroot because we have legal-info. Since
> > +# there's a EULA in the binary file, we extract it in this macro, and
> > +# it should therefore be added to the LICENSE_FILES variable of #
> > +packages using this macro. Also, remember to set REDISTRIBUTE to #
> > +"NO". Indeed, this is a legal minefield: the EULA specifies that the
> > +# Board Support Package includes software and hardware (sic!) for #
> > +which a separate license is needed...
> > +#
> > +# $(1): full path to the archive file # define NXP_EXTRACT_HELPER
> > +       awk 'BEGIN      { start = 0; } \
> > +            /^EOEULA/  { start = 0; } \
> > +                       { if (start) print; } \
> > +            /<<EOEULA/ { start = 1; }' \
> > +           $(1) > $(@D)/EULA
> > +       cd $(@D) && sh $(1) --force --auto-accept
> > +       find $(@D)/$(basename $(notdir $(1))) -mindepth 1 -maxdepth 1
> -exec mv {} $(@D) \;
> > +       rmdir $(@D)/$(basename $(notdir $(1))) endef
> > +
> > +include $(sort $(wildcard package/nxp/*/*.mk))
> 
> This seems to be a duplication of the FREESCALE_IMX_EXTRACT_HELPER, isn't
> it?
> Do we then can remove the other one and use only the new "nxp" one?
> 
> By the way is there a plan to move all NXP specific packages (qoriq and imx) to
> the nxp subdir?
Yes, the helper is the duplication of FREESCALE_IMX_EXTRACT_HELPER.
Because Freescale is merged into NXP a few years ago, according to NXP's policy, we need to use nxp, instead of freescale.
So, I think the packages related NXP should be move into nxp directory.

> --
> Heiko
Vladimir Oltean Feb. 6, 2020, 9:44 a.m. UTC | #3
Hi Jerry, Heiko,

On Thu, 6 Feb 2020 at 05:41, Jerry Huang <jerry.huang@nxp.com> wrote:
>

[snip]

> >
> > This seems to be a duplication of the FREESCALE_IMX_EXTRACT_HELPER, isn't
> > it?
> > Do we then can remove the other one and use only the new "nxp" one?
> >
> > By the way is there a plan to move all NXP specific packages (qoriq and imx) to
> > the nxp subdir?
> Yes, the helper is the duplication of FREESCALE_IMX_EXTRACT_HELPER.
> Because Freescale is merged into NXP a few years ago, according to NXP's policy, we need to use nxp, instead of freescale.
> So, I think the packages related NXP should be move into nxp directory.
>

Is it really NXP policy though?
The thing is that LS1028A and several other boards are already
supported by some downstream Buildroot patches, so it makes sense to
keep using the folder names that we have there, i.e. "nxp" instead of
changing to "freescale".
However I don't think there is any hard requirement either way, so in
practice, whatever generates the least amount of friction should work.

> > --
> > Heiko

Thanks,
-Vladimir
Thomas Petazzoni Feb. 6, 2020, 9:51 a.m. UTC | #4
On Thu, 6 Feb 2020 11:44:24 +0200
Vladimir Oltean <olteanv@gmail.com> wrote:

> > > This seems to be a duplication of the FREESCALE_IMX_EXTRACT_HELPER, isn't
> > > it?
> > > Do we then can remove the other one and use only the new "nxp" one?
> > >
> > > By the way is there a plan to move all NXP specific packages (qoriq and imx) to
> > > the nxp subdir?  
> > Yes, the helper is the duplication of FREESCALE_IMX_EXTRACT_HELPER.
> > Because Freescale is merged into NXP a few years ago, according to NXP's policy, we need to use nxp, instead of freescale.
> > So, I think the packages related NXP should be move into nxp directory.
> >  
> 
> Is it really NXP policy though?
> The thing is that LS1028A and several other boards are already
> supported by some downstream Buildroot patches, so it makes sense to
> keep using the folder names that we have there, i.e. "nxp" instead of
> changing to "freescale".

The proposal is not to change from nxp to freescale, but the opposite.

However, I think it's good to keep in mind that NXP's policy applies to
whatever NXP does. The Buildroot project is independent and is not
forced in any way to comply with NXP policies.

Best regards,

Thomas
Vladimir Oltean Feb. 6, 2020, 10:04 a.m. UTC | #5
Hi Thomas,

On Thu, 6 Feb 2020 at 11:51, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> On Thu, 6 Feb 2020 11:44:24 +0200
> Vladimir Oltean <olteanv@gmail.com> wrote:
>
> > > > This seems to be a duplication of the FREESCALE_IMX_EXTRACT_HELPER, isn't
> > > > it?
> > > > Do we then can remove the other one and use only the new "nxp" one?
> > > >
> > > > By the way is there a plan to move all NXP specific packages (qoriq and imx) to
> > > > the nxp subdir?
> > > Yes, the helper is the duplication of FREESCALE_IMX_EXTRACT_HELPER.
> > > Because Freescale is merged into NXP a few years ago, according to NXP's policy, we need to use nxp, instead of freescale.
> > > So, I think the packages related NXP should be move into nxp directory.
> > >
> >
> > Is it really NXP policy though?
> > The thing is that LS1028A and several other boards are already
> > supported by some downstream Buildroot patches, so it makes sense to
> > keep using the folder names that we have there, i.e. "nxp" instead of
> > changing to "freescale".
>
> The proposal is not to change from nxp to freescale, but the opposite.
>

It depends on perspective, but I guess you already got the point.

> However, I think it's good to keep in mind that NXP's policy applies to
> whatever NXP does. The Buildroot project is independent and is not
> forced in any way to comply with NXP policies.
>

Not trying to suggest otherwise, just to explain why the freescale ->
nxp name change took place between Jerry's v2 and v3 of this patch
series. The arguments have been brought on both sides, I don't think
it's a big deal either way as long as the naming between device
families is consistent and there isn't any unjustified duplication, so
I'll just let Jerry make a decision one way or another.

> Best regards,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

Regards,
-Vladimir
diff mbox series

Patch

diff --git a/package/Config.in b/package/Config.in
index 37861387e8..c697962ac0 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -494,6 +494,7 @@  endmenu
 	source "package/nvidia-driver/Config.in"
 	source "package/nvidia-tegra23/Config.in"
 	source "package/nvme/Config.in"
+	source "package/nxp/Config.in"
 	source "package/ofono/Config.in"
 	source "package/on2-8170-modules/Config.in"
 	source "package/open2300/Config.in"
diff --git a/package/nxp/Config.in b/package/nxp/Config.in
new file mode 100644
index 0000000000..575542c7ab
--- /dev/null
+++ b/package/nxp/Config.in
@@ -0,0 +1,4 @@ 
+menu "NXP QorIQ libraries"
+	depends on BR2_aarch64 || BR2_arm || BR2_powerpc64 || BR2_powerpc
+
+endmenu
diff --git a/package/nxp/helper.mk b/package/nxp/helper.mk
new file mode 100644
index 0000000000..79e4236249
--- /dev/null
+++ b/package/nxp/helper.mk
@@ -0,0 +1,32 @@ 
+################################################################################
+#
+# helper
+#
+################################################################################
+
+# Helper for self-extracting binaries distributed by NXP.
+#
+# The --force option makes sure it doesn't fail if the source
+# directory already exists. The --auto-accept skips the license check,
+# as it is not needed in Buildroot because we have legal-info. Since
+# there's a EULA in the binary file, we extract it in this macro, and
+# it should therefore be added to the LICENSE_FILES variable of
+# packages using this macro. Also, remember to set REDISTRIBUTE to
+# "NO". Indeed, this is a legal minefield: the EULA specifies that the
+# Board Support Package includes software and hardware (sic!) for
+# which a separate license is needed...
+#
+# $(1): full path to the archive file
+#
+define NXP_EXTRACT_HELPER
+	awk 'BEGIN      { start = 0; } \
+	     /^EOEULA/  { start = 0; } \
+	                { if (start) print; } \
+	     /<<EOEULA/ { start = 1; }' \
+	    $(1) > $(@D)/EULA
+	cd $(@D) && sh $(1) --force --auto-accept
+	find $(@D)/$(basename $(notdir $(1))) -mindepth 1 -maxdepth 1 -exec mv {} $(@D) \;
+	rmdir $(@D)/$(basename $(notdir $(1)))
+endef
+
+include $(sort $(wildcard package/nxp/*/*.mk))