mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH 1/6] rules/host-gnu-efi: Add new package.
@ 2021-07-16 13:41 Christian Melki
  2021-07-16 13:41 ` [ptxdist] [PATCH 2/6] rules/gnu-efi: " Christian Melki
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Christian Melki @ 2021-07-16 13:41 UTC (permalink / raw)
  To: ptxdist

GNU EFI library as host package.
Used by various tools for various EFI work.

Signed-off-by: Christian Melki <christian.melki@t2data.com>
---
 rules/host-gnu-efi.in   |  7 +++++++
 rules/host-gnu-efi.make | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+)
 create mode 100644 rules/host-gnu-efi.in
 create mode 100644 rules/host-gnu-efi.make

diff --git a/rules/host-gnu-efi.in b/rules/host-gnu-efi.in
new file mode 100644
index 000000000..c7f665135
--- /dev/null
+++ b/rules/host-gnu-efi.in
@@ -0,0 +1,7 @@
+## SECTION=hosttools_noprompt
+
+config HOST_GNU_EFI
+	tristate
+	default y if ALLYES
+	help
+	  This is gnu-efi, a library for providing EFI functions.
diff --git a/rules/host-gnu-efi.make b/rules/host-gnu-efi.make
new file mode 100644
index 000000000..d585d6731
--- /dev/null
+++ b/rules/host-gnu-efi.make
@@ -0,0 +1,33 @@
+# -*-makefile-*-
+# Copyright (C) 2021 by Christian Melki <christian.melki@t2data.com>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+HOST_PACKAGES-$(PTXCONF_HOST_GNU_EFI) += host-gnu-efi
+
+# ----------------------------------------------------------------------------
+# Compile
+# ----------------------------------------------------------------------------               
+
+HOST_GNU_EFI_ARCH = $(call ptx/force-sh, uname -m)
+
+HOST_GNU_EFI_CONF_TOOL	:= NO
+
+HOST_GNU_EFI_MAKE_ENV	:= \
+	$(HOST_ENV) \
+	ARCH=$(HOST_GNU_EFI_ARCH) \
+	PREFIX=/usr \
+
+HOST_GNU_EFI_INSTALL_OPT := \
+	$(HOST_ENV) \
+	ARCH=$(HOST_GNU_EFI_ARCH) \
+	INSTALLROOT=$(PTXDIST_SYSROOT_HOST) \
+	PREFIX=/usr \
+	install
+
+# vim: syntax=make
-- 
2.32.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ptxdist] [PATCH 2/6] rules/gnu-efi: Add new package.
  2021-07-16 13:41 [ptxdist] [PATCH 1/6] rules/host-gnu-efi: Add new package Christian Melki
@ 2021-07-16 13:41 ` Christian Melki
  2021-07-19  9:09   ` Roland Hieber
  2021-07-16 13:41 ` [ptxdist] [PATCH 3/6] rules/host-efitools: " Christian Melki
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Christian Melki @ 2021-07-16 13:41 UTC (permalink / raw)
  To: ptxdist

Target GNU EFI library. Used for various EFI work.
Depending on your needs, target binaries for EFI stuff might be needed.
This is used by efitools etc.

Signed-off-by: Christian Melki <christian.melki@t2data.com>
---
 rules/gnu-efi.in   |  6 ++++
 rules/gnu-efi.make | 71 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 77 insertions(+)
 create mode 100644 rules/gnu-efi.in
 create mode 100644 rules/gnu-efi.make

