<div dir="ltr">Can you rebase this to master as there&#39;s been changes to booting made.<div><br></div><div>Ross</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 5 March 2018 at 02:02, Chen Qi <span dir="ltr">&lt;<a href="mailto:Qi.Chen@windriver.com" target="_blank">Qi.Chen@windriver.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Upgrade systemd-boot to 237.<br>
<br>
As systemd has dropped autotools support, fix configure and compile<br>
failures related to meson.<br>
<br>
Signed-off-by: Chen Qi &lt;<a href="mailto:Qi.Chen@windriver.com">Qi.Chen@windriver.com</a>&gt;<br>
---<br>
 .../{<a href="http://systemd-boot_234.bb" rel="noreferrer" target="_blank">systemd-boot_234.bb</a> =&gt; <a href="http://systemd-boot_237.bb" rel="noreferrer" target="_blank">systemd-boot_237.bb</a>}   | 32 ++++++-----<br>
 ...01-Also-check-i386-i586-<wbr>and-i686-for-ia32.patch | 28 ++++++++++<br>
 ...efi_cc-and-efi_ld-<wbr>correctly-when-cross-co.patch | 62 ++++++++++++++++++++++<br>
 3 files changed, 109 insertions(+), 13 deletions(-)<br>
 rename meta/recipes-core/systemd/{<a href="http://systemd-boot_234.bb" rel="noreferrer" target="_blank">sys<wbr>temd-boot_234.bb</a> =&gt; <a href="http://systemd-boot_237.bb" rel="noreferrer" target="_blank">systemd-boot_237.bb</a>} (41%)<br>
 create mode 100644 meta/recipes-core/systemd/<wbr>systemd/0001-Also-check-i386-<wbr>i586-and-i686-for-ia32.patch<br>
 create mode 100644 meta/recipes-core/systemd/<wbr>systemd/0001-Fix-to-run-efi_<wbr>cc-and-efi_ld-correctly-when-<wbr>cross-co.patch<br>
<br>
diff --git a/meta/recipes-core/systemd/<a href="http://systemd-boot_234.bb" rel="noreferrer" target="_blank">sy<wbr>stemd-boot_234.bb</a> b/meta/recipes-core/systemd/<a href="http://systemd-boot_237.bb" rel="noreferrer" target="_blank">sy<wbr>stemd-boot_237.bb</a><br>
similarity index 41%<br>
rename from meta/recipes-core/systemd/<a href="http://systemd-boot_234.bb" rel="noreferrer" target="_blank">syst<wbr>emd-boot_234.bb</a><br>
rename to meta/recipes-core/systemd/<a href="http://systemd-boot_237.bb" rel="noreferrer" target="_blank">syst<wbr>emd-boot_237.bb</a><br>
index 88a14ac..ec87cbf 100644<br>
--- a/meta/recipes-core/systemd/<a href="http://systemd-boot_234.bb" rel="noreferrer" target="_blank">sy<wbr>stemd-boot_234.bb</a><br>
+++ b/meta/recipes-core/systemd/<a href="http://systemd-boot_237.bb" rel="noreferrer" target="_blank">sy<wbr>stemd-boot_237.bb</a><br>
@@ -3,20 +3,27 @@ FILESEXTRAPATHS =. &quot;${FILE_DIRNAME}/systemd:&quot;<br>
<br>
 DEPENDS = &quot;intltool-native libcap util-linux gnu-efi gperf-native&quot;<br>
<br>
-SRC_URI += &quot;file://0007-use-lnr-wrapper-<wbr>instead-of-looking-for-<wbr>relative-opti.patch&quot;<br>
+SRC_URI += &quot;file://0003-use-lnr-wrapper-<wbr>instead-of-looking-for-<wbr>relative-opti.patch \<br>
+            file://0027-remove-nobody-<wbr>user-group-checking.patch \<br>
+            file://0001-Also-check-i386-<wbr>i586-and-i686-for-ia32.patch \<br>
+            file://0001-Fix-to-run-efi_cc-<wbr>and-efi_ld-correctly-when-<wbr>cross-co.patch \<br>
+            &quot;<br>
<br>
-inherit autotools pkgconfig gettext<br>
+inherit meson pkgconfig gettext<br>
 inherit deploy<br>
<br>
 EFI_CC ?= &quot;${CC}&quot;<br>
