* [PATCH] fwupd-efi: add new recipe
@ 2021-11-05 14:33 Ross Burton
2021-11-07 7:26 ` [oe] " Khem Raj
0 siblings, 1 reply; 3+ messages in thread
From: Ross Burton @ 2021-11-05 14:33 UTC (permalink / raw)
To: openembedded-devel
This is the EFI executable that is used by fwupd when building EFI
capsules.
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
meta-oe/recipes-bsp/fwupd/fwupd-efi/cc.patch | 53 ++++++++++++++++++++
meta-oe/recipes-bsp/fwupd/fwupd-efi_1.1.bb | 31 ++++++++++++
2 files changed, 84 insertions(+)
create mode 100644 meta-oe/recipes-bsp/fwupd/fwupd-efi/cc.patch
create mode 100644 meta-oe/recipes-bsp/fwupd/fwupd-efi_1.1.bb
diff --git a/meta-oe/recipes-bsp/fwupd/fwupd-efi/cc.patch b/meta-oe/recipes-bsp/fwupd/fwupd-efi/cc.patch
new file mode 100644
index 0000000000..ac345f2752
--- /dev/null
+++ b/meta-oe/recipes-bsp/fwupd/fwupd-efi/cc.patch
@@ -0,0 +1,53 @@
+Change the efi-cc argument to take an array, so that we can pass compiler flags
+such as --sysroot.
+
+In the long term changing the fwupd-efi build to use the standard Meson
+CC/LD/etc would be the preferred fix.
+
+Upstream-Status: Inappropriate [better fix in progress]
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+
+diff --git a/efi/generate_sbat.py b/efi/generate_sbat.py
+index e42b365..4831a48 100755
+--- a/efi/generate_sbat.py
++++ b/efi/generate_sbat.py
+@@ -7,6 +7,7 @@
+ #
+ # pylint: disable=missing-docstring, invalid-name
+
++import shlex
+ import subprocess
+ import sys
+ import argparse
+@@ -19,7 +20,7 @@ def _generate_sbat(args):
+ FWUPD_URL = "https://github.com/fwupd/fwupd"
+
+ subprocess.run(
+- [args.cc, "-x", "c", "-c", "-o", args.outfile, "/dev/null"], check=True
++ shlex.split(args.cc) + ["-x", "c", "-c", "-o", args.outfile, "/dev/null"], check=True
+ )
+
+ # not specified
+diff --git a/efi/meson.build b/efi/meson.build
+index 68ea4aa..dcf0d43 100644
+--- a/efi/meson.build
++++ b/efi/meson.build
+@@ -184,7 +184,7 @@ o_file5 = custom_target('fwup-sbat.o',
+ command : [
+ join_paths(meson.current_source_dir(), 'generate_sbat.py'),
+ '@OUTPUT@',
+- '--cc', efi_cc,
++ '--cc', ' '.join(efi_cc),
+ '--objcopy', efi_objcopy,
+ '--project-name', meson.project_name(),
+ '--project-version', meson.project_version(),
+diff --git a/meson_options.txt b/meson_options.txt
+index d869cd2..17ef7fb 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -1,4 +1,4 @@
+-option('efi-cc', type : 'string', value : 'gcc', description : 'the compiler to use for EFI modules')
++option('efi-cc', type : 'array', value : ['gcc'], description : 'the compiler to use for EFI modules')
+ option('efi-ld', type : 'string', value : 'ld', description : 'the linker to use for EFI modules')
+ option('efi-objcopy', type : 'string', value : 'objcopy', description : 'the objcopy utility to use for EFI modules')
+ option('efi-libdir', type : 'string', description : 'path to the EFI lib directory')
diff --git a/meta-oe/recipes-bsp/fwupd/fwupd-efi_1.1.bb b/meta-oe/recipes-bsp/fwupd/fwupd-efi_1.1.bb
new file mode 100644
index 0000000000..f3c4a7a3b7
--- /dev/null
+++ b/meta-oe/recipes-bsp/fwupd/fwupd-efi_1.1.bb
@@ -0,0 +1,31 @@
+SUMMARY = "EFI executable for fwupd"
+LICENSE = "LGPL-2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
+
+SRC_URI = "git://github.com/fwupd/fwupd-efi;protocol=https;branch=main \
+ file://cc.patch"
+SRCREV = "fee1b8f6473cb403b8ae7a56961ba0557e3f3efa"
+S = "${WORKDIR}/git"
+
+DEPENDS = "gnu-efi"
+
+COMPATIBLE_HOST = "(x86_64.*|i.86.*|aarch64.*|arm.*)-linux"
+
+inherit meson
+
+# These should be configured as needed
+SBAT_DISTRO_ID ?= "${DISTRO}"
+SBAT_DISTRO_SUMMARY ?= "${DISTRO_NAME}"
+SBAT_DISTRO_URL ?= ""
+
+EXTRA_OEMESON += "-Defi-cc="${@meson_array('CC', d)}" \
+ -Defi-ld='${HOST_PREFIX}ld' \
+ -Defi-objcopy='${OBJCOPY}' \
+ -Defi-includedir=${STAGING_INCDIR}/efi \
+ -Defi-libdir=${STAGING_LIBDIR} \
+ -Defi_sbat_distro_id='${SBAT_DISTRO_ID}' \
+ -Defi_sbat_distro_summary='${SBAT_DISTRO_SUMMARY}' \
+ -Defi_sbat_distro_url='${SBAT_DISTRO_URL}' \
+ -Defi_sbat_distro_pkgname='${PN}' \
+ -Defi_sbat_distro_version='${PV}'\
+ "
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [oe] [PATCH] fwupd-efi: add new recipe
2021-11-05 14:33 [PATCH] fwupd-efi: add new recipe Ross Burton
@ 2021-11-07 7:26 ` Khem Raj
0 siblings, 0 replies; 3+ messages in thread
From: Khem Raj @ 2021-11-07 7:26 UTC (permalink / raw)
To: Ross Burton; +Cc: openembeded-devel
it fails with clang/x86 see
https://errors.yoctoproject.org/Errors/Details/616512/
On Fri, Nov 5, 2021 at 7:33 AM Ross Burton <ross@burtonini.com> wrote:
>
> This is the EFI executable that is used by fwupd when building EFI
> capsules.
>
> Signed-off-by: Ross Burton <ross.burton@arm.com>
> ---
> meta-oe/recipes-bsp/fwupd/fwupd-efi/cc.patch | 53 ++++++++++++++++++++
> meta-oe/recipes-bsp/fwupd/fwupd-efi_1.1.bb | 31 ++++++++++++
> 2 files changed, 84 insertions(+)
> create mode 100644 meta-oe/recipes-bsp/fwupd/fwupd-efi/cc.patch
> create mode 100644 meta-oe/recipes-bsp/fwupd/fwupd-efi_1.1.bb
>
> diff --git a/meta-oe/recipes-bsp/fwupd/fwupd-efi/cc.patch b/meta-oe/recipes-bsp/fwupd/fwupd-efi/cc.patch
> new file mode 100644
> index 0000000000..ac345f2752
> --- /dev/null
> +++ b/meta-oe/recipes-bsp/fwupd/fwupd-efi/cc.patch
> @@ -0,0 +1,53 @@
> +Change the efi-cc argument to take an array, so that we can pass compiler flags
> +such as --sysroot.
> +
> +In the long term changing the fwupd-efi build to use the standard Meson
> +CC/LD/etc would be the preferred fix.
> +
> +Upstream-Status: Inappropriate [better fix in progress]
> +Signed-off-by: Ross Burton <ross.burton@arm.com>
> +
> +diff --git a/efi/generate_sbat.py b/efi/generate_sbat.py
> +index e42b365..4831a48 100755
> +--- a/efi/generate_sbat.py
> ++++ b/efi/generate_sbat.py
> +@@ -7,6 +7,7 @@
> + #
> + # pylint: disable=missing-docstring, invalid-name
> +
> ++import shlex
> + import subprocess
> + import sys
> + import argparse
> +@@ -19,7 +20,7 @@ def _generate_sbat(args):
> + FWUPD_URL = "https://github.com/fwupd/fwupd"
> +
> + subprocess.run(
> +- [args.cc, "-x", "c", "-c", "-o", args.outfile, "/dev/null"], check=True
> ++ shlex.split(args.cc) + ["-x", "c", "-c", "-o", args.outfile, "/dev/null"], check=True
> + )
> +
> + # not specified
> +diff --git a/efi/meson.build b/efi/meson.build
> +index 68ea4aa..dcf0d43 100644
> +--- a/efi/meson.build
> ++++ b/efi/meson.build
> +@@ -184,7 +184,7 @@ o_file5 = custom_target('fwup-sbat.o',
> + command : [
> + join_paths(meson.current_source_dir(), 'generate_sbat.py'),
> + '@OUTPUT@',
> +- '--cc', efi_cc,
> ++ '--cc', ' '.join(efi_cc),
> + '--objcopy', efi_objcopy,
> + '--project-name', meson.project_name(),
> + '--project-version', meson.project_version(),
> +diff --git a/meson_options.txt b/meson_options.txt
> +index d869cd2..17ef7fb 100644
> +--- a/meson_options.txt
> ++++ b/meson_options.txt
> +@@ -1,4 +1,4 @@
> +-option('efi-cc', type : 'string', value : 'gcc', description : 'the compiler to use for EFI modules')
> ++option('efi-cc', type : 'array', value : ['gcc'], description : 'the compiler to use for EFI modules')
> + option('efi-ld', type : 'string', value : 'ld', description : 'the linker to use for EFI modules')
> + option('efi-objcopy', type : 'string', value : 'objcopy', description : 'the objcopy utility to use for EFI modules')
> + option('efi-libdir', type : 'string', description : 'path to the EFI lib directory')
> diff --git a/meta-oe/recipes-bsp/fwupd/fwupd-efi_1.1.bb b/meta-oe/recipes-bsp/fwupd/fwupd-efi_1.1.bb
> new file mode 100644
> index 0000000000..f3c4a7a3b7
> --- /dev/null
> +++ b/meta-oe/recipes-bsp/fwupd/fwupd-efi_1.1.bb
> @@ -0,0 +1,31 @@
> +SUMMARY = "EFI executable for fwupd"
> +LICENSE = "LGPL-2.1+"
> +LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
> +
> +SRC_URI = "git://github.com/fwupd/fwupd-efi;protocol=https;branch=main \
> + file://cc.patch"
> +SRCREV = "fee1b8f6473cb403b8ae7a56961ba0557e3f3efa"
> +S = "${WORKDIR}/git"
> +
> +DEPENDS = "gnu-efi"
> +
> +COMPATIBLE_HOST = "(x86_64.*|i.86.*|aarch64.*|arm.*)-linux"
> +
> +inherit meson
> +
> +# These should be configured as needed
> +SBAT_DISTRO_ID ?= "${DISTRO}"
> +SBAT_DISTRO_SUMMARY ?= "${DISTRO_NAME}"
> +SBAT_DISTRO_URL ?= ""
> +
> +EXTRA_OEMESON += "-Defi-cc="${@meson_array('CC', d)}" \
> + -Defi-ld='${HOST_PREFIX}ld' \
> + -Defi-objcopy='${OBJCOPY}' \
> + -Defi-includedir=${STAGING_INCDIR}/efi \
> + -Defi-libdir=${STAGING_LIBDIR} \
> + -Defi_sbat_distro_id='${SBAT_DISTRO_ID}' \
> + -Defi_sbat_distro_summary='${SBAT_DISTRO_SUMMARY}' \
> + -Defi_sbat_distro_url='${SBAT_DISTRO_URL}' \
> + -Defi_sbat_distro_pkgname='${PN}' \
> + -Defi_sbat_distro_version='${PV}'\
> + "
> --
> 2.25.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#93844): https://lists.openembedded.org/g/openembedded-devel/message/93844
> Mute This Topic: https://lists.openembedded.org/mt/86841724/1997914
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] fwupd-efi: add new recipe
@ 2021-11-08 10:50 Ross Burton
0 siblings, 0 replies; 3+ messages in thread
From: Ross Burton @ 2021-11-08 10:50 UTC (permalink / raw)
To: openembedded-devel
This is the EFI executable that is used by fwupd when building EFI
capsules.
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
meta-oe/recipes-bsp/fwupd/fwupd-efi/cc.patch | 53 ++++++++++++++++++++
meta-oe/recipes-bsp/fwupd/fwupd-efi_1.1.bb | 34 +++++++++++++
2 files changed, 87 insertions(+)
create mode 100644 meta-oe/recipes-bsp/fwupd/fwupd-efi/cc.patch
create mode 100644 meta-oe/recipes-bsp/fwupd/fwupd-efi_1.1.bb
diff --git a/meta-oe/recipes-bsp/fwupd/fwupd-efi/cc.patch b/meta-oe/recipes-bsp/fwupd/fwupd-efi/cc.patch
new file mode 100644
index 0000000000..ac345f2752
--- /dev/null
+++ b/meta-oe/recipes-bsp/fwupd/fwupd-efi/cc.patch
@@ -0,0 +1,53 @@
+Change the efi-cc argument to take an array, so that we can pass compiler flags
+such as --sysroot.
+
+In the long term changing the fwupd-efi build to use the standard Meson
+CC/LD/etc would be the preferred fix.
+
+Upstream-Status: Inappropriate [better fix in progress]
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+
+diff --git a/efi/generate_sbat.py b/efi/generate_sbat.py
+index e42b365..4831a48 100755
+--- a/efi/generate_sbat.py
++++ b/efi/generate_sbat.py
+@@ -7,6 +7,7 @@
+ #
+ # pylint: disable=missing-docstring, invalid-name
+
++import shlex
+ import subprocess
+ import sys
+ import argparse
+@@ -19,7 +20,7 @@ def _generate_sbat(args):
+ FWUPD_URL = "https://github.com/fwupd/fwupd"
+
+ subprocess.run(
+- [args.cc, "-x", "c", "-c", "-o", args.outfile, "/dev/null"], check=True
++ shlex.split(args.cc) + ["-x", "c", "-c", "-o", args.outfile, "/dev/null"], check=True
+ )
+
+ # not specified
+diff --git a/efi/meson.build b/efi/meson.build
+index 68ea4aa..dcf0d43 100644
+--- a/efi/meson.build
++++ b/efi/meson.build
+@@ -184,7 +184,7 @@ o_file5 = custom_target('fwup-sbat.o',
+ command : [
+ join_paths(meson.current_source_dir(), 'generate_sbat.py'),
+ '@OUTPUT@',
+- '--cc', efi_cc,
++ '--cc', ' '.join(efi_cc),
+ '--objcopy', efi_objcopy,
+ '--project-name', meson.project_name(),
+ '--project-version', meson.project_version(),
+diff --git a/meson_options.txt b/meson_options.txt
+index d869cd2..17ef7fb 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -1,4 +1,4 @@
+-option('efi-cc', type : 'string', value : 'gcc', description : 'the compiler to use for EFI modules')
++option('efi-cc', type : 'array', value : ['gcc'], description : 'the compiler to use for EFI modules')
+ option('efi-ld', type : 'string', value : 'ld', description : 'the linker to use for EFI modules')
+ option('efi-objcopy', type : 'string', value : 'objcopy', description : 'the objcopy utility to use for EFI modules')
+ option('efi-libdir', type : 'string', description : 'path to the EFI lib directory')
diff --git a/meta-oe/recipes-bsp/fwupd/fwupd-efi_1.1.bb b/meta-oe/recipes-bsp/fwupd/fwupd-efi_1.1.bb
new file mode 100644
index 0000000000..2165b42293
--- /dev/null
+++ b/meta-oe/recipes-bsp/fwupd/fwupd-efi_1.1.bb
@@ -0,0 +1,34 @@
+SUMMARY = "EFI executable for fwupd"
+LICENSE = "LGPL-2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
+
+SRC_URI = "git://github.com/fwupd/fwupd-efi;protocol=https;branch=main \
+ file://cc.patch"
+SRCREV = "fee1b8f6473cb403b8ae7a56961ba0557e3f3efa"
+S = "${WORKDIR}/git"
+
+DEPENDS = "gnu-efi"
+
+COMPATIBLE_HOST = "(x86_64.*|i.86.*|aarch64.*|arm.*)-linux"
+
+inherit meson
+
+# These should be configured as needed
+SBAT_DISTRO_ID ?= "${DISTRO}"
+SBAT_DISTRO_SUMMARY ?= "${DISTRO_NAME}"
+SBAT_DISTRO_URL ?= ""
+
+EXTRA_OEMESON += "-Defi-cc="${@meson_array('CC', d)}" \
+ -Defi-ld='${HOST_PREFIX}ld' \
+ -Defi-objcopy='${OBJCOPY}' \
+ -Defi-includedir=${STAGING_INCDIR}/efi \
+ -Defi-libdir=${STAGING_LIBDIR} \
+ -Defi_sbat_distro_id='${SBAT_DISTRO_ID}' \
+ -Defi_sbat_distro_summary='${SBAT_DISTRO_SUMMARY}' \
+ -Defi_sbat_distro_url='${SBAT_DISTRO_URL}' \
+ -Defi_sbat_distro_pkgname='${PN}' \
+ -Defi_sbat_distro_version='${PV}'\
+ "
+
+# The compile assumes GCC at present
+TOOLCHAIN = "gcc"
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-11-08 10:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-05 14:33 [PATCH] fwupd-efi: add new recipe Ross Burton
2021-11-07 7:26 ` [oe] " Khem Raj
2021-11-08 10:50 Ross Burton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.