diff --git a/rules/gnu-efi.in b/rules/gnu-efi.in
new file mode 100644
index 000000000..b21192222
--- /dev/null
+++ b/rules/gnu-efi.in
@@ -0,0 +1,6 @@
+## SECTION=system_libraries
+menuconfig GNU_EFI
+	tristate
+	prompt "gnu-efi                       "
+	help
+	  This is gnu-efi, a library for providing EFI functions.
diff --git a/rules/gnu-efi.make b/rules/gnu-efi.make
new file mode 100644
index 000000000..33a27020b
--- /dev/null
+++ b/rules/gnu-efi.make
@@ -0,0 +1,71 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2021 by Christian Melki <christian.melki@t2data.com>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_GNU_EFI) += gnu-efi
+
+#
+# Paths and names
+#
+# No tags: use a fake descriptive commit-ish to include the date
+GNU_EFI_VERSION		:= 3.0.13
+GNU_EFI_MD5		:= 8ec4221f505c78e6fc375c2fd7f0c549
+GNU_EFI			:= gnu-efi-$(GNU_EFI_VERSION)
+GNU_EFI_SUFFIX		:= tar.bz2
+GNU_EFI_URL		:= https://sourceforge.net/projects/gnu-efi/files/gnu-efi-$(GNU_EFI_VERSION).$(GNU_EFI_SUFFIX)
+GNU_EFI_SOURCE		:= $(SRCDIR)/$(GNU_EFI).$(GNU_EFI_SUFFIX)
+GNU_EFI_DIR		:= $(BUILDDIR)/$(GNU_EFI)
+GNU_EFI_LICENSE		:= BSD
+
+# ----------------------------------------------------------------------------
+# Compile
+# ----------------------------------------------------------------------------               
+
+ifdef PTXCONF_ARCH_X86 
+GNU_EFI_ARCH = ia32
+ifdef PTXCONF_ARCH_X86_64
+GNU_EFI_ARCH = x86_64
+endif
+endif
+ifdef PTXCONF_ARCH_ARM
+GNU_EFI_ARCH = arm
+endif
+ifdef PTXCONF_ARCH_ARM64
+GNU_EFI_ARCH = aarch64
+endif
+
+GNU_EFI_CONF_TOOL	:= NO
+GNU_EFI_MAKE_ENV	:= \
+	ARCH=$(GNU_EFI_ARCH) \
+	CROSS_COMPILE=$(COMPILER_PREFIX) \
+	PREFIX=/usr \
+	LIBDIR=/usr/$(CROSS_LIB_DIR)
+
+GNU_EFI_INSTALL_OPT := \
+	INSTALLROOT=$(GNU_EFI_PKGDIR) \
+	PREFIX=/usr \
+	LIBDIR=/usr/$(CROSS_LIB_DIR) \
+	install
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/gnu-efi.targetinstall:
+	@$(call targetinfo)
+	@$(call install_init, gnu-efi)
+	@$(call install_fixup, gnu-efi,PRIORITY,optional)
+	@$(call install_fixup, gnu-efi,SECTION,base)
+	@$(call install_fixup, gnu-efi,AUTHOR,"Christian Melki <christian.melki@t2data.com>")
+	@$(call install_fixup, gnu-efi,DESCRIPTION,missing)
+	@$(call install_finish, gnu-efi)
+	@$(call touch)
+
+# vim: syntax=make
-- 
2.32.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ptxdist] [PATCH 3/6] rules/host-efitools: Add new package.
  2021-07-16 13:41 [ptxdist] [PATCH 1/6] rules/host-gnu-efi: Add new package Christian Melki
  2021-07-16 13:41 ` [ptxdist] [PATCH 2/6] rules/gnu-efi: " Christian Melki
@ 2021-07-16 13:41 ` Christian Melki
  2021-07-16 13:41 ` [ptxdist] [PATCH 4/6] rules/efitools: " Christian Melki
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Christian Melki @ 2021-07-16 13:41 UTC (permalink / raw)
  To: ptxdist

Host efitools. Depending on your needs, this might be
used for signing EFI images from host environment or
reading efi variables from a target environment.
This is the host side toolset.

Signed-off-by: Christian Melki <christian.melki@t2data.com>
---
 rules/host-efitools.in   |  9 +++++++++
 rules/host-efitools.make | 29 +++++++++++++++++++++++++++++
 2 files changed, 38 insertions(+)
 create mode 100644 rules/host-efitools.in
 create mode 100644 rules/host-efitools.make

diff --git a/rules/host-efitools.in b/rules/host-efitools.in
new file mode 100644
index 000000000..6313ca6a3
--- /dev/null
+++ b/rules/host-efitools.in
@@ -0,0 +1,9 @@
+## SECTION=hosttools_noprompt
+
+config HOST_EFITOOLS
+	tristate
+	default y if ALLYES
+	select HOST_OPENSSL
+	select HOST_SBSIGNTOOLS
+	help
+	  Required host part to build efitools for target.
diff --git a/rules/host-efitools.make b/rules/host-efitools.make
new file mode 100644
index 000000000..c668b06d0
--- /dev/null
+++ b/rules/host-efitools.make
@@ -0,0 +1,29 @@
+# -*-makefile-*-
+# Copyright (C) 2021 by Christian Melki <christian.melki@t2data.com>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+HOST_PACKAGES-$(PTXCONF_HOST_EFITOOLS) += host-efitools
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+HOST_EFITOOLS_ARCH = $(call ptx/force-sh, uname -m)
+
+HOST_EFITOOLS_CONF_TOOL	:= NO
+
+HOST_EFITOOLS_MAKE_ENV	:= \
+	$(HOST_ENV) \
+	ARCH=$(HOST_EFITOOLS_ARCH) \
+	INCDIR_PREFIX=$(PTXDIST_SYSROOT_HOST) \
+	CRTPATH_PREFIX=$(PTXDIST_SYSROOT_HOST) \
+	OPENSSL_LIB=$(PTXDIST_SYSROOT_HOST) \
+	prefix=/usr
+
+# vim: syntax=make
-- 
2.32.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ptxdist] [PATCH 4/6] rules/efitools: Add new package.
  2021-07-16 13:41 [ptxdist] [PATCH 1/6] rules/host-gnu-efi: Add new package Christian Melki
  2021-07-16 13:41 ` [ptxdist] [PATCH 2/6] rules/gnu-efi: " Christian Melki
  2021-07-16 13:41 ` [ptxdist] [PATCH 3/6] rules/host-efitools: " Christian Melki
@ 2021-07-16 13:41 ` Christian Melki
  2021-07-16 13:41 ` [ptxdist] [PATCH 5/6] rules/host-sbsigntools: " Christian Melki
  2021-07-16 13:41 ` [ptxdist] [PATCH 6/6] rules/sbsigntools: " Christian Melki
  4 siblings, 0 replies; 10+ messages in thread
From: Christian Melki @ 2021-07-16 13:41 UTC (permalink / raw)
  To: ptxdist

efitools for target. Might be used for reading efivariables
or signing/resigning images on the target. efitools might also
be used for signing EFI images on host.
This is the target package.

Signed-off-by: Christian Melki <christian.melki@t2data.com>
---
 rules/efitools.in   | 11 ++++++
 rules/efitools.make | 84 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 95 insertions(+)
 create mode 100644 rules/efitools.in
 create mode 100644 rules/efitools.make

diff --git a/rules/efitools.in b/rules/efitools.in
new file mode 100644
index 000000000..1b1b1d0ba
--- /dev/null
+++ b/rules/efitools.in
@@ -0,0 +1,11 @@
+## SECTION=shell_and_console
+
+config EFITOOLS
+	tristate
+	select LIBC_DL
+	select GNU_EFI
+	select OPENSSL
+	select HOST_EFITOOLS
+	prompt "efitools"
+	help
+	  Useful tools for manipulating UEFI secure boot platforms
diff --git a/rules/efitools.make b/rules/efitools.make
new file mode 100644
index 000000000..4e43dc3fd
--- /dev/null
+++ b/rules/efitools.make
@@ -0,0 +1,84 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2021 by Christian Melki <christian.melki@t2data.com>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_EFITOOLS) += efitools
+
+#
+# Paths and names
+#
+EFITOOLS_VERSION	:= 1.9.2
+EFITOOLS_MD5		:= a3a3f04ed6aa5486c97dd206edeebe0a
+EFITOOLS		:= efitools-$(EFITOOLS_VERSION)
+EFITOOLS_SUFFIX		:= tar.gz
+EFITOOLS_URL		:= https://git.kernel.org/pub/scm/linux/kernel/git/jejb/efitools.git/snapshot/$(EFITOOLS).$(EFITOOLS_SUFFIX)
+EFITOOLS_SOURCE		:= $(SRCDIR)/$(EFITOOLS).$(EFITOOLS_SUFFIX)
+EFITOOLS_DIR		:= $(BUILDDIR)/$(EFITOOLS)
+EFITOOLS_LICENSE	:= GPL-2.0-or-later
+EFITOOLS_LICENSE_FILES	:= \
+	file://COPYING;md5=97d554a32881fee0aa283d96e47cb24a
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+ifdef PTXCONF_ARCH_X86
+EFITOOLS_ARCH       := ia32
+ifdef PTXCONF_ARCH_X86_64
+EFITOOLS_ARCH       := x86_64
+endif
+endif
+ifdef PTXCONF_ARCH_ARM
+EFITOOLS_ARCH       := arm
+endif
+ifdef PTXCONF_ARCH_ARM64
+EFITOOLS_ARCH       := aarch64
+endif
+
+EFITOOLS_CONF_TOOL	:= NO
+
+EFITOOLS_MAKE_ENV	:= \
+	$(CROSS_ENV) \
+	ARCH=$(EFITOOLS_ARCH) \
+	INCDIR_PREFIX=$(SYSROOT) \
+	CRTPATH_PREFIX=$(SYSROOT) \
+	OPENSSL_LIB=$(PTXDIST_SYSROOT_HOST) \
+	SIGN_EFI_SIG_LIST=$(PTXDIST_SYSROOT_HOST)/usr/bin/sign-efi-sig-list \
+	CERT_TO_EFI_SIG_LIST=$(PTXDIST_SYSROOT_HOST)/usr/bin/cert-to-efi-sig-list \
+	CERT_TO_EFI_HASH_LIST=$(PTXDIST_SYSROOT_HOST)/usr/bin/cert-to-efi-hash-list \
+	HASH_TO_EFI_SIG_LIST=$(PTXDIST_SYSROOT_HOST)/usr/bin/hash-to-efi-sig-list \
+	prefix=/usr
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/efitools.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, efitools)
+	@$(call install_fixup, efitools,PRIORITY,optional)
+	@$(call install_fixup, efitools,SECTION,base)
+	@$(call install_fixup, efitools,AUTHOR,"Christian Melki <christian.melki@t2data.com>")
+	@$(call install_fixup, efitools,DESCRIPTION,missing)
+	@$(call install_copy, efitools, 0, 0, 0755, -, /usr/bin/cert-to-efi-hash-list)
+	@$(call install_copy, efitools, 0, 0, 0755, -, /usr/bin/cert-to-efi-sig-list)
+	@$(call install_copy, efitools, 0, 0, 0755, -, /usr/bin/efi-readvar)
+	@$(call install_copy, efitools, 0, 0, 0755, -, /usr/bin/efi-updatevar)
+	@$(call install_copy, efitools, 0, 0, 0755, -, /usr/bin/efitool-mkusb)
+	@$(call install_copy, efitools, 0, 0, 0755, -, /usr/bin/flash-var)
+	@$(call install_copy, efitools, 0, 0, 0755, -, /usr/bin/hash-to-efi-sig-list)
+	@$(call install_copy, efitools, 0, 0, 0755, -, /usr/bin/sig-list-to-certs)
+	@$(call install_copy, efitools, 0, 0, 0755, -, /usr/bin/sign-efi-sig-list)
+	@$(call install_finish, efitools)
+
+	@$(call touch)
+
+# vim: syntax=make
-- 
2.32.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ptxdist] [PATCH 5/6] rules/host-sbsigntools: Add new package.
  2021-07-16 13:41 [ptxdist] [PATCH 1/6] rules/host-gnu-efi: Add new package Christian Melki
                   ` (2 preceding siblings ...)
  2021-07-16 13:41 ` [ptxdist] [PATCH 4/6] rules/efitools: " Christian Melki
