[Arm-dev] Centos specific patch for uboot images

Mark Verlinde

mark at havak.nl
Fri Sep 20 12:46:32 UTC 2019



First of all congratulations and thanks for the latest 7.7 release; updated several systems without issues!
 

As mentioned in an other conversation it is the logical continuation of 7.6-updates nevertheless found some nice surprises in the armhfp and especially aarch64 extras repository's including updated u-boot images

This being said it saddens me to see in the source file of the uboot-tools-2019.07-3 they still carry a Fedora specific patch. While it is not a difficult fix the get centosisms in. Especially since the upstream maintainer (intentionally?) reverted the order of first two distro specific patches. (This makes a clean patch possible without patching the patch.)

I know it is not a encouraged to boot aarch64 on our SBC's, nor is it my objective to promote this.
But an easy route I use for over an year is though uboot-uefi boot > grub2.
And have to say I like it a lot, with an (serial)monitor attracted you can choose the kernel in grub2;
or partion you want to boot (if you happen to feel to be inclined  to have a multiboot-environment)

after re-basing to uboot-tools-2019.07-3 
( https://github.com/markVnl/rpms-uboot-tools/compare/centos...el7 )
these two patches do the job for me:

>From 98a2c15275a5fe154cf80344b7538d72ecb00645 Mon Sep 17 00:00:00 2001
From: Mark Verlinde <mark at havak.nl>
Date: Fri, 20 Sep 2019 13:29:10 +0200
Subject: [PATCH 1/2] uefi use Centos specific path name

---
 uefi-use-Centos-specific-path-name.patch | 50 ++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)
 create mode 100644 uefi-use-Centos-specific-path-name.patch

diff --git a/uefi-use-Centos-specific-path-name.patch b/uefi-use-Centos-specific-path-name.patch
new file mode 100644
index 0000000..14abac1
--- /dev/null
+++ b/uefi-use-Centos-specific-path-name.patch
@@ -0,0 +1,50 @@
+From dd6a7a9726e5d79bb053d3ab0a8b0ae273140bce Mon Sep 17 00:00:00 2001
+From: Mark Verlinde <mark at havak.nl>
+Date: Tue, 25 Dec 2018 15:28:56 +0100
+Subject: [PATCH 1/1] uefi use Centos specific path name
+
+Signed-off-by: Mark Verlinde <mark at havak.nl>
+---
+ include/config_distro_bootcmd.h | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
+index 47e98e14ac..aa4b24d4de 100644
+--- a/include/config_distro_bootcmd.h
++++ b/include/config_distro_bootcmd.h
+@@ -92,9 +92,9 @@
+ 
+ #ifdef CONFIG_EFI_LOADER
+ #if defined(CONFIG_ARM64)
+-#define BOOTEFI_NAME "bootaa64.efi"
++#define BOOTEFI_NAME "grubaa64.efi"
+ #elif defined(CONFIG_ARM)
+-#define BOOTEFI_NAME "bootarm.efi"
++#define BOOTEFI_NAME "grubarm.efi"
+ #elif defined(CONFIG_X86_RUN_32BIT)
+ #define BOOTEFI_NAME "bootia32.efi"
+ #elif defined(CONFIG_X86_RUN_64BIT)
+@@ -130,7 +130,7 @@
+ 			"bootefi bootmgr ${fdtcontroladdr};"              \
+ 		"fi;"                                                     \
+ 		"load ${devtype} ${devnum}:${distro_bootpart} "           \
+-			"${kernel_addr_r} efi/boot/"BOOTEFI_NAME"; "      \
++			"${kernel_addr_r} efi/centos/"BOOTEFI_NAME"; "    \
+ 		"if fdt addr ${fdt_addr_r}; then "                        \
+ 			"bootefi ${kernel_addr_r} ${fdt_addr_r};"         \
+ 		"else "                                                   \
+@@ -165,9 +165,9 @@
+ 		"run boot_efi_binary\0"                                   \
+ 	"scan_dev_for_efi="                                               \
+ 		"if test -e ${devtype} ${devnum}:${distro_bootpart} "     \
+-					"efi/boot/"BOOTEFI_NAME"; then "  \
++					"efi/centos/"BOOTEFI_NAME"; then "\
+ 				"echo Found EFI removable media binary "  \
+-					"efi/boot/"BOOTEFI_NAME"; "       \
++					"efi/centos/"BOOTEFI_NAME"; "     \
+ 				"run scan_dev_for_dtb; "                  \
+ 				"echo EFI LOAD FAILED: continuing...; "   \
+ 		"fi; "                                                    \
+-- 
+2.16.5
+
-- 
1.8.3.1


>From a4ac56bf5b7baa15eca75870a8fdca6defc5e8ff Mon Sep 17 00:00:00 2001
From: Mark Verlinde <mark at havak.nl>
Date: Fri, 20 Sep 2019 13:44:43 +0200
Subject: [PATCH 2/2] Add Centosisms

---
 uboot-tools.spec | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/uboot-tools.spec b/uboot-tools.spec
index 226bbb6..91b3faf 100644
--- a/uboot-tools.spec
+++ b/uboot-tools.spec
@@ -2,7 +2,7 @@
 
 Name:      uboot-tools
 Version:   2019.07
-Release:   3%{?candidate:.%{candidate}}%{?dist}
+Release:   4%{?candidate:.%{candidate}}%{?dist}
 Summary:   U-Boot utilities
 License:   GPLv2+ BSD LGPL-2.1+ LGPL-2.0+
 URL:       http://www.denx.de/wiki/U-Boot
@@ -14,11 +14,18 @@ Source3:   aarch64-boards
 Source4:   aarch64-chromebooks
 Source5:   10-devicetree.install
 
-# Fedoraisms patches
+# Fedora/CentOS-isms patches
 # Needed to find DT on boot partition that's not the first partition
 Patch1:    uefi-distro-load-FDT-from-any-partition-on-boot-device.patch
+
 # Needed due to issues with shim
-Patch2:    uefi-use-Fedora-specific-path-name.patch
+%if 0%{?centos}
+# CentOSisms
+Patch2:    uefi-use-Centos-specific-path-name.patch
+%else
+# Fedoraisms
+Patch3:    uefi-use-Fedora-specific-path-name.patch
+%endif
 
 # Board fixes and enablement
 Patch5:    usb-kbd-fixes.patch
@@ -265,6 +272,9 @@ cp -p board/warp7/README builds/docs/README.warp7
 %endif
 
 %changelog
+* Thu Aug 29 2019 Mark Verlinde <mark.verlinde at gmail.com> 2019.07-4
+- Add conditional CentOS specific EFI location
+
 * Sun Aug  4 2019 Peter Robinson <pbrobinson at fedoraproject.org> 2019.07-3
 - Fixes for Rock960
 - Iniital Raspberry Pi 4 support
-- 
1.8.3.1




More information about the Arm-dev mailing list