-# Man pages are packaged through the main systemd recipe<br>
-EXTRA_OECONF = &quot; --enable-gnuefi \<br>
-                 --with-efi-includedir=${<wbr>STAGING_INCDIR} \<br>
-                 --with-efi-ldsdir=${STAGING_<wbr>LIBDIR} \<br>
-                 --with-efi-libdir=${STAGING_<wbr>LIBDIR} \<br>
-                 --disable-manpages \<br>
-                 EFI_CC=&#39;${EFI_CC}&#39; \<br>
-               &quot;<br>
+<br>
+EXTRA_OEMESON += &quot;-Defi=true \<br>
+                  -Dgnu-efi=true \<br>
+                  -Defi-includedir=${STAGING_<wbr>INCDIR}/efi \<br>
+                  -Defi-ldsdir=${STAGING_LIBDIR} \<br>
+                  -Defi-libdir=${STAGING_LIBDIR} \<br>
+                  -Dman=false \<br>
+                  -Defi-cc=&#39;${EFI_CC}&#39; \<br>
+                  -Defi-ld=&#39;${LD}&#39; \<br>
+                  &quot;<br>
+<br>
<br>
 # Imported from the old gummiboot recipe<br>
 TUNE_CCARGS_remove = &quot;-mfpmath=sse&quot;<br>
@@ -28,8 +35,7 @@ do_compile() {<br>
        if [ &quot;${TARGET_ARCH}&quot; = &quot;x86_64&quot; ]; then<br>
                SYSTEMD_BOOT_EFI_ARCH=&quot;x64&quot;<br>
        fi<br>
-<br>
-       oe_runmake systemd-boot${SYSTEMD_BOOT_<wbr>EFI_ARCH}.efi<br>
+       ninja src/boot/efi/systemd-boot${<wbr>SYSTEMD_BOOT_EFI_ARCH}.efi<br>
 }<br>