@ 2021-07-16 13:41 ` Christian Melki
  2021-07-16 13:41 ` [ptxdist] [PATCH 6/6] rules/sbsigntools: " Christian Melki
  4 siblings, 0 replies; 10+ messages in thread
From: Christian Melki @ 2021-07-16 13:41 UTC (permalink / raw)
  To: ptxdist

sbsigntools as a host package.
sbsign is an EFI image signer for use with secure boot.
Common use is on the host sign to sign the images.
Depends on libuuid, openssl and gnu-efi.

Signed-off-by: Christian Melki <christian.melki@t2data.com>
---
 rules/host-sbsigntools.in   | 10 ++++++++++
 rules/host-sbsigntools.make | 26 ++++++++++++++++++++++++++
 2 files changed, 36 insertions(+)
 create mode 100644 rules/host-sbsigntools.in
 create mode 100644 rules/host-sbsigntools.make

diff --git a/rules/host-sbsigntools.in b/rules/host-sbsigntools.in
new file mode 100644
index 000000000..e523fdce9
--- /dev/null
+++ b/rules/host-sbsigntools.in
@@ -0,0 +1,10 @@
+## SECTION=hosttools_noprompt
+
+config HOST_SBSIGNTOOLS
+	tristate
+	default y if ALLYES
+	select HOST_OPENSSL
+	select HOST_LIBUUID
+	select HOST_GNU_EFI
+	help
+	  Signing utility for UEFI secure boot.
diff --git a/rules/host-sbsigntools.make b/rules/host-sbsigntools.make
new file mode 100644
index 000000000..1308ac2dd
--- /dev/null
+++ b/rules/host-sbsigntools.make
@@ -0,0 +1,26 @@
+# -*-makefile-*-
+# Copyright (C) 2021 by Christian Melki <christian.melki@t2data.com>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+HOST_PACKAGES-$(PTXCONF_HOST_SBSIGNTOOLS) += host-sbsigntools
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+HOST_SBSIGNTOOLS_ARCH = $(call ptx/force-sh, uname -m)
+
+HOST_SBSIGNTOOLS_CONF_TOOL	:= autoconf
+
+HOST_SBSIGNTOOLS_CONF_OPT	:= \
+	$(HOST_AUTOCONF) \
+	--with-gnu-efi=$(PTXDIST_SYSROOT_HOST) \
+	--with-efi-arch=$(HOST_SBSIGNTOOLS_ARCH)
+
+# vim: syntax=make
-- 
2.32.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ptxdist] [PATCH 6/6] rules/sbsigntools: Add new package.
  2021-07-16 13:41 [ptxdist] [PATCH 1/6] rules/host-gnu-efi: Add new package Christian Melki
                   ` (3 preceding siblings ...)
  2021-07-16 13:41 ` [ptxdist] [PATCH 5/6] rules/host-sbsigntools: " Christian Melki
