From 42ec27489135f5c2dbe708dacb5dadb0f5d9df5b Mon Sep 17 00:00:00 2001 From: Chen Qi Date: Tue, 26 Feb 2019 14:38:58 +0800 Subject: systemd-boot: upgrade to 241 The following two patches are added because I cannot figure out how to pass parameter to efi-cc if it's changed to be an array value. systemd/0001-Revert-meson-print-EFI-CC-configuration-nicely.patch systemd/0001-Revert-meson-use-an-array-option-for-efi-cc.patch Signed-off-by: Chen Qi Signed-off-by: Richard Purdie --- meta/recipes-core/systemd/systemd-boot_239.bb | 70 -------------------- meta/recipes-core/systemd/systemd-boot_241.bb | 71 ++++++++++++++++++++ ...t-meson-print-EFI-CC-configuration-nicely.patch | 33 ++++++++++ ...vert-meson-use-an-array-option-for-efi-cc.patch | 77 ++++++++++++++++++++++ 4 files changed, 181 insertions(+), 70 deletions(-) delete mode 100644 meta/recipes-core/systemd/systemd-boot_239.bb create mode 100644 meta/recipes-core/systemd/systemd-boot_241.bb create mode 100644 meta/recipes-core/systemd/systemd/0001-Revert-meson-print-EFI-CC-configuration-nicely.patch create mode 100644 meta/recipes-core/systemd/systemd/0001-Revert-meson-use-an-array-option-for-efi-cc.patch (limited to 'meta/recipes-core/systemd') diff --git a/meta/recipes-core/systemd/systemd-boot_239.bb b/meta/recipes-core/systemd/systemd-boot_239.bb deleted file mode 100644 index 2450d52cb9..0000000000 --- a/meta/recipes-core/systemd/systemd-boot_239.bb +++ /dev/null @@ -1,70 +0,0 @@ -require systemd.inc -FILESEXTRAPATHS =. "${FILE_DIRNAME}/systemd:" - -DEPENDS = "intltool-native libcap util-linux gnu-efi gperf-native" - -SRC_URI += "file://0002-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch \ - file://0006-remove-nobody-user-group-checking.patch \ - file://0001-Fix-to-run-efi_cc-and-efi_ld-correctly-when-cross-co.patch \ - file://0001-meson-rename-Ddebug-to-Ddebug-extra.patch \ - " - -inherit meson pkgconfig gettext -inherit deploy - -EFI_CC ?= "${CC}" -EXTRA_OEMESON += "-Defi=true \ - -Dgnu-efi=true \ - -Defi-includedir=${STAGING_INCDIR}/efi \ - -Defi-ldsdir=${STAGING_LIBDIR} \ - -Defi-libdir=${STAGING_LIBDIR} \ - -Dman=false \ - -Defi-cc='${EFI_CC}' \ - -Defi-ld='${LD}' \ - " - -# install to the image as boot*.efi if its the EFI_PROVIDER, -# otherwise install as the full name. -# This allows multiple bootloaders to coexist in a single image. -python __anonymous () { - import re - target = d.getVar('TARGET_ARCH') - prefix = "" if d.getVar('EFI_PROVIDER') == "systemd-boot" else "systemd-" - if target == "x86_64": - systemdimage = prefix + "bootx64.efi" - else: - systemdimage = prefix + "bootia32.efi" - d.setVar("SYSTEMD_BOOT_IMAGE", systemdimage) - prefix = "systemd-" if prefix == "" else "" - d.setVar("SYSTEMD_BOOT_IMAGE_PREFIX", prefix) -} - -FILES_${PN} = "/boot/EFI/BOOT/${SYSTEMD_BOOT_IMAGE}" - -RDEPENDS_${PN} += "virtual/systemd-bootconf" - -# Imported from the old gummiboot recipe -TUNE_CCARGS_remove = "-mfpmath=sse" -COMPATIBLE_HOST = "(x86_64.*|i.86.*)-linux" -COMPATIBLE_HOST_x86-x32 = "null" - -do_compile() { - SYSTEMD_BOOT_EFI_ARCH="ia32" - if [ "${TARGET_ARCH}" = "x86_64" ]; then - SYSTEMD_BOOT_EFI_ARCH="x64" - fi - - ninja src/boot/efi/${SYSTEMD_BOOT_IMAGE_PREFIX}${SYSTEMD_BOOT_IMAGE} -} - -do_install() { - install -d ${D}/boot - install -d ${D}/boot/EFI - install -d ${D}/boot/EFI/BOOT - install ${B}/src/boot/efi/systemd-boot*.efi ${D}/boot/EFI/BOOT/${SYSTEMD_BOOT_IMAGE} -} - -do_deploy () { - install ${B}/src/boot/efi/systemd-boot*.efi ${DEPLOYDIR} -} -addtask deploy before do_build after do_compile diff --git a/meta/recipes-core/systemd/systemd-boot_241.bb b/meta/recipes-core/systemd/systemd-boot_241.bb new file mode 100644 index 0000000000..56e68a3d49 --- /dev/null +++ b/meta/recipes-core/systemd/systemd-boot_241.bb @@ -0,0 +1,71 @@ +require systemd.inc +FILESEXTRAPATHS =. "${FILE_DIRNAME}/systemd:" + +DEPENDS = "intltool-native libcap util-linux gnu-efi gperf-native" + +# NOTE: These three patches are in theory not needed, but we haven't +# figured out how to correctly pass efi-cc parameter if it's an array. +SRC_URI += "file://0001-Revert-meson-use-an-array-option-for-efi-cc.patch \ + file://0001-Revert-meson-print-EFI-CC-configuration-nicely.patch \ + file://0001-Fix-to-run-efi_cc-and-efi_ld-correctly-when-cross-co.patch \ + " + +inherit meson pkgconfig gettext +inherit deploy + +EFI_CC ?= "${CC}" +EXTRA_OEMESON += "-Defi=true \ + -Dgnu-efi=true \ + -Defi-includedir=${STAGING_INCDIR}/efi \ + -Defi-ldsdir=${STAGING_LIBDIR} \ + -Defi-libdir=${STAGING_LIBDIR} \ + -Dman=false \ + -Defi-cc='${EFI_CC}' \ + -Defi-ld='${LD}' \ + " + +# install to the image as boot*.efi if its the EFI_PROVIDER, +# otherwise install as the full name. +# This allows multiple bootloaders to coexist in a single image. +python __anonymous () { + import re + target = d.getVar('TARGET_ARCH') + prefix = "" if d.getVar('EFI_PROVIDER') == "systemd-boot" else "systemd-" + if target == "x86_64": + systemdimage = prefix + "bootx64.efi" + else: + systemdimage = prefix + "bootia32.efi" + d.setVar("SYSTEMD_BOOT_IMAGE", systemdimage) + prefix = "systemd-" if prefix == "" else "" + d.setVar("SYSTEMD_BOOT_IMAGE_PREFIX", prefix) +} + +FILES_${PN} = "/boot/EFI/BOOT/${SYSTEMD_BOOT_IMAGE}" + +RDEPENDS_${PN} += "virtual/systemd-bootconf" + +# Imported from the old gummiboot recipe +TUNE_CCARGS_remove = "-mfpmath=sse" +COMPATIBLE_HOST = "(x86_64.*|i.86.*)-linux" +COMPATIBLE_HOST_x86-x32 = "null" + +do_compile() { + SYSTEMD_BOOT_EFI_ARCH="ia32" + if [ "${TARGET_ARCH}" = "x86_64" ]; then + SYSTEMD_BOOT_EFI_ARCH="x64" + fi + + ninja src/boot/efi/${SYSTEMD_BOOT_IMAGE_PREFIX}${SYSTEMD_BOOT_IMAGE} +} + +do_install() { + install -d ${D}/boot + install -d ${D}/boot/EFI + install -d ${D}/boot/EFI/BOOT + install ${B}/src/boot/efi/systemd-boot*.efi ${D}/boot/EFI/BOOT/${SYSTEMD_BOOT_IMAGE} +} + +do_deploy () { + install ${B}/src/boot/efi/systemd-boot*.efi ${DEPLOYDIR} +} +addtask deploy before do_build after do_compile diff --git a/meta/recipes-core/systemd/systemd/0001-Revert-meson-print-EFI-CC-configuration-nicely.patch b/meta/recipes-core/systemd/systemd/0001-Revert-meson-print-EFI-CC-configuration-nicely.patch new file mode 100644 index 0000000000..ed14e25bce --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0001-Revert-meson-print-EFI-CC-configuration-nicely.patch @@ -0,0 +1,33 @@ +From 0bf530aac152630500939db31f98d933158fdabd Mon Sep 17 00:00:00 2001 +From: Chen Qi +Date: Tue, 26 Feb 2019 14:27:49 +0800 +Subject: [PATCH] Revert "meson: print EFI CC configuration nicely" + +This reverts commit c512dfb9ac948ddb1ced0dab07b9dac88b198293. + +This patch is here because we haven't figured out how to pass +parameter to efi-cc if it's an array in systemd-boot recipe. + +Upstream-Status: Inappropriate [OE specific] + +Signed-off-by: Chen Qi +--- + meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/meson.build b/meson.build +index 70fb218..30df834 100644 +--- a/meson.build ++++ b/meson.build +@@ -3138,7 +3138,7 @@ if conf.get('ENABLE_EFI') == 1 + if have_gnu_efi + status += [ + 'EFI machine type: @0@'.format(EFI_MACHINE_TYPE_NAME), +- 'EFI CC @0@'.format(' '.join(efi_cc)), ++ 'EFI CC @0@'.format(efi_cc), + 'EFI lib directory: @0@'.format(efi_libdir), + 'EFI lds directory: @0@'.format(efi_ldsdir), + 'EFI include directory: @0@'.format(efi_incdir)] +-- +2.7.4 + diff --git a/meta/recipes-core/systemd/systemd/0001-Revert-meson-use-an-array-option-for-efi-cc.patch b/meta/recipes-core/systemd/systemd/0001-Revert-meson-use-an-array-option-for-efi-cc.patch new file mode 100644 index 0000000000..0d2ebf62bd --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0001-Revert-meson-use-an-array-option-for-efi-cc.patch @@ -0,0 +1,77 @@ +From 0030dcbac1a9177ef7a28af209ac67149b899f5f Mon Sep 17 00:00:00 2001 +From: Chen Qi +Date: Tue, 26 Feb 2019 14:17:25 +0800 +Subject: [PATCH] Revert "meson: use an array option for efi-cc" + +This reverts commit 595343fb4c99c2679d347ef7c19debfbfed6342e. + +This patch is here because we haven't figured out how to pass +parameter to efi-cc if it's an array in systemd-boot recipe. + +Upstream-Status: Inappropriate [OE specific] + +Signed-off-by: Chen Qi +--- + meson_options.txt | 2 +- + src/boot/efi/meson.build | 11 ++++++----- + 2 files changed, 7 insertions(+), 6 deletions(-) + +diff --git a/meson_options.txt b/meson_options.txt +index 044bb79..3d28bfd 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -292,7 +292,7 @@ option('dbus', type : 'combo', choices : ['auto', 'true', 'false'], + + option('gnu-efi', type : 'combo', choices : ['auto', 'true', 'false'], + description : 'gnu-efi support for sd-boot') +-option('efi-cc', type : 'array', ++option('efi-cc', type : 'string', + description : 'the compiler to use for EFI modules') + option('efi-ld', type : 'string', + description : 'the linker to use for EFI modules') +diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build +index 2140151..d8db3a1 100644 +--- a/src/boot/efi/meson.build ++++ b/src/boot/efi/meson.build +@@ -34,8 +34,8 @@ stub_sources = ''' + + if conf.get('ENABLE_EFI') == 1 and get_option('gnu-efi') != 'false' + efi_cc = get_option('efi-cc') +- if efi_cc.length() == 0 +- efi_cc = cc.cmd_array() ++ if efi_cc == '' ++ efi_cc = ' '.join(cc.cmd_array()) + endif + efi_ld = get_option('efi-ld') + if efi_ld == '' +@@ -57,7 +57,8 @@ if conf.get('ENABLE_EFI') == 1 and get_option('gnu-efi') != 'false' + + efi_libdir = get_option('efi-libdir') + if efi_libdir == '' +- ret = run_command(efi_cc + ['-print-multi-os-directory']) ++ cmd = 'cd /usr/lib/$(@0@ -print-multi-os-directory) && pwd'.format(efi_cc) ++ ret = run_command('sh', '-c', cmd) + if ret.returncode() == 0 + path = join_paths('/usr/lib', ret.stdout().strip()) + ret = run_command('realpath', '-e', path) +@@ -152,7 +153,7 @@ if have_gnu_efi + o_file = custom_target(file + '.o', + input : file, + output : file + '.o', +- command : efi_cc + ['-c', '@INPUT@', '-o', '@OUTPUT@'] ++ command : [efi_cc, '-c', '@INPUT@', '-o', '@OUTPUT@'] + + compile_args, + depend_files : efi_headers) + if (common_sources + systemd_boot_sources).contains(file) +@@ -163,7 +164,7 @@ if have_gnu_efi + endif + endforeach + +- libgcc_file_name = run_command(efi_cc + ['-print-libgcc-file-name']).stdout().strip() ++ libgcc_file_name = run_command(efi_cc, '-print-libgcc-file-name').stdout().strip() + systemd_boot_efi_name = 'systemd-boot@0@.efi'.format(EFI_MACHINE_TYPE_NAME) + stub_efi_name = 'linux@0@.efi.stub'.format(EFI_MACHINE_TYPE_NAME) + no_undefined_symbols = find_program('no-undefined-symbols.sh') +-- +2.7.4 + -- cgit 1.2.3-korg