<br>
 do_install() {<br>
@@ -38,6 +44,6 @@ do_install() {<br>
 }<br>
<br>
 do_deploy () {<br>
-       install ${B}/systemd-boot*.efi ${DEPLOYDIR}<br>
+       install ${B}/src/boot/efi/systemd-<wbr>boot*.efi ${DEPLOYDIR}<br>
 }<br>
 addtask deploy before do_build after do_compile<br>
diff --git a/meta/recipes-core/systemd/<wbr>systemd/0001-Also-check-i386-<wbr>i586-and-i686-for-ia32.patch b/meta/recipes-core/systemd/<wbr>systemd/0001-Also-check-i386-<wbr>i586-and-i686-for-ia32.patch<br>
new file mode 100644<br>
index 0000000..877bb1c<br>
--- /dev/null<br>
+++ b/meta/recipes-core/systemd/<wbr>systemd/0001-Also-check-i386-<wbr>i586-and-i686-for-ia32.patch<br>
@@ -0,0 +1,28 @@<br>
+From 3e8c19bb1bbc4493c591f75c00c1fe<wbr>fe3b1c8a69 Mon Sep 17 00:00:00 2001<br>
+From: Chen Qi &lt;<a href="mailto:Qi.Chen@windriver.com">Qi.Chen@windriver.com</a>&gt;<br>
+Date: Tue, 27 Feb 2018 20:42:41 -0800<br>
+Subject: [PATCH] Also check i386, i586 and i686 for ia32<br>
+<br>
+Upstream-Status: Pending<br>
+<br>
+Signed-off-by: Chen Qi &lt;<a href="mailto:Qi.Chen@windriver.com">Qi.Chen@windriver.com</a>&gt;<br>
+---<br>
+ meson.build | 2 +-<br>
+ 1 file changed, 1 insertion(+), 1 deletion(-)<br>
+<br>
+diff --git a/meson.build b/meson.build<br>
+index 28cb8b60e..489531a43 100644<br>
+--- a/meson.build<br>
++++ b/meson.build<br>
+@@ -1217,7 +1217,7 @@ conf.set10(&#39;SYSTEMD_SLOW_<wbr>TESTS_DEFAULT&#39;, slow_tests)<br>
+ if get_option(&#39;efi&#39;)<br>
+         efi_arch = host_machine.cpu_family()<br>
+<br>
+-        if efi_arch == &#39;x86&#39;<br>
++        if efi_arch == &#39;x86&#39; or efi_arch == &#39;i386&#39; or efi_arch == &#39;i586&#39; or efi_arch == &#39;i686&#39;<br>
+                 EFI_MACHINE_TYPE_NAME = &#39;ia32&#39;<br>
+                 gnu_efi_arch = &#39;ia32&#39;<br>
+         elif efi_arch == &#39;x86_64&#39;<br>
+--<br>
+2.13.0<br>
+<br>
diff --git a/meta/recipes-core/systemd/<wbr>systemd/0001-Fix-to-run-efi_<wbr>cc-and-efi_ld-correctly-when-<wbr>cross-co.patch b/meta/recipes-core/systemd/<wbr>systemd/0001-Fix-to-run-efi_<wbr>cc-and-efi_ld-correctly-when-<wbr>cross-co.patch<br>
new file mode 100644<br>
index 0000000..e2e19ba<br>
--- /dev/null<br>
+++ b/meta/recipes-core/systemd/<wbr>systemd/0001-Fix-to-run-efi_<wbr>cc-and-efi_ld-correctly-when-<wbr>cross-co.patch<br>
@@ -0,0 +1,62 @@<br>
+From 527413ec243564a89ffaad6368d446<wbr>de44415970 Mon Sep 17 00:00:00 2001<br>
+From: Chen Qi &lt;<a href="mailto:Qi.Chen@windriver.com">Qi.Chen@windriver.com</a>&gt;<br>
+Date: Tue, 27 Feb 2018 21:42:23 -0800<br>
+Subject: [PATCH] Fix to run efi_cc and efi_ld correctly when cross-compiling<br>
+<br>
+When cross-compiling, efi_cc and efi_ld may take the form of<br>
+&#39;xxx-gcc --sysroot=xxx&#39;, and this would cause run_command and<br>
+the alike fail.<br>
+<br>
+Fix to split them to make commands run correctly.<br>
+<br>
+Upstream-Status: Pending<br>
+<br>
+Signed-off-by: Chen Qi &lt;<a href="mailto:Qi.Chen@windriver.com">Qi.Chen@windriver.com</a>&gt;<br>
+---<br>
+ src/boot/efi/meson.build | 16 +++++++++++++---<br>
+ 1 file changed, 13 insertions(+), 3 deletions(-)<br>
+<br>
+diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build<br>
+index 992a3ba4c..9f9ec4911 100644<br>
+--- a/src/boot/efi/meson.build<br>
++++ b/src/boot/efi/meson.build<br>
+@@ -157,7 +157,7 @@ if have_gnu_efi<br>
+                 o_file = custom_target(file + &#39;.o&#39;,<br>
+                                        input : file,<br>
+                                        output : file + &#39;.o&#39;,<br>
+-                                       command : [efi_cc, &#39;-c&#39;, &#39;@INPUT@&#39;, &#39;-o&#39;, &#39;@OUTPUT@&#39;]<br>
++                                       command : efi_cc.split() + [&#39;-c&#39;, &#39;@INPUT@&#39;, &#39;-o&#39;, &#39;@OUTPUT@&#39;]<br>
+                                                  + compile_args,<br>
+                                        depend_files : efi_headers)<br>
+                 if (common_sources + systemd_boot_sources).<wbr>contains(file)<br>
+@@ -168,7 +168,17 @@ if have_gnu_efi<br>
+                 endif<br>
+         endforeach<br>
+<br>
+-        libgcc_file_name = run_command(efi_cc, &#39;-print-libgcc-file-name&#39;).<wbr>stdout().strip()<br>
++        find_libgcc_cmd_all = efi_cc + &#39; -print-libgcc-file-name&#39;<br>
++        find_libgcc_cmd = find_libgcc_cmd_all.split()[0]<br>
++        find_libgcc_args = []<br>
++        cmd_args_all = find_libgcc_cmd_all.split()<br>
++        foreach arg : cmd_args_all<br>
++                if arg != find_libgcc_cmd<br>
++                        find_libgcc_args += arg<br>
++                endif<br>
++        endforeach<br>
++<br>
++        libgcc_file_name = run_command(find_libgcc_cmd, find_libgcc_args).stdout().<wbr>strip()<br>
+         systemd_boot_efi_name = &#39;systemd-boot@0@.efi&#39;.format(<wbr>EFI_MACHINE_TYPE_NAME)<br>
+         stub_efi_name = &#39;linux@0@.efi.stub&#39;.format(<wbr>EFI_MACHINE_TYPE_NAME)<br>
+         no_undefined_symbols = find_program(&#39;no-undefined-<wbr>symbols.sh&#39;)<br>
+@@ -179,7 +189,7 @@ if have_gnu_efi<br>
+                         tuple[0],<br>
+                         input : tuple[2],<br>
+                         output : tuple[0],<br>
+-                        command : [efi_ld, &#39;-o&#39;, &#39;@OUTPUT@&#39;] +<br>
++                        command : efi_ld.split() + [&#39;-o&#39;, &#39;@OUTPUT@&#39;] +<br>
+                                   efi_ldflags + tuple[2] +<br>
+                                   [&#39;-lefi&#39;, &#39;-lgnuefi&#39;, libgcc_file_name])<br>
+<br>
+--<br>
+2.13.0<br>
+<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.9.1<br>
<br>
--<br>
______________________________<wbr>_________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.<wbr>openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/<wbr>mailman/listinfo/openembedded-<wbr>core</a><br>
</font></span></blockquote></div><br></div>