@ 2021-07-16 13:41 ` Christian Melki
  4 siblings, 0 replies; 10+ messages in thread
From: Christian Melki @ 2021-07-16 13:41 UTC (permalink / raw)
  To: ptxdist

sbsigntools as a target package.
sbsign is a EFI image signer. This is the target package.
Used to sign/resign images on target.

Signed-off-by: Christian Melki <christian.melki@t2data.com>
---
 rules/sbsigntools.in   | 11 +++++++
 rules/sbsigntools.make | 73 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 84 insertions(+)
 create mode 100644 rules/sbsigntools.in
 create mode 100644 rules/sbsigntools.make

diff --git a/rules/sbsigntools.in b/rules/sbsigntools.in
new file mode 100644
index 000000000..146549eeb
--- /dev/null
+++ b/rules/sbsigntools.in
@@ -0,0 +1,11 @@
+## SECTION=security
+
+config SBSIGNTOOLS
+	tristate
+	select OPENSSL
+	select LIBUUID
+	select GNU_EFI
+	select BINUTILS
+	prompt "sbsigntools"
+	help
+	  Signing utility for UEFI secure boot.
diff --git a/rules/sbsigntools.make b/rules/sbsigntools.make
new file mode 100644
index 000000000..45b65ebbd
--- /dev/null
+++ b/rules/sbsigntools.make
@@ -0,0 +1,73 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2021 by Christian Melki <christian.melki@t2data.com>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_SBSIGNTOOLS) += sbsigntools
+
+#
+# Paths and names
+#
+SBSIGNTOOLS_VERSION	:= 0.9.4
+SBSIGNTOOLS_MD5		:= a0f39307109d32c88ef460de52612f5c
+SBSIGNTOOLS		:= sbsigntools-$(SBSIGNTOOLS_VERSION)
+SBSIGNTOOLS_SUFFIX	:= tar.gz
+SBSIGNTOOLS_URL		:= https://git.kernel.org/pub/scm/linux/kernel/git/jejb/sbsigntools.git/snapshot/$(SBSIGNTOOLS).$(SBSIGNTOOLS_SUFFIX)
+SBSIGNTOOLS_SOURCE	:= $(SRCDIR)/$(SBSIGNTOOLS).$(SBSIGNTOOLS_SUFFIX)
+SBSIGNTOOLS_DIR		:= $(BUILDDIR)/$(SBSIGNTOOLS)
+SBSIGNTOOLS_LICENSE	:= GPL-3.0-only
+SBSIGNTOOLS_LICENSE_FILES	:= \
+	file://LICENSE.GPLv3;md5=9eef91148a9b14ec7f9df333daebc746
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+ifdef PTXCONF_ARCH_X86
+SBSIGNTOOLS_ARCH       := i386
+ifdef PTXCONF_ARCH_X86_64
+SBSIGNTOOLS_ARCH       := x86_64
+endif
+endif
+ifdef PTXCONF_ARCH_ARM
+SBSIGNTOOLS_ARCH       := arm
+endif
+ifdef PTXCONF_ARCH_ARM64
+SBSIGNTOOLS_ARCH       := aarch64
+endif
+
+SBSIGNTOOLS_CONF_TOOL	:= autoconf
+SBSIGNTOOLS_CONF_OPT	:= \
+	$(CROSS_AUTOCONF_USR) \
+	--with-gnu-efi=$(SYSROOT) \
+	--with-efi-arch=$(SBSIGNTOOLS_ARCH)
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/sbsigntools.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, sbsigntools)
+	@$(call install_fixup, sbsigntools,PRIORITY,optional)
+	@$(call install_fixup, sbsigntools,SECTION,base)
+	@$(call install_fixup, sbsigntools,AUTHOR,"Christian Melki <christian.melki@t2data.com>")
+	@$(call install_fixup, sbsigntools,DESCRIPTION,missing)
+	@$(call install_copy, sbsigntools, 0, 0, 0755, -, /usr/bin/sbattach)
+	@$(call install_copy, sbsigntools, 0, 0, 0755, -, /usr/bin/sbkeysync)
+	@$(call install_copy, sbsigntools, 0, 0, 0755, -, /usr/bin/sbsiglist)
+	@$(call install_copy, sbsigntools, 0, 0, 0755, -, /usr/bin/sbsign)
+	@$(call install_copy, sbsigntools, 0, 0, 0755, -, /usr/bin/sbvarsign)
+	@$(call install_copy, sbsigntools, 0, 0, 0755, -, /usr/bin/sbverify)
+	@$(call install_finish, sbsigntools)
+
+	@$(call touch)
+
+# vim: syntax=make
-- 
2.32.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ptxdist] [PATCH 2/6] rules/gnu-efi: Add new package.
  2021-07-16 13:41 ` [ptxdist] [PATCH 2/6] rules/gnu-efi: " Christian Melki
@ 2021-07-19  9:09   ` Roland Hieber
  2021-07-19  9:11     ` Roland Hieber
  2021-07-20 13:08     ` Christian Melki
  0 siblings, 2 replies; 10+ messages in thread
From: Roland Hieber @ 2021-07-19  9:09 UTC (permalink / raw)
  To: Christian Melki; +Cc: ptxdist

Hi,

generally you can just prefix the commit message with the package name
(no "rules/"), that's how we usually do it. And no dot at the end of the
message.

More below:

On Fri, Jul 16, 2021 at 03:41:03PM +0200, Christian Melki wrote:
> Target GNU EFI library. Used for various EFI work.
> Depending on your needs, target binaries for EFI stuff might be needed.
> This is used by efitools etc.
> 
> Signed-off-by: Christian Melki <christian.melki@t2data.com>
> ---
>  rules/gnu-efi.in   |  6 ++++
>  rules/gnu-efi.make | 71 ++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 77 insertions(+)
>  create mode 100644 rules/gnu-efi.in
>  create mode 100644 rules/gnu-efi.make
> 
> diff --git a/rules/gnu-efi.in b/rules/gnu-efi.in
> new file mode 100644
> index 000000000..b21192222
> --- /dev/null
> +++ b/rules/gnu-efi.in
> @@ -0,0 +1,6 @@
> +## SECTION=system_libraries
> +menuconfig GNU_EFI
> +	tristate
> +	prompt "gnu-efi                       "
> +	help
> +	  This is gnu-efi, a library for providing EFI functions.
> diff --git a/rules/gnu-efi.make b/rules/gnu-efi.make
> new file mode 100644
> index 000000000..33a27020b
> --- /dev/null
> +++ b/rules/gnu-efi.make
> @@ -0,0 +1,71 @@
> +# -*-makefile-*-
> +#
> +# Copyright (C) 2021 by Christian Melki <christian.melki@t2data.com>
> +#
> +# For further information about the PTXdist project and license conditions
> +# see the README file.
> +#
> +
> +#
> +# We provide this package
> +#
> +PACKAGES-$(PTXCONF_GNU_EFI) += gnu-efi
> +
> +#
> +# Paths and names
> +#
> +# No tags: use a fake descriptive commit-ish to include the date
> +GNU_EFI_VERSION		:= 3.0.13
> +GNU_EFI_MD5		:= 8ec4221f505c78e6fc375c2fd7f0c549
> +GNU_EFI			:= gnu-efi-$(GNU_EFI_VERSION)
> +GNU_EFI_SUFFIX		:= tar.bz2
> +GNU_EFI_URL		:= https://sourceforge.net/projects/gnu-efi/files/gnu-efi-$(GNU_EFI_VERSION).$(GNU_EFI_SUFFIX)
> +GNU_EFI_SOURCE		:= $(SRCDIR)/$(GNU_EFI).$(GNU_EFI_SUFFIX)
> +GNU_EFI_DIR		:= $(BUILDDIR)/$(GNU_EFI)
> +GNU_EFI_LICENSE		:= BSD

There are tons of slightly different BSD licenses… :-), please have a
look at the SPDX list [0] and choose the correct identifier. Also please
add a GNU_EFI_LICENSE_FILES variable as documentation how you came to
that conclusion. Or if you feel like skipping this part, "unknown" is
the special expression for "no one has looked at this yet".

[0]: <https://spdx.org/licenses/> 

The same applies to other patches in this series.

In this case, I found something relevant in README.efilib which applies
to the code in lib/ and inc/, but for the rest we'll have to fall back
to the comment headers in gnuefi/*.c for the rest. I'm using
spdx-license-match [1] here to get a diff between the version that is in
README.efilib and the template from SPDX:

[1]: <https://github.com/rohieb/spdx-license-match>

    $ sed -n '19,$p' README.efilib | spdx-license-match -n 3 --guess BSD
    [...]

Hm. All BSD matches are pretty bad, maybe this is not BSD after all?

    $ sed -n '19,$p' README.efilib | spdx-license-match
    [...]

Hmm. BSD-1-Clause is the best match, but the project license still looks
differently, mainly the first clause is missing, and an additional
sentence about EFI at the end. So I would classify it as "custom", not
BSD.

    $ sed -n '19,$p' README.efilib | md5sum
    b1b8d397eda0e4b82e34c7b58610dfcb

The headers in gnuefi/*.c look like BSD-3-Clause.

    $ sed -n 2,35p gnuefi/reloc_x86_64.c | spdx-license-match -g BSD-3
    [...]

Yes, the diff looks inconspicuous.

    $ sed -n 2,35p gnuefi/reloc_x86_64.c | md5sum
    8f99c3f647f56ad3fb9519d6026af2e2

This gives us:

    GNU_EFI_LICENSE         := custom
    GNU_EFI_LICENSE_FILES   := \
      file://README.efilib;startline=19;md5=b1b8d397eda0e4b82e34c7b58610dfcb
      file://gnuefi/reloc_x86_64.c;startline=2;endline=35;md5=8f99c3f647f56ad3fb9519d6026af2e2


 - Roland

> +
> +# ----------------------------------------------------------------------------
> +# Compile
> +# ----------------------------------------------------------------------------               
> +
> +ifdef PTXCONF_ARCH_X86 
> +GNU_EFI_ARCH = ia32
> +ifdef PTXCONF_ARCH_X86_64
> +GNU_EFI_ARCH = x86_64
> +endif
> +endif
> +ifdef PTXCONF_ARCH_ARM
> +GNU_EFI_ARCH = arm
> +endif
> +ifdef PTXCONF_ARCH_ARM64
> +GNU_EFI_ARCH = aarch64
> +endif
> +
> +GNU_EFI_CONF_TOOL	:= NO
> +GNU_EFI_MAKE_ENV	:= \
> +	ARCH=$(GNU_EFI_ARCH) \
> +	CROSS_COMPILE=$(COMPILER_PREFIX) \
> +	PREFIX=/usr \
> +	LIBDIR=/usr/$(CROSS_LIB_DIR)
> +
> +GNU_EFI_INSTALL_OPT := \
> +	INSTALLROOT=$(GNU_EFI_PKGDIR) \
> +	PREFIX=/usr \
> +	LIBDIR=/usr/$(CROSS_LIB_DIR) \
> +	install
> +
> +# ----------------------------------------------------------------------------
> +# Target-Install
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/gnu-efi.targetinstall:
> +	@$(call targetinfo)
> +	@$(call install_init, gnu-efi)
> +	@$(call install_fixup, gnu-efi,PRIORITY,optional)
> +	@$(call install_fixup, gnu-efi,SECTION,base)
> +	@$(call install_fixup, gnu-efi,AUTHOR,"Christian Melki <christian.melki@t2data.com>")
> +	@$(call install_fixup, gnu-efi,DESCRIPTION,missing)
> +	@$(call install_finish, gnu-efi)
> +	@$(call touch)
> +
> +# vim: syntax=make
> -- 
> 2.32.0
> 
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de
> To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de
> 

-- 
Roland Hieber, Pengutronix e.K.          | r.hieber@pengutronix.de     |
Steuerwalder Str. 21                     | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686         | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ptxdist] [PATCH 2/6] rules/gnu-efi: Add new package.
  2021-07-19  9:09   ` Roland Hieber
@ 2021-07-19  9:11     ` Roland Hieber
  2021-07-20 13:08     ` Christian Melki
  1 sibling, 0 replies; 10+ messages in thread
From: Roland Hieber @ 2021-07-19  9:11 UTC (permalink / raw)
  To: Christian Melki; +Cc: ptxdist

On Mon, Jul 19, 2021 at 11:09:40AM +0200, Roland Hieber wrote:
> On Fri, Jul 16, 2021 at 03:41:03PM +0200, Christian Melki wrote:
> > +# No tags: use a fake descriptive commit-ish to include the date
> > +GNU_EFI_VERSION		:= 3.0.13
> > +GNU_EFI_MD5		:= 8ec4221f505c78e6fc375c2fd7f0c549
> > +GNU_EFI			:= gnu-efi-$(GNU_EFI_VERSION)
> > +GNU_EFI_SUFFIX		:= tar.bz2
> > +GNU_EFI_URL		:= https://sourceforge.net/projects/gnu-efi/files/gnu-efi-$(GNU_EFI_VERSION).$(GNU_EFI_SUFFIX)
> > +GNU_EFI_SOURCE		:= $(SRCDIR)/$(GNU_EFI).$(GNU_EFI_SUFFIX)
> > +GNU_EFI_DIR		:= $(BUILDDIR)/$(GNU_EFI)
> > +GNU_EFI_LICENSE		:= BSD
> 
> There are tons of slightly different BSD licenses… :-), please have a
> look at the SPDX list [0] and choose the correct identifier. Also please
> add a GNU_EFI_LICENSE_FILES variable as documentation how you came to
> that conclusion. Or if you feel like skipping this part, "unknown" is
> the special expression for "no one has looked at this yet".
> 
> [0]: <https://spdx.org/licenses/> 
> 
> The same applies to other patches in this series.

Sorry, I wrote this sentence and then forgot to check. The others look
fine :-)

 - Roland

-- 
Roland Hieber, Pengutronix e.K.          | r.hieber@pengutronix.de     |
Steuerwalder Str. 21                     | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686         | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ptxdist] [PATCH 2/6] rules/gnu-efi: Add new package.
  2021-07-19  9:09   ` Roland Hieber
  2021-07-19  9:11     ` Roland Hieber
@ 2021-07-20 13:08     ` Christian Melki
  2021-07-20 14:22       ` Roland Hieber
  1 sibling, 1 reply; 10+ messages in thread
From: Christian Melki @ 2021-07-20 13:08 UTC (permalink / raw)
  To: Roland Hieber; +Cc: ptxdist

On 7/19/21 11:09 AM, Roland Hieber wrote:
> Hi,
> 
> generally you can just prefix the commit message with the package name
> (no "rules/"), that's how we usually do it. And no dot at the end of the
> message.
> 

Ack. Will do.

> More below:
> 
> On Fri, Jul 16, 2021 at 03:41:03PM +0200, Christian Melki wrote:
>> Target GNU EFI library. Used for various EFI work.
>> Depending on your needs, target binaries for EFI stuff might be needed.
>> This is used by efitools etc.
>>
>> Signed-off-by: Christian Melki <christian.melki@t2data.com>
>> ---
>>  rules/gnu-efi.in   |  6 ++++
>>  rules/gnu-efi.make | 71 ++++++++++++++++++++++++++++++++++++++++++++++
>>  2 files changed, 77 insertions(+)
>>  create mode 100644 rules/gnu-efi.in
>>  create mode 100644 rules/gnu-efi.make
>>
>> diff --git a/rules/gnu-efi.in b/rules/gnu-efi.in
>> new file mode 100644
>> index 000000000..b21192222
>> --- /dev/null
>> +++ b/rules/gnu-efi.in
>> @@ -0,0 +1,6 @@
>> +## SECTION=system_libraries
>> +menuconfig GNU_EFI
>> +	tristate
>> +	prompt "gnu-efi                       "
>> +	help
>> +	  This is gnu-efi, a library for providing EFI functions.
>> diff --git a/rules/gnu-efi.make b/rules/gnu-efi.make
>> new file mode 100644
>> index 000000000..33a27020b
>> --- /dev/null
>> +++ b/rules/gnu-efi.make
>> @@ -0,0 +1,71 @@
>> +# -*-makefile-*-
>> +#
>> +# Copyright (C) 2021 by Christian Melki <christian.melki@t2data.com>
>> +#
>> +# For further information about the PTXdist project and license conditions
>> +# see the README file.
>> +#
>> +
>> +#
>> +# We provide this package
>> +#
>> +PACKAGES-$(PTXCONF_GNU_EFI) += gnu-efi
>> +
>> +#
>> +# Paths and names
>> +#
>> +# No tags: use a fake descriptive commit-ish to include the date
>> +GNU_EFI_VERSION		:= 3.0.13
>> +GNU_EFI_MD5		:= 8ec4221f505c78e6fc375c2fd7f0c549
>> +GNU_EFI			:= gnu-efi-$(GNU_EFI_VERSION)
>> +GNU_EFI_SUFFIX		:= tar.bz2
>> +GNU_EFI_URL		:= https://sourceforge.net/projects/gnu-efi/files/gnu-efi-$(GNU_EFI_VERSION).$(GNU_EFI_SUFFIX)
>> +GNU_EFI_SOURCE		:= $(SRCDIR)/$(GNU_EFI).$(GNU_EFI_SUFFIX)
>> +GNU_EFI_DIR		:= $(BUILDDIR)/$(GNU_EFI)
>> +GNU_EFI_LICENSE		:= BSD
> 
> There are tons of slightly different BSD licenses… :-), please have a
> look at the SPDX list [0] and choose the correct identifier. Also please
> add a GNU_EFI_LICENSE_FILES variable as documentation how you came to
> that conclusion. Or if you feel like skipping this part, "unknown" is
> the special expression for "no one has looked at this yet".
> 
> [0]: <https://spdx.org/licenses/> 
> 
> The same applies to other patches in this series.
> 
> In this case, I found something relevant in README.efilib which applies
> to the code in lib/ and inc/, but for the rest we'll have to fall back
> to the comment headers in gnuefi/*.c for the rest. I'm using
> spdx-license-match [1] here to get a diff between the version that is in
> README.efilib and the template from SPDX:
> 
> [1]: <https://github.com/rohieb/spdx-license-match>
> 
>     $ sed -n '19,$p' README.efilib | spdx-license-match -n 3 --guess BSD
>     [...]
> 
> Hm. All BSD matches are pretty bad, maybe this is not BSD after all?
> 
>     $ sed -n '19,$p' README.efilib | spdx-license-match
>     [...]
> 
> Hmm. BSD-1-Clause is the best match, but the project license still looks
> differently, mainly the first clause is missing, and an additional
> sentence about EFI at the end. So I would classify it as "custom", not
> BSD.
> 
>     $ sed -n '19,$p' README.efilib | md5sum
>     b1b8d397eda0e4b82e34c7b58610dfcb
> 
> The headers in gnuefi/*.c look like BSD-3-Clause.
> 
>     $ sed -n 2,35p gnuefi/reloc_x86_64.c | spdx-license-match -g BSD-3
>     [...]
> 
> Yes, the diff looks inconspicuous.
> 
>     $ sed -n 2,35p gnuefi/reloc_x86_64.c | md5sum
>     8f99c3f647f56ad3fb9519d6026af2e2
> 
> This gives us:
> 
>     GNU_EFI_LICENSE         := custom
>     GNU_EFI_LICENSE_FILES   := \
>       file://README.efilib;startline=19;md5=b1b8d397eda0e4b82e34c7b58610dfcb
>       file://gnuefi/reloc_x86_64.c;startline=2;endline=35;md5=8f99c3f647f56ad3fb9519d6026af2e2
> 
> 
>  - Roland
> 

Fine with me. To me, the code looks like BSD (3-Clause?) AND GPL-2.0+.
GPL-2.0+ is what I would add.

I don't really know what custom would for mean a user since I can't see
it being used in any package? Is gnu-efi the only package being slightly
imprecise with its license declaration?
Also, why would you want to be that literal?

It's very clear to me that the intention of author and the code is to be
BSD (and whatever still is left as GPL-2.0+).

Also, IANAL. :)

>> +
>> +# ----------------------------------------------------------------------------
>> +# Compile
>> +# ----------------------------------------------------------------------------               
>> +
>> +ifdef PTXCONF_ARCH_X86 
>> +GNU_EFI_ARCH = ia32
>> +ifdef PTXCONF_ARCH_X86_64
>> +GNU_EFI_ARCH = x86_64
>> +endif
>> +endif
>> +ifdef PTXCONF_ARCH_ARM
>> +GNU_EFI_ARCH = arm
>> +endif
>> +ifdef PTXCONF_ARCH_ARM64
>> +GNU_EFI_ARCH = aarch64
>> +endif
>> +
>> +GNU_EFI_CONF_TOOL	:= NO
>> +GNU_EFI_MAKE_ENV	:= \
>> +	ARCH=$(GNU_EFI_ARCH) \
>> +	CROSS_COMPILE=$(COMPILER_PREFIX) \
>> +	PREFIX=/usr \
>> +	LIBDIR=/usr/$(CROSS_LIB_DIR)
>> +
>> +GNU_EFI_INSTALL_OPT := \
>> +	INSTALLROOT=$(GNU_EFI_PKGDIR) \
>> +	PREFIX=/usr \
>> +	LIBDIR=/usr/$(CROSS_LIB_DIR) \
>> +	install
>> +
>> +# ----------------------------------------------------------------------------
>> +# Target-Install
>> +# ----------------------------------------------------------------------------
>> +
>> +$(STATEDIR)/gnu-efi.targetinstall:
>> +	@$(call targetinfo)
>> +	@$(call install_init, gnu-efi)
>> +	@$(call install_fixup, gnu-efi,PRIORITY,optional)
>> +	@$(call install_fixup, gnu-efi,SECTION,base)
>> +	@$(call install_fixup, gnu-efi,AUTHOR,"Christian Melki <christian.melki@t2data.com>")
>> +	@$(call install_fixup, gnu-efi,DESCRIPTION,missing)
>> +	@$(call install_finish, gnu-efi)
>> +	@$(call touch)
>> +
>> +# vim: syntax=make
>> -- 
>> 2.32.0
>>
>>
>> _______________________________________________
>> ptxdist mailing list
>> ptxdist@pengutronix.de
>> To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de
>>
> 


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [ptxdist] [PATCH 2/6] rules/gnu-efi: Add new package.
  2021-07-20 13:08     ` Christian Melki
@ 2021-07-20 14:22       ` Roland Hieber
  0 siblings, 0 replies; 10+ messages in thread
From: Roland Hieber @ 2021-07-20 14:22 UTC (permalink / raw)
  To: Christian Melki; +Cc: ptxdist

On Tue, Jul 20, 2021 at 03:08:53PM +0200, Christian Melki wrote:
> On 7/19/21 11:09 AM, Roland Hieber wrote:
> > Hi,
> > 
> > generally you can just prefix the commit message with the package name
> > (no "rules/"), that's how we usually do it. And no dot at the end of the
> > message.
> > 
> 
> Ack. Will do.
> 
> > More below:
> > 
> > On Fri, Jul 16, 2021 at 03:41:03PM +0200, Christian Melki wrote:
> >> Target GNU EFI library. Used for various EFI work.
> >> Depending on your needs, target binaries for EFI stuff might be needed.
> >> This is used by efitools etc.
> >>
> >> Signed-off-by: Christian Melki <christian.melki@t2data.com>
> >> ---
> >>  rules/gnu-efi.in   |  6 ++++
> >>  rules/gnu-efi.make | 71 ++++++++++++++++++++++++++++++++++++++++++++++
> >>  2 files changed, 77 insertions(+)
> >>  create mode 100644 rules/gnu-efi.in
> >>  create mode 100644 rules/gnu-efi.make
> >>
> >> diff --git a/rules/gnu-efi.in b/rules/gnu-efi.in
> >> new file mode 100644
> >> index 000000000..b21192222
> >> --- /dev/null
> >> +++ b/rules/gnu-efi.in
> >> @@ -0,0 +1,6 @@
> >> +## SECTION=system_libraries
> >> +menuconfig GNU_EFI
> >> +	tristate
> >> +	prompt "gnu-efi                       "
> >> +	help
> >> +	  This is gnu-efi, a library for providing EFI functions.
> >> diff --git a/rules/gnu-efi.make b/rules/gnu-efi.make
> >> new file mode 100644
> >> index 000000000..33a27020b
> >> --- /dev/null
> >> +++ b/rules/gnu-efi.make
> >> @@ -0,0 +1,71 @@
> >> +# -*-makefile-*-
> >> +#
> >> +# Copyright (C) 2021 by Christian Melki <christian.melki@t2data.com>
> >> +#
> >> +# For further information about the PTXdist project and license conditions
> >> +# see the README file.
> >> +#
> >> +
> >> +#
> >> +# We provide this package
> >> +#
> >> +PACKAGES-$(PTXCONF_GNU_EFI) += gnu-efi
> >> +
> >> +#
> >> +# Paths and names
> >> +#
> >> +# No tags: use a fake descriptive commit-ish to include the date
> >> +GNU_EFI_VERSION		:= 3.0.13
> >> +GNU_EFI_MD5		:= 8ec4221f505c78e6fc375c2fd7f0c549
> >> +GNU_EFI			:= gnu-efi-$(GNU_EFI_VERSION)
> >> +GNU_EFI_SUFFIX		:= tar.bz2
> >> +GNU_EFI_URL		:= https://sourceforge.net/projects/gnu-efi/files/gnu-efi-$(GNU_EFI_VERSION).$(GNU_EFI_SUFFIX)
> >> +GNU_EFI_SOURCE		:= $(SRCDIR)/$(GNU_EFI).$(GNU_EFI_SUFFIX)
> >> +GNU_EFI_DIR		:= $(BUILDDIR)/$(GNU_EFI)
> >> +GNU_EFI_LICENSE		:= BSD
> > 
> > There are tons of slightly different BSD licenses… :-), please have a
> > look at the SPDX list [0] and choose the correct identifier. Also please
> > add a GNU_EFI_LICENSE_FILES variable as documentation how you came to
> > that conclusion. Or if you feel like skipping this part, "unknown" is
> > the special expression for "no one has looked at this yet".
> > 
> > [0]: <https://spdx.org/licenses/> 
> > 
> > The same applies to other patches in this series.
> > 
> > In this case, I found something relevant in README.efilib which applies
> > to the code in lib/ and inc/, but for the rest we'll have to fall back
> > to the comment headers in gnuefi/*.c for the rest. I'm using
> > spdx-license-match [1] here to get a diff between the version that is in
> > README.efilib and the template from SPDX:
> > 
> > [1]: <https://github.com/rohieb/spdx-license-match>
> > 
> >     $ sed -n '19,$p' README.efilib | spdx-license-match -n 3 --guess BSD
> >     [...]
> > 
> > Hm. All BSD matches are pretty bad, maybe this is not BSD after all?
> > 
> >     $ sed -n '19,$p' README.efilib | spdx-license-match
> >     [...]
> > 
> > Hmm. BSD-1-Clause is the best match, but the project license still looks
> > differently, mainly the first clause is missing, and an additional
> > sentence about EFI at the end. So I would classify it as "custom", not
> > BSD.
> > 
> >     $ sed -n '19,$p' README.efilib | md5sum
> >     b1b8d397eda0e4b82e34c7b58610dfcb
> > 
> > The headers in gnuefi/*.c look like BSD-3-Clause.
> > 
> >     $ sed -n 2,35p gnuefi/reloc_x86_64.c | spdx-license-match -g BSD-3
> >     [...]
> > 
> > Yes, the diff looks inconspicuous.
> > 
> >     $ sed -n 2,35p gnuefi/reloc_x86_64.c | md5sum
> >     8f99c3f647f56ad3fb9519d6026af2e2
> > 
> > This gives us:
> > 
> >     GNU_EFI_LICENSE         := custom
> >     GNU_EFI_LICENSE_FILES   := \
> >       file://README.efilib;startline=19;md5=b1b8d397eda0e4b82e34c7b58610dfcb
> >       file://gnuefi/reloc_x86_64.c;startline=2;endline=35;md5=8f99c3f647f56ad3fb9519d6026af2e2
> > 
> > 
> >  - Roland
> > 
> 
> Fine with me. To me, the code looks like BSD (3-Clause?) AND GPL-2.0+.
> GPL-2.0+ is what I would add.

Ah, I overlooked the GPL alternative in some of the gnuefi/* headers,
and some of them seem to be another BSD-style license, which does not
quite match anything that SPDX knows. So a better version is:

     GNU_EFI_LICENSE         := custom AND (custom OR GPL-2.0-or-later)
     GNU_EFI_LICENSE_FILES   := \
       file://README.efilib;startline=19;md5=b1b8d397eda0e4b82e34c7b58610dfcb
       file://gnuefi/reloc_x86_64.c;startline=2;endline=35;md5=8f99c3f647f56ad3fb9519d6026af2e2
       file://gnuefi/crt0-efi-mips64el.S;startline=4;endline=17;md5=3dee88fd23d0b0c91b6850ec6ffc9c02

> I don't really know what custom would for mean a user since I can't see
> it being used in any package? Is gnu-efi the only package being slightly
> imprecise with its license declaration?
> Also, why would you want to be that literal?

Yes, sorry… the documentation is missing here because the patch for that
is still stuck in discussion [0]. But we agreed on the part of using
"custom" for anything that was reviewed (even superficially), but does
not match a known SPDX identifier, and "unknown" for any package that
still needs a license review. See the patch for more info… :)

[0]: https://lore.ptxdist.org/ptxdist/20210608103639.24336-1-rhi@pengutronix.de/

> It's very clear to me that the intention of author and the code is to be
> BSD (and whatever still is left as GPL-2.0+).
> 
> Also, IANAL. :)

SPDX has a set of rules [1] how to match license texts to SPDX
identifiers. which were made up to prevent any ambiguities and
possibilities for debate that will inevitably happen when someone has to
decide whether two license texts are equivalent. In that way, license
matching is reproducable and it can easily be decided by a regex whether
two texts are equivalent. And the actual wording in README.efilib is
substantially different from SPDX's version of any of the BSD variants
that we cannot classify it as such without opening up a debate about
semantics. So in that case, it's better to err on the safe side and
classify it as "unknown", so the person who needs to do a license
compliance review knows that this needs to be investigated more
accurately.

[1]: https://spdx.dev/license-list/matching-guidelines/

 - Roland

> >> +
> >> +# ----------------------------------------------------------------------------
> >> +# Compile
> >> +# ----------------------------------------------------------------------------               
> >> +
> >> +ifdef PTXCONF_ARCH_X86 
> >> +GNU_EFI_ARCH = ia32
> >> +ifdef PTXCONF_ARCH_X86_64
> >> +GNU_EFI_ARCH = x86_64
> >> +endif
> >> +endif
> >> +ifdef PTXCONF_ARCH_ARM
> >> +GNU_EFI_ARCH = arm
> >> +endif
> >> +ifdef PTXCONF_ARCH_ARM64
> >> +GNU_EFI_ARCH = aarch64
> >> +endif
> >> +
> >> +GNU_EFI_CONF_TOOL	:= NO
> >> +GNU_EFI_MAKE_ENV	:= \
> >> +	ARCH=$(GNU_EFI_ARCH) \
> >> +	CROSS_COMPILE=$(COMPILER_PREFIX) \
> >> +	PREFIX=/usr \
> >> +	LIBDIR=/usr/$(CROSS_LIB_DIR)
> >> +
> >> +GNU_EFI_INSTALL_OPT := \
> >> +	INSTALLROOT=$(GNU_EFI_PKGDIR) \
> >> +	PREFIX=/usr \
> >> +	LIBDIR=/usr/$(CROSS_LIB_DIR) \
> >> +	install
> >> +
> >> +# ----------------------------------------------------------------------------
> >> +# Target-Install
> >> +# ----------------------------------------------------------------------------
> >> +
> >> +$(STATEDIR)/gnu-efi.targetinstall:
> >> +	@$(call targetinfo)
> >> +	@$(call install_init, gnu-efi)
> >> +	@$(call install_fixup, gnu-efi,PRIORITY,optional)
> >> +	@$(call install_fixup, gnu-efi,SECTION,base)
> >> +	@$(call install_fixup, gnu-efi,AUTHOR,"Christian Melki <christian.melki@t2data.com>")
> >> +	@$(call install_fixup, gnu-efi,DESCRIPTION,missing)
> >> +	@$(call install_finish, gnu-efi)
> >> +	@$(call touch)
> >> +
> >> +# vim: syntax=make
> >> -- 
> >> 2.32.0
> >>
> >>
> >> _______________________________________________
> >> ptxdist mailing list
> >> ptxdist@pengutronix.de
> >> To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de
> >>
> > 
> 
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de
> To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

-- 
Roland Hieber, Pengutronix e.K.          | r.hieber@pengutronix.de     |
Steuerwalder Str. 21                     | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686         | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-07-20 14:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-16 13:41 [ptxdist] [PATCH 1/6] rules/host-gnu-efi: Add new package Christian Melki
2021-07-16 13:41 ` [ptxdist] [PATCH 2/6] rules/gnu-efi: " Christian Melki
2021-07-19  9:09   ` Roland Hieber
2021-07-19  9:11     ` Roland Hieber
2021-07-20 13:08     ` Christian Melki
2021-07-20 14:22       ` Roland Hieber
2021-07-16 13:41 ` [ptxdist] [PATCH 3/6] rules/host-efitools: " Christian Melki
2021-07-16 13:41 ` [ptxdist] [PATCH 4/6] rules/efitools: " Christian Melki
2021-07-16 13:41 ` [ptxdist] [PATCH 5/6] rules/host-sbsigntools: " Christian Melki
2021-07-16 13:41 ` [ptxdist] [PATCH 6/6] rules/sbsigntools: " Christian Melki

mailarchive of the ptxdist mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://lore.ptxdist.org/ptxdist/0 ptxdist/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ptxdist ptxdist/ https://lore.ptxdist.org/ptxdist \
		ptxdist@pengutronix.de
	public-inbox-index ptxdist

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git