Compare commits

...

8 Commits
master ... f26

Author SHA1 Message Date
Peter Robinson 07b45cf53b Netboot data abort fix, EFI path fix 2017-07-13 16:37:49 +01:00
Peter Robinson 0e9cdc48e8 add proposed upstream patch to fix abort on net-boot, update Fedora uEFI patch 2017-07-12 20:13:28 +01:00
Peter Robinson 67dc98c14e include rockchips spl 2017-06-24 16:05:02 +01:00
Peter Robinson acdf39112b fix changelog date 2017-06-24 14:09:11 +01:00
Peter Robinson bc1ed3c540 Fix bug in aarch64 builds that dropped some files, Add DT Overlay support for RPi/BeagleBone/CHIP/96boards devices 2017-06-24 14:03:28 +01:00
Peter Robinson 00ec183a4d Further uEFI and DragonBoard fixes 2017-06-22 09:55:05 +01:00
Peter Robinson f61ccc7081 Dragonboard and uEFI fixes 2017-06-21 13:04:32 +01:00
Peter Robinson f9e4eb9671 Spec and build refactoring 2017-06-13 14:53:29 +01:00
8 changed files with 1032 additions and 54 deletions

221
device-tree-overlays.patch Normal file
View File

@ -0,0 +1,221 @@
From ab10d8b4580a94c46ee25e6fc85a5a93946ee8a2 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Wed, 21 Jun 2017 15:20:50 +0100
Subject: [PATCH 1/4] raspberry pi: add device tree overlay support
Raspberry Pi has numerous HAT and other HW expansion options such as screens and
cameras some of which need overlays from the beginning so it makes sense to
enable evice tree overlays.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
configs/rpi_2_defconfig | 1 +
configs/rpi_3_32b_defconfig | 1 +
configs/rpi_3_defconfig | 1 +
configs/rpi_defconfig | 1 +
4 files changed, 4 insertions(+)
diff --git a/configs/rpi_2_defconfig b/configs/rpi_2_defconfig
index 9875f5d295..1be794a06c 100644
--- a/configs/rpi_2_defconfig
+++ b/configs/rpi_2_defconfig
@@ -14,6 +14,7 @@ CONFIG_CMD_USB=y
# CONFIG_CMD_FPGA is not set
CONFIG_CMD_GPIO=y
CONFIG_OF_EMBED=y
+CONFIG_OF_LIBFDT_OVERLAY=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_BCM2835=y
CONFIG_USB=y
diff --git a/configs/rpi_3_32b_defconfig b/configs/rpi_3_32b_defconfig
index e4a81b882d..8c0226d107 100644
--- a/configs/rpi_3_32b_defconfig
+++ b/configs/rpi_3_32b_defconfig
@@ -15,6 +15,7 @@ CONFIG_CMD_USB=y
# CONFIG_CMD_FPGA is not set
CONFIG_CMD_GPIO=y
CONFIG_OF_EMBED=y
+CONFIG_OF_LIBFDT_OVERLAY=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_BCM2835=y
# CONFIG_REQUIRE_SERIAL_CONSOLE is not set
diff --git a/configs/rpi_3_defconfig b/configs/rpi_3_defconfig
index e0be6c76f8..604c83b634 100644
--- a/configs/rpi_3_defconfig
+++ b/configs/rpi_3_defconfig
@@ -15,6 +15,7 @@ CONFIG_CMD_USB=y
# CONFIG_CMD_FPGA is not set
CONFIG_CMD_GPIO=y
CONFIG_OF_EMBED=y
+CONFIG_OF_LIBFDT_OVERLAY=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_BCM2835=y
# CONFIG_REQUIRE_SERIAL_CONSOLE is not set
diff --git a/configs/rpi_defconfig b/configs/rpi_defconfig
index a07d69800c..ecc0dbaa1a 100644
--- a/configs/rpi_defconfig
+++ b/configs/rpi_defconfig
@@ -14,6 +14,7 @@ CONFIG_CMD_USB=y
# CONFIG_CMD_FPGA is not set
CONFIG_CMD_GPIO=y
CONFIG_OF_EMBED=y
+CONFIG_OF_LIBFDT_OVERLAY=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_BCM2835=y
CONFIG_USB=y
--
2.13.0
From 1a96e1676bf60fd3f63e0f64f266480a6b81005f Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Sat, 24 Jun 2017 12:53:25 +0100
Subject: [PATCH 2/4] am335x: beagle/evm: add device tree overlay support
TI am33xx devices such as the BeagleBone devices have numerous cape options such
as screens some of which need overlays from the beginning so it makes sense to
enable evice tree overlays.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
configs/am335x_boneblack_defconfig | 1 +
configs/am335x_evm_defconfig | 2 ++
configs/am335x_evm_nor_defconfig | 1 +
configs/am335x_evm_norboot_defconfig | 1 +
configs/am335x_evm_spiboot_defconfig | 1 +
configs/am335x_evm_usbspl_defconfig | 1 +
6 files changed, 7 insertions(+)
diff --git a/configs/am335x_boneblack_defconfig b/configs/am335x_boneblack_defconfig
index d3cb828e41..1f99c4131d 100644
--- a/configs/am335x_boneblack_defconfig
+++ b/configs/am335x_boneblack_defconfig
@@ -47,3 +47,4 @@ CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
CONFIG_G_DNL_VENDOR_NUM=0x0451
CONFIG_G_DNL_PRODUCT_NUM=0xd022
CONFIG_OF_LIBFDT=y
+CONFIG_OF_LIBFDT_OVERLAY=y
diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
index 5d07a151f7..24ea9bab8b 100644
--- a/configs/am335x_evm_defconfig
+++ b/configs/am335x_evm_defconfig
@@ -57,3 +57,5 @@ CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
CONFIG_G_DNL_VENDOR_NUM=0x0451
CONFIG_G_DNL_PRODUCT_NUM=0xd022
CONFIG_RSA=y
+CONFIG_OF_LIBFDT=y
+CONFIG_OF_LIBFDT_OVERLAY=y
diff --git a/configs/am335x_evm_nor_defconfig b/configs/am335x_evm_nor_defconfig
index 000099eb1f..5eb7ec90ab 100644
--- a/configs/am335x_evm_nor_defconfig
+++ b/configs/am335x_evm_nor_defconfig
@@ -44,3 +44,4 @@ CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
CONFIG_G_DNL_VENDOR_NUM=0x0451
CONFIG_G_DNL_PRODUCT_NUM=0xd022
CONFIG_OF_LIBFDT=y
+CONFIG_OF_LIBFDT_OVERLAY=y
diff --git a/configs/am335x_evm_norboot_defconfig b/configs/am335x_evm_norboot_defconfig
index 023cea461c..60f564654c 100644
--- a/configs/am335x_evm_norboot_defconfig
+++ b/configs/am335x_evm_norboot_defconfig
@@ -39,3 +39,4 @@ CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
CONFIG_G_DNL_VENDOR_NUM=0x0451
CONFIG_G_DNL_PRODUCT_NUM=0xd022
CONFIG_OF_LIBFDT=y
+CONFIG_OF_LIBFDT_OVERLAY=y
diff --git a/configs/am335x_evm_spiboot_defconfig b/configs/am335x_evm_spiboot_defconfig
index c9373f9157..5e20305f4a 100644
--- a/configs/am335x_evm_spiboot_defconfig
+++ b/configs/am335x_evm_spiboot_defconfig
@@ -44,3 +44,4 @@ CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
CONFIG_G_DNL_VENDOR_NUM=0x0451
CONFIG_G_DNL_PRODUCT_NUM=0xd022
CONFIG_OF_LIBFDT=y
+CONFIG_OF_LIBFDT_OVERLAY=y
diff --git a/configs/am335x_evm_usbspl_defconfig b/configs/am335x_evm_usbspl_defconfig
index 04005f0e77..02e27ef92e 100644
--- a/configs/am335x_evm_usbspl_defconfig
+++ b/configs/am335x_evm_usbspl_defconfig
@@ -44,3 +44,4 @@ CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
CONFIG_G_DNL_VENDOR_NUM=0x0451
CONFIG_G_DNL_PRODUCT_NUM=0xd022
CONFIG_OF_LIBFDT=y
+CONFIG_OF_LIBFDT_OVERLAY=y
--
2.13.0
From 8f3100bedb9749629ff01a4bbaf7fed0d81cc198 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Thu, 22 Jun 2017 09:01:34 +0100
Subject: [PATCH 3/4] CHIP: add device tree overlay support
CHIP and CHIP Pro devices have options of DIP addon boards some of which need
overlays from the beginning so it makes sense to enable device tree overlays.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
configs/CHIP_defconfig | 2 ++
configs/CHIP_pro_defconfig | 2 ++
2 files changed, 4 insertions(+)
diff --git a/configs/CHIP_defconfig b/configs/CHIP_defconfig
index 9b9e0b7e62..6b07eab21e 100644
--- a/configs/CHIP_defconfig
+++ b/configs/CHIP_defconfig
@@ -24,3 +24,5 @@ CONFIG_USB_GADGET_DOWNLOAD=y
CONFIG_G_DNL_MANUFACTURER="Allwinner Technology"
CONFIG_G_DNL_VENDOR_NUM=0x1f3a
CONFIG_G_DNL_PRODUCT_NUM=0x1010
+CONFIG_OF_LIBFDT=y
+CONFIG_OF_LIBFDT_OVERLAY=y
diff --git a/configs/CHIP_pro_defconfig b/configs/CHIP_pro_defconfig
index 52572bd055..2c73c35c5c 100644
--- a/configs/CHIP_pro_defconfig
+++ b/configs/CHIP_pro_defconfig
@@ -30,3 +30,5 @@ CONFIG_USB_GADGET_DOWNLOAD=y
CONFIG_G_DNL_MANUFACTURER="Allwinner Technology"
CONFIG_G_DNL_VENDOR_NUM=0x1f3a
CONFIG_G_DNL_PRODUCT_NUM=0x1010
+CONFIG_OF_LIBFDT=y
+CONFIG_OF_LIBFDT_OVERLAY=y
--
2.13.0
From bec4ce10a38bced9a70f083514b4f6106e44255e Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Sat, 24 Jun 2017 12:55:47 +0100
Subject: [PATCH 4/4] 96boards: dragonboard/hikey: add device tree overlay
support
96boards CE devices such as the DragonBoard and Hikey devices have numerous
mezzanine options some of which need overlays from the beginning so it makes
sense to enable device tree overlays.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
configs/dragonboard410c_defconfig | 2 ++
configs/hikey_defconfig | 2 ++
2 files changed, 4 insertions(+)
diff --git a/configs/dragonboard410c_defconfig b/configs/dragonboard410c_defconfig
index 90c145aa15..79ac7dd423 100644
--- a/configs/dragonboard410c_defconfig
+++ b/configs/dragonboard410c_defconfig
@@ -37,3 +37,5 @@ CONFIG_USB_EHCI_MSM=y
CONFIG_USB_ULPI_VIEWPORT=y
CONFIG_USB_ULPI=y
CONFIG_USB_STORAGE=y
+CONFIG_OF_LIBFDT=y
+CONFIG_OF_LIBFDT_OVERLAY=y
diff --git a/configs/hikey_defconfig b/configs/hikey_defconfig
index b112be2ef5..8a35cd3c87 100644
--- a/configs/hikey_defconfig
+++ b/configs/hikey_defconfig
@@ -16,3 +16,5 @@ CONFIG_MMC_DW=y
CONFIG_MMC_DW_K3=y
CONFIG_USB=y
CONFIG_USB_STORAGE=y
+CONFIG_OF_LIBFDT=y
+CONFIG_OF_LIBFDT_OVERLAY=y
--
2.13.0

95
dragonboard-fixes.patch Normal file
View File

@ -0,0 +1,95 @@
From a74e70ec7f5ffdd9f618e2a8f92f4986256cb5c1 Mon Sep 17 00:00:00 2001
From: Rob Clark <robdclark@gmail.com>
Date: Tue, 20 Jun 2017 17:50:16 -0400
Subject: [PATCH 2/8] board/db410c: add missing linker map entries for efi
Otherwise the loaded image would miss the efi_runtime sections, and fall
over hard when grub (for example) tried to call runtime services located
in this section.
Signed-off-by: Rob Clark <robdclark@gmail.com>
---
board/qualcomm/dragonboard410c/u-boot.lds | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/board/qualcomm/dragonboard410c/u-boot.lds b/board/qualcomm/dragonboard410c/u-boot.lds
index 6e1c5a8a67..62ac4d7a60 100644
--- a/board/qualcomm/dragonboard410c/u-boot.lds
+++ b/board/qualcomm/dragonboard410c/u-boot.lds
@@ -43,6 +43,22 @@ SECTIONS
. = ALIGN(8);
+ .efi_runtime : {
+ __efi_runtime_start = .;
+ *(efi_runtime_text)
+ *(efi_runtime_data)
+ __efi_runtime_stop = .;
+ }
+
+ .efi_runtime_rel : {
+ __efi_runtime_rel_start = .;
+ *(.relaefi_runtime_text)
+ *(.relaefi_runtime_data)
+ __efi_runtime_rel_stop = .;
+ }
+
+ . = ALIGN(8);
+
.image_copy_end :
{
*(.__image_copy_end)
--
2.13.0
From 9bf27e4adce115e1e6694c8807ad1b6689f9b074 Mon Sep 17 00:00:00 2001
From: Rob Clark <robdclark@gmail.com>
Date: Tue, 20 Jun 2017 17:52:41 -0400
Subject: [PATCH 3/8] board/db410c: fix fdt address
Signed-off-by: Rob Clark <robdclark@gmail.com>
---
include/configs/dragonboard410c.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/configs/dragonboard410c.h b/include/configs/dragonboard410c.h
index 11c842d952..3b9932da8b 100644
--- a/include/configs/dragonboard410c.h
+++ b/include/configs/dragonboard410c.h
@@ -105,7 +105,7 @@ REFLASH(dragonboard/u-boot.img, 8)\
"linux_image=Image\0" \
"kernel_addr_r=0x81000000\0"\
"fdtfile=apq8016-sbc.dtb\0" \
- "fdt_addr_r=0x83000000\0"\
+ "fdt_addr_r=0x81e00000\0"\
"ramdisk_addr_r=0x84000000\0"\
"scriptaddr=0x90000000\0"\
"pxefile_addr_r=0x90100000\0"\
--
2.13.0
From 95177af6eb3d7b835bbb467aad2565e4680830a3 Mon Sep 17 00:00:00 2001
From: Rob Clark <robdclark@gmail.com>
Date: Wed, 21 Jun 2017 14:21:15 -0400
Subject: [PATCH 4/8] WIP: fix usb
---
common/usb_storage.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/usb_storage.c b/common/usb_storage.c
index 03171f74cb..0e3de9064b 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -1019,7 +1019,7 @@ static int usb_test_unit_ready(ccb *srb, struct us_data *ss)
if ((srb->sense_buf[2] == 0x02) &&
(srb->sense_buf[12] == 0x3a))
return -1;
- mdelay(100);
+ mdelay(250);
} while (retries--);
return -1;
--
2.13.0

View File

@ -0,0 +1,41 @@
From patchwork Wed Jul 12 14:34:50 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot] net: Mark the ip_udp_hdr struct as packed
From: Maxime Ripard <maxime.ripard@free-electrons.com>
X-Patchwork-Id: 787298
Message-Id: <20170712143450.12233-1-maxime.ripard@free-electrons.com>
To: Tom Rini <trini@konsulko.com>
Cc: u-boot@lists.denx.de, Maxime Ripard <maxime.ripard@free-electrons.com>
Date: Wed, 12 Jul 2017 16:34:50 +0200
The -mno-unaligned-access flag used on ARM to prevent GCC from generating
unaligned accesses (obviously) will only do so on packed structures.
It seems like gcc 7.1 is a bit stricter than previous gcc versions on this,
and using it lead to data abort for unaligned accesses when generating
network traffic.
Fix this by adding the packed attribute to the ip_udp_hdr structure in
order to let GCC do its job.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
---
include/net.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/net.h b/include/net.h
index 997db9210a8f..7b815afffafa 100644
--- a/include/net.h
+++ b/include/net.h
@@ -390,7 +390,7 @@ struct ip_udp_hdr {
u16 udp_dst; /* UDP destination port */
u16 udp_len; /* Length of UDP packet */
u16 udp_xsum; /* Checksum */
-};
+} __attribute__ ((packed));
#define IP_UDP_HDR_SIZE (sizeof(struct ip_udp_hdr))
#define UDP_HDR_SIZE (IP_UDP_HDR_SIZE - IP_HDR_SIZE)

View File

@ -2,15 +2,14 @@
Name: uboot-tools
Version: 2017.05
Release: 2%{?candidate:.%{candidate}}%{?dist}
Release: 5%{?candidate:.%{candidate}}%{?dist}
Summary: U-Boot utilities
Group: Development/Tools
License: GPLv2+ BSD LGPL-2.1+ LGPL-2.0+
URL: http://www.denx.de/wiki/U-Boot
Source0: ftp://ftp.denx.de/pub/u-boot/u-boot-%{version}%{?candidate:-%{candidate}}.tar.bz2
Source1: armv7-boards
Source2: armv8-boards
Source1: arm-boards
Source2: aarch64-boards
Patch1: add-BOOTENV_INIT_COMMAND-for-commands-that-may-be-ne.patch
Patch2: u-boot-openssl-1.1.patch
@ -21,6 +20,10 @@ Patch6: AW64-add-spl-atf-support.patch
Patch7: use-Fedora-specific-EFI-path-name.patch
Patch8: clearfog-distroboot.patch
Patch9: arm-tegra-nyan-chromebook.patch
Patch10: dragonboard-fixes.patch
Patch11: uefi-fixes.patch
Patch12: device-tree-overlays.patch
Patch13: net-Mark-the-ip_udp_hdr-struct-as-packed.patch
# Patch19: 0001-arm-mvebu-enable-generic-distro-boot-config.patch
@ -86,31 +89,23 @@ git config --unset user.email
git config --unset user.name
rm -rf .git
cp %SOURCE1 %SOURCE2 .
%build
mkdir builds
%ifarch aarch64
for board in $(cat %SOURCE2)
%ifarch aarch64 %{arm}
for board in $(cat %{_arch}-boards)
do
mkdir builds/$(echo $board)/
# Needs improving but currently Pine64 is the only one
if [ "$board" = ""pine64_plus ]; then
cp /usr/share/arm-trusted-firmware/sun50iw1p1/bl31.bin builds/$(echo $board)/
fi
make $(echo $board)_defconfig O=builds/$(echo $board)/
make HOSTCC="gcc $RPM_OPT_FLAGS" CROSS_COMPILE="" %{?_smp_mflags} V=1 O=builds/$(echo $board)/
echo "Building board: $board"
mkdir builds/$(echo $board)/
# Needs improving but currently Pine64 is the only one
if [ "$board" = ""pine64_plus ]; then
cp /usr/share/arm-trusted-firmware/sun50iw1p1/bl31.bin builds/$(echo $board)/
fi
make $(echo $board)_defconfig O=builds/$(echo $board)/
make HOSTCC="gcc $RPM_OPT_FLAGS" CROSS_COMPILE="" %{?_smp_mflags} V=1 O=builds/$(echo $board)/
done
%endif
%ifarch %{arm}
for board in $(cat %SOURCE1)
do
mkdir builds/$(echo $board)/
make $(echo $board)_defconfig V=1 O=builds/$(echo $board)/
make HOSTCC="gcc $RPM_OPT_FLAGS" CROSS_COMPILE="" %{?_smp_mflags} V=1 O=builds/$(echo $board)/
done
%endif
make HOSTCC="gcc $RPM_OPT_FLAGS" %{?_smp_mflags} CROSS_COMPILE="" defconfig V=1 O=builds/
@ -122,34 +117,20 @@ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
mkdir -p $RPM_BUILD_ROOT%{_datadir}/uboot/
%ifarch aarch64
for board in $(cat %SOURCE2)
%ifarch aarch64 %{arm}
for board in $(cat %{_arch}-boards)
do
mkdir -p $RPM_BUILD_ROOT%{_datadir}/uboot/$(echo $board)/
for file in spl/*spl.bin u-boot.bin u-boot.dtb u-boot-dtb.img u-boot.img u-boot.itb spl/sunxi-spl.bin
for file in MLO SPL u-boot.bin u-boot.dtb u-boot-dtb-tegra.bin u-boot.img u-boot.imx u-boot-nodtb-tegra.bin u-boot-spl.kwb u-boot-sunxi-with-spl.bin u-boot.itb
do
if [ -f builds/$(echo $board)/$(echo $file) ]; then
install -p -m 0644 builds/$(echo $board)/$(echo $file) $RPM_BUILD_ROOT%{_datadir}/uboot/$(echo $board)/
fi
done
done
%endif
%ifarch %{arm}
for board in $(cat %SOURCE1)
do
mkdir -p $RPM_BUILD_ROOT%{_datadir}/uboot/$(echo $board)/
for file in MLO SPL spl/arndale-spl.bin spl/origen-spl.bin spl/smdkv310-spl.bin spl/*spl.bin u-boot.bin u-boot.dtb u-boot-dtb-tegra.bin u-boot.img u-boot.imx u-boot-nodtb-tegra.bin u-boot-spl.kwb u-boot-sunxi-with-spl.bin
do
if [ -f builds/$(echo $board)/$(echo $file) ]; then
install -p -m 0644 builds/$(echo $board)/$(echo $file) $RPM_BUILD_ROOT%{_datadir}/uboot/$(echo $board)/
fi
done
done
# Bit of a hack to remove binaries we don't use as they're large
for board in $(cat %SOURCE1)
for board in $(cat %{_arch}-boards)
do
if [ -f $RPM_BUILD_ROOT%{_datadir}/uboot/$(echo $board)/u-boot-sunxi-with-spl.bin ]; then
rm -f $RPM_BUILD_ROOT%{_datadir}/uboot/$(echo $board)/u-boot.*
@ -163,14 +144,19 @@ do
if [ -f $RPM_BUILD_ROOT%{_datadir}/uboot/$(echo $board)/u-boot.imx ]; then
rm -f $RPM_BUILD_ROOT%{_datadir}/uboot/$(echo $board)/u-boot.bin
fi
if [ -f $RPM_BUILD_ROOT%{_datadir}/uboot/$(echo $board)/u-boot.itb ]; then
rm -f $RPM_BUILD_ROOT%{_datadir}/uboot/$(echo $board)/*.bin
rm -f $RPM_BUILD_ROOT%{_datadir}/uboot/$(echo $board)/*.dtb
rm -f $RPM_BUILD_ROOT%{_datadir}/uboot/$(echo $board)/*.img
fi
done
%endif
%ifarch aarch64
for board in $(cat %SOURCE2)
for board in $(cat %{_arch}-boards)
do
mkdir -p $RPM_BUILD_ROOT%{_datadir}/uboot/$(echo $board)/
for file in MLO SPL spl/arndale-spl.bin spl/origen-spl.bin spl/smdkv310-spl.bin u-boot.bin u-boot.dtb u-boot-dtb-tegra.bin u-boot.img u-boot.imx u-boot-nodtb-tegra.bin u-boot-spl.kwb u-boot-sunxi-with-spl.bin
for file in MLO SPL spl/sunxi-spl.bin spl/u-boot-spl.bin u-boot.bin u-boot.dtb u-boot-dtb-tegra.bin u-boot.img u-boot.imx u-boot-nodtb-tegra.bin u-boot-spl.kwb u-boot-sunxi-with-spl.bin
do
if [ -f builds/$(echo $board)/$(echo $file) ]; then
install -p -m 0644 builds/$(echo $board)/$(echo $file) $RPM_BUILD_ROOT%{_datadir}/uboot/$(echo $board)/
@ -194,7 +180,7 @@ done
%endif
%ifarch aarch64
for board in $(cat %SOURCE2)
for board in $(cat %{_arch}-boards)
do
mkdir -p $RPM_BUILD_ROOT%{_datadir}/uboot/elf/$(echo $board)/
for file in u-boot
@ -262,11 +248,24 @@ cp -p board/warp7/README builds/docs/README.warp7
%endif
%changelog
* Mon May 29 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.05-02
* Thu Jul 13 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.05-5
- Netboot data abort fix
- EFI path fix
* Sat Jun 24 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.05-4
- Fix bug in aarch64 builds that dropped some files
- Add DT Overlay support for RPi/BeagleBone/CHIP/96boards devices
* Thu Jun 22 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.05-3
- Further uEFI and DragonBoard fixes
* Mon May 29 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.05-2
- Spec and build refactoring
- Add distro-boot support for ClearFog
- Add support for building a chained u-boot for nyan-big
- Dragonboard and uEFI fixes
* Tue May 9 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.05-01
* Tue May 9 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.05-1
- 2017.05
* Wed May 3 2017 Peter Robinson <pbrobinson@fedoraproject.org> 2017.05-0.7.rc7

610
uefi-fixes.patch Normal file
View File

@ -0,0 +1,610 @@
From dfc84987d97d83c82c99fa2e11ad9ccf3c4ac5f8 Mon Sep 17 00:00:00 2001
From: Rob Clark <robdclark@gmail.com>
Date: Tue, 20 Jun 2017 14:29:12 -0400
Subject: [PATCH 1/8] dm: core: don't fail to iterate if first one fails to
probe
efi_disk_register() would try to iterate all the blk devices. But if
the first one in the list failed to probe, uclass_first_device() would
return NULL and no attempt would be made to register the remaining
devices. Also uclass_next_device() needs the same fix.
Signed-off-by: Rob Clark <robdclark@gmail.com>
---
drivers/core/uclass.c | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c
index 21dc696da3..c47ff5661d 100644
--- a/drivers/core/uclass.c
+++ b/drivers/core/uclass.c
@@ -458,14 +458,23 @@ int uclass_get_device_by_phandle(enum uclass_id id, struct udevice *parent,
int uclass_first_device(enum uclass_id id, struct udevice **devp)
{
- struct udevice *dev;
+ struct udevice *dev = NULL;
int ret;
*devp = NULL;
ret = uclass_find_first_device(id, &dev);
if (!dev)
return 0;
- return uclass_get_device_tail(dev, ret, devp);
+ ret = uclass_get_device_tail(dev, ret, devp);
+ if (ret && dev) {
+ /* we have a device, but it failed to probe, move on and
+ * try the next one.
+ */
+ ret = uclass_next_device(&dev);
+ if (!ret)
+ *devp = dev;
+ }
+ return ret;
}
int uclass_first_device_err(enum uclass_id id, struct udevice **devp)
@@ -490,7 +499,16 @@ int uclass_next_device(struct udevice **devp)
ret = uclass_find_next_device(&dev);
if (!dev)
return 0;
- return uclass_get_device_tail(dev, ret, devp);
+ ret = uclass_get_device_tail(dev, ret, devp);
+ if (ret && (dev != *devp)) {
+ /* we have a device, but it failed to probe, move on and
+ * try the next one.
+ */
+ ret = uclass_next_device(&dev);
+ if (!ret)
+ *devp = dev;
+ }
+ return ret;
}
int uclass_bind_device(struct udevice *dev)
--
2.13.0
From f62aad2dc1b25dd234373e7697c9152b89c75ed6 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Wed, 21 Jun 2017 16:39:02 -0400
Subject: [PATCH 5/8] efi: add some more device path structures
Signed-off-by: Peter Jones <pjones@redhat.com>
---
include/efi_api.h | 33 ++++++++++++++++++++++++++++++++-
1 file changed, 32 insertions(+), 1 deletion(-)
diff --git a/include/efi_api.h b/include/efi_api.h
index 5c3836a51b..5150962872 100644
--- a/include/efi_api.h
+++ b/include/efi_api.h
@@ -272,6 +272,18 @@ struct efi_mac_addr {
u8 addr[32];
};
+#define DEVICE_PATH_TYPE_ACPI_DEVICE 0x02
+#define DEVICE_PATH_SUB_TYPE_ACPI_DEVICE 0x01
+
+#define EFI_PNP_ID(ID) (u32)(((ID) << 16) | 0x41D0)
+#define EISA_PNP_ID(ID) EFI_PNP_ID(ID)
+
+struct efi_device_path_acpi_path {
+ struct efi_device_path dp;
+ u32 hid;
+ u32 uid;
+} __packed;
+
#define DEVICE_PATH_TYPE_MESSAGING_DEVICE 0x03
# define DEVICE_PATH_SUB_TYPE_MSG_MAC_ADDR 0x0b
@@ -282,12 +294,31 @@ struct efi_device_path_mac_addr {
};
#define DEVICE_PATH_TYPE_MEDIA_DEVICE 0x04
+# define DEVICE_PATH_SUB_TYPE_HARD_DRIVE_PATH 0x01
+# define DEVICE_PATH_SUB_TYPE_CDROM_PATH 0x02
# define DEVICE_PATH_SUB_TYPE_FILE_PATH 0x04
+struct efi_device_path_hard_drive_path {
+ struct efi_device_path dp;
+ u32 partition_number;
+ u64 partition_start;
+ u64 partition_end;
+ u8 partition_signature[16];
+ u8 partmap_type;
+ u8 signature_type;
+} __packed;
+
+struct efi_device_path_cdrom_path {
+ struct efi_device_path dp;
+ u32 boot_entry;
+ u64 partition_start;
+ u64 partition_end;
+} __packed;
+
struct efi_device_path_file_path {
struct efi_device_path dp;
u16 str[32];
-};
+} __packed;
#define BLOCK_IO_GUID \
EFI_GUID(0x964e5b21, 0x6459, 0x11d2, \
--
2.13.0
From 09b8585ae5ae6749172f8cca40f322999693e32e Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Wed, 21 Jun 2017 13:18:06 -0400
Subject: [PATCH 6/8] Don't treat a disk as GPT just because you found a valid
PMBR.
Without this part_gpt's ->get_info() winds up getting called instead of
part_dos's.
Signed-off-by: Peter Jones <pjones@redhat.com>
---
disk/part_efi.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/disk/part_efi.c b/disk/part_efi.c
index 1b7ba27947..16adb95b0a 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -301,10 +301,16 @@ int part_get_info_efi(struct blk_desc *dev_desc, int part,
static int part_test_efi(struct blk_desc *dev_desc)
{
ALLOC_CACHE_ALIGN_BUFFER_PAD(legacy_mbr, legacymbr, 1, dev_desc->blksz);
+ ALLOC_CACHE_ALIGN_BUFFER_PAD(gpt_header, gpt_head, 1, dev_desc->blksz);
+ gpt_entry *gpt_pte = NULL;
/* Read legacy MBR from block 0 and validate it */
if ((blk_dread(dev_desc, 0, 1, (ulong *)legacymbr) != 1)
- || (is_pmbr_valid(legacymbr) != 1)) {
+ || (is_pmbr_valid(legacymbr) != 1)
+ || ((is_gpt_valid(dev_desc, GPT_PRIMARY_PARTITION_TABLE_LBA,
+ gpt_head, &gpt_pte) != 1)
+ && is_gpt_valid(dev_desc, (dev_desc->lba - 1),
+ gpt_head, &gpt_pte) != 1)) {
return -1;
}
return 0;
--
2.13.0
From 2d0173238102c2e6a90e4d36f2fcb812cc4e7b24 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Wed, 21 Jun 2017 16:42:07 -0400
Subject: [PATCH 7/8] efi: make efi_disk_obj's for partitions, and give them
better device paths
In this case the device paths stem from a fictional ACPI PNP device, but
that's fine, so long as we can match it later.
Signed-off-by: Peter Jones <pjones@redhat.com>
---
lib/efi_loader/efi_disk.c | 124 +++++++++++++++++++++++++++++++---------------
1 file changed, 84 insertions(+), 40 deletions(-)
diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c
index 39e602a868..90844fdcde 100644
--- a/lib/efi_loader/efi_disk.c
+++ b/lib/efi_loader/efi_disk.c
@@ -28,7 +28,7 @@ struct efi_disk_obj {
/* EFI Interface Media descriptor struct, referenced by ops */
struct efi_block_io_media media;
/* EFI device path to this block device */
- struct efi_device_path_file_path *dp;
+ struct efi_device_path *dp;
/* Offset into disk for simple partitions */
lbaint_t offset;
/* Internal block device */
@@ -193,19 +193,26 @@ static const struct efi_block_io block_io_disk_template = {
.flush_blocks = &efi_disk_flush_blocks,
};
-static void efi_disk_add_dev(const char *name,
- const char *if_typename,
- const struct blk_desc *desc,
- int dev_index,
- lbaint_t offset)
+static struct efi_disk_obj *efi_disk_add_dev(const char *name,
+ const char *if_typename,
+ struct blk_desc *desc,
+ int dev_index,
+ lbaint_t offset,
+ struct efi_disk_obj *parent,
+ int part)
{
+ disk_partition_t info;
struct efi_disk_obj *diskobj;
- struct efi_device_path_file_path *dp;
- int objlen = sizeof(*diskobj) + (sizeof(*dp) * 2);
+ struct efi_device_path_acpi_path *adp;
+ struct efi_device_path_hard_drive_path *hddp;
+ struct efi_device_path_cdrom_path *cddp;
+ struct efi_device_path *edp;
+ /* we just happen to know hddp is bigger than cddp */
+ int objlen = sizeof(*diskobj) + sizeof (*adp) + sizeof(*hddp) + sizeof (*edp);
/* Don't add empty devices */
if (!desc->lba)
- return;
+ return NULL;
diskobj = calloc(1, objlen);
@@ -229,45 +236,89 @@ static void efi_disk_add_dev(const char *name,
diskobj->media.last_block = desc->lba - offset;
diskobj->ops.media = &diskobj->media;
+ adp = (void*)&diskobj[1];
+ diskobj->dp = (struct efi_device_path *)adp;
+
+ adp[0].dp.type = DEVICE_PATH_TYPE_ACPI_DEVICE;
+ adp[0].dp.sub_type = DEVICE_PATH_SUB_TYPE_ACPI_DEVICE;
+ adp[0].dp.length = sizeof (*adp);
+ adp[0].hid = EISA_PNP_ID(0x1337);
+ adp[0].uid = 0;
+
+ if (part >= 0)
+ part_get_info(desc, part, &info);
+
/* Fill in device path */
- dp = (void*)&diskobj[1];
- diskobj->dp = dp;
- dp[0].dp.type = DEVICE_PATH_TYPE_MEDIA_DEVICE;
- dp[0].dp.sub_type = DEVICE_PATH_SUB_TYPE_FILE_PATH;
- dp[0].dp.length = sizeof(*dp);
- ascii2unicode(dp[0].str, name);
+ if (part < 0) {
+ edp = (struct efi_device_path *)((u8 *)adp + adp[0].dp.length);
+ } else if (desc->part_type == PART_TYPE_ISO) {
+ cddp = (struct efi_device_path_cdrom_path *)((u8 *)adp + adp[0].dp.length);
+
+ cddp[0].boot_entry = part - 1;
+ cddp[0].dp.type = DEVICE_PATH_TYPE_MEDIA_DEVICE;
+ cddp[0].dp.sub_type = DEVICE_PATH_SUB_TYPE_CDROM_PATH;
+ cddp[0].dp.length = sizeof (*cddp);
+ cddp[0].partition_start = info.start;
+ cddp[0].partition_end = info.size;
+
+ edp = (struct efi_device_path *)((u8 *)cddp + cddp[0].dp.length);
+ } else {
+ hddp = (struct efi_device_path_hard_drive_path *)((u8 *)adp + adp[0].dp.length);
+
+ hddp[0].dp.type = DEVICE_PATH_TYPE_MEDIA_DEVICE;
+ hddp[0].dp.sub_type = DEVICE_PATH_SUB_TYPE_HARD_DRIVE_PATH;
+ hddp[0].dp.length = sizeof (*hddp);
+ hddp[0].partition_number = part - 1;
+ hddp[0].partition_start = info.start;
+ hddp[0].partition_end = info.size;
+ if (desc->part_type == PART_TYPE_EFI)
+ hddp[0].partmap_type = 2;
+ else
+ hddp[0].partmap_type = 1;
+ hddp[0].signature_type = 0;
+
+ edp = (struct efi_device_path *)((u8 *)hddp + hddp[0].dp.length);
+ }
- dp[1].dp.type = DEVICE_PATH_TYPE_END;
- dp[1].dp.sub_type = DEVICE_PATH_SUB_TYPE_END;
- dp[1].dp.length = sizeof(*dp);
+ edp[0].type = DEVICE_PATH_TYPE_END;
+ edp[0].sub_type = DEVICE_PATH_SUB_TYPE_END;
+ edp[0].length = sizeof(*edp);
/* Hook up to the device list */
list_add_tail(&diskobj->parent.link, &efi_obj_list);
+
+ return diskobj;
}
-static int efi_disk_create_eltorito(struct blk_desc *desc,
- const char *if_typename,
- int diskid,
- const char *pdevname)
+static int efi_disk_create_partitions(struct blk_desc *desc,
+ const char *if_typename,
+ int diskid,
+ const char *pdevname,
+ struct efi_disk_obj *parent)
{
int disks = 0;
-#if CONFIG_IS_ENABLED(ISO_PARTITION)
char devname[32] = { 0 }; /* dp->str is u16[32] long */
disk_partition_t info;
int part = 1;
- if (desc->part_type != PART_TYPE_ISO)
+#if !CONFIG_IS_ENABLED(ISO_PARTITION)
+ /*
+ * El Torito images show up as block devices in an EFI world,
+ * so let's create them here, unless it's disabled...
+ */
+ if (desc->part_type == PART_TYPE_ISO)
return 0;
+#endif
+
while (!part_get_info(desc, part, &info)) {
snprintf(devname, sizeof(devname), "%s:%d", pdevname,
part);
efi_disk_add_dev(devname, if_typename, desc, diskid,
- info.start);
+ info.start, parent, part);
part++;
disks++;
}
-#endif
return disks;
}
@@ -286,6 +337,7 @@ static int efi_disk_create_eltorito(struct blk_desc *desc,
int efi_disk_register(void)
{
int disks = 0;
+ struct efi_disk_obj *diskobj;
#ifdef CONFIG_BLK
struct udevice *dev;
@@ -296,15 +348,11 @@ int efi_disk_register(void)
const char *if_typename = dev->driver->name;
printf("Scanning disk %s...\n", dev->name);
- efi_disk_add_dev(dev->name, if_typename, desc, desc->devnum, 0);
+ diskobj = efi_disk_add_dev(dev->name, if_typename, desc, desc->devnum, 0, NULL, -1);
disks++;
- /*
- * El Torito images show up as block devices in an EFI world,
- * so let's create them here
- */
- disks += efi_disk_create_eltorito(desc, if_typename,
- desc->devnum, dev->name);
+ disks += efi_disk_create_partitions(desc, if_typename,
+ desc->devnum, dev->name, diskobj);
}
#else
int i, if_type;
@@ -332,15 +380,11 @@ int efi_disk_register(void)
snprintf(devname, sizeof(devname), "%s%d",
if_typename, i);
- efi_disk_add_dev(devname, if_typename, desc, i, 0);
+ diskobj = efi_disk_add_dev(devname, if_typename, desc, i, 0, NULL, -1);
disks++;
- /*
- * El Torito images show up as block devices
- * in an EFI world, so let's create them here
- */
- disks += efi_disk_create_eltorito(desc, if_typename,
- i, devname);
+ disks += efi_disk_create_partitions(desc, if_typename,
+ i, devname, diskobj);
}
}
#endif
--
2.13.0
From 2d840bc18c38137ff58a0884eb380f8a12ed6db8 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Wed, 21 Jun 2017 16:44:13 -0400
Subject: [PATCH 8/8] bootefi: make our device and image device paths more
realistic.
This makes the device and image device paths into something grub can
match its disks up against, allowing grub to find its config file on the
original device.
Signed-off-by: Peter Jones <pjones@redhat.com>
---
cmd/bootefi.c | 123 +++++++++++++++++++++++++++++++++++++++++++++-------------
1 file changed, 97 insertions(+), 26 deletions(-)
diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index a0a5434967..a6598dface 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -28,32 +28,49 @@ DECLARE_GLOBAL_DATA_PTR;
* In addition to the originating device we also declare the file path
* of "bootefi" based loads to be /bootefi.
*/
-static struct efi_device_path_file_path bootefi_image_path[] = {
- {
- .dp.type = DEVICE_PATH_TYPE_MEDIA_DEVICE,
- .dp.sub_type = DEVICE_PATH_SUB_TYPE_FILE_PATH,
- .dp.length = sizeof(bootefi_image_path[0]),
- .str = { 'b','o','o','t','e','f','i' },
- }, {
- .dp.type = DEVICE_PATH_TYPE_END,
- .dp.sub_type = DEVICE_PATH_SUB_TYPE_END,
- .dp.length = sizeof(bootefi_image_path[0]),
- }
+static struct efi_device_path_acpi_path bootefi_acpi_path = {
+ .dp.type = DEVICE_PATH_TYPE_ACPI_DEVICE,
+ .dp.sub_type = DEVICE_PATH_SUB_TYPE_ACPI_DEVICE,
+ .dp.length = sizeof(bootefi_acpi_path),
+ .hid = EISA_PNP_ID(0x1337),
+ .uid = 0,
+};
+
+static struct efi_device_path_hard_drive_path bootefi_hard_drive_path = {
+ .dp.type = DEVICE_PATH_TYPE_MEDIA_DEVICE,
+ .dp.sub_type = DEVICE_PATH_SUB_TYPE_HARD_DRIVE_PATH,
+ .dp.length = sizeof(bootefi_hard_drive_path),
};
-static struct efi_device_path_file_path bootefi_device_path[] = {
+static struct efi_device_path_file_path bootefi_image_path_template[] = {
{
.dp.type = DEVICE_PATH_TYPE_MEDIA_DEVICE,
.dp.sub_type = DEVICE_PATH_SUB_TYPE_FILE_PATH,
- .dp.length = sizeof(bootefi_image_path[0]),
+ .dp.length = sizeof(bootefi_image_path_template[0]),
.str = { 'b','o','o','t','e','f','i' },
}, {
.dp.type = DEVICE_PATH_TYPE_END,
.dp.sub_type = DEVICE_PATH_SUB_TYPE_END,
- .dp.length = sizeof(bootefi_image_path[0]),
+ .dp.length = sizeof(bootefi_image_path_template[0]),
}
};
+static u8 image_dp_buf[sizeof(bootefi_acpi_path)
+ + sizeof(bootefi_hard_drive_path)
+ + sizeof(bootefi_image_path_template)];
+
+static struct efi_device_path_file_path bootefi_device_path_template = {
+ .dp.type = DEVICE_PATH_TYPE_END,
+ .dp.sub_type = DEVICE_PATH_SUB_TYPE_END,
+ .dp.length = sizeof(bootefi_device_path_template),
+};
+
+static u8 device_dp_buf[sizeof(bootefi_acpi_path)
+ + sizeof(bootefi_hard_drive_path)
+ + sizeof(bootefi_device_path_template)];
+
+static struct efi_device_path *bootefi_device_path = (void *)device_dp_buf;
+
static efi_status_t EFIAPI bootefi_open_dp(void *handle, efi_guid_t *protocol,
void **protocol_interface, void *agent_handle,
void *controller_handle, uint32_t attributes)
@@ -64,8 +81,8 @@ static efi_status_t EFIAPI bootefi_open_dp(void *handle, efi_guid_t *protocol,
/* The EFI loaded_image interface for the image executed via "bootefi" */
static struct efi_loaded_image loaded_image_info = {
- .device_handle = bootefi_device_path,
- .file_path = bootefi_image_path,
+ .device_handle = (void *)device_dp_buf,
+ .file_path = (void *)image_dp_buf,
};
/* The EFI object struct for the image executed via "bootefi" */
@@ -93,7 +110,7 @@ static struct efi_object loaded_image_info_obj = {
/* The EFI object struct for the device the "bootefi" image was loaded from */
static struct efi_object bootefi_device_obj = {
- .handle = bootefi_device_path,
+ .handle = (void *)device_dp_buf,
.protocols = {
{
/* When asking for the device path interface, return
@@ -104,6 +121,59 @@ static struct efi_object bootefi_device_obj = {
},
};
+void make_device_paths(int net, struct blk_desc *desc, int part)
+{
+ memcpy(device_dp_buf,
+ &bootefi_acpi_path,
+ sizeof(bootefi_acpi_path));
+ memcpy(image_dp_buf,
+ &bootefi_acpi_path,
+ sizeof(bootefi_acpi_path));
+
+ if (net) {
+ memcpy(device_dp_buf + sizeof(bootefi_acpi_path),
+ &bootefi_device_path_template,
+ sizeof (bootefi_device_path_template));
+ memcpy(image_dp_buf + sizeof(bootefi_acpi_path),
+ bootefi_image_path_template,
+ sizeof (bootefi_image_path_template));
+ } else {
+ disk_partition_t info;
+ int rc = -1;
+ if (part > 0)
+ rc = part_get_info(desc, part, &info);
+
+ if (rc < 0) {
+ memcpy(device_dp_buf + sizeof(bootefi_acpi_path),
+ &bootefi_device_path_template,
+ sizeof (bootefi_device_path_template));
+ memcpy(image_dp_buf + sizeof(bootefi_acpi_path),
+ bootefi_image_path_template,
+ sizeof (bootefi_image_path_template));
+ } else {
+ bootefi_hard_drive_path.partition_number = part - 1;
+ bootefi_hard_drive_path.partition_start = info.start;
+ bootefi_hard_drive_path.partition_end = info.size;
+
+ memcpy(device_dp_buf + sizeof(bootefi_acpi_path),
+ &bootefi_hard_drive_path,
+ sizeof (bootefi_hard_drive_path));
+ memcpy(device_dp_buf + sizeof(bootefi_acpi_path)
+ + sizeof(bootefi_hard_drive_path),
+ &bootefi_device_path_template,
+ sizeof (bootefi_device_path_template));
+
+ memcpy(image_dp_buf + sizeof(bootefi_acpi_path),
+ &bootefi_hard_drive_path,
+ sizeof (bootefi_hard_drive_path));
+ memcpy(image_dp_buf + sizeof(bootefi_acpi_path)
+ + sizeof(bootefi_hard_drive_path),
+ bootefi_image_path_template,
+ sizeof (bootefi_image_path_template));
+ }
+ }
+}
+
static void *copy_fdt(void *fdt)
{
u64 fdt_size = fdt_totalsize(fdt);
@@ -217,7 +287,7 @@ static unsigned long do_bootefi_exec(void *efi, void *fdt)
void *nethandle = loaded_image_info.device_handle;
efi_net_register(&nethandle);
- if (!memcmp(bootefi_device_path[0].str, "N\0e\0t", 6))
+ if (!memcmp(bootefi_device_path_template.str, "N\0e\0t", 6))
loaded_image_info.device_handle = nethandle;
else
loaded_image_info.device_handle = bootefi_device_path;
@@ -320,6 +390,7 @@ void efi_set_bootdev(const char *dev, const char *devnr, const char *path)
__maybe_unused struct blk_desc *desc;
char devname[32] = { 0 }; /* dp->str is u16[32] long */
char *colon;
+ int part = -1;
#if defined(CONFIG_BLK) || CONFIG_IS_ENABLED(ISO_PARTITION)
desc = blk_get_dev(dev, simple_strtol(devnr, NULL, 10));
@@ -336,7 +407,9 @@ void efi_set_bootdev(const char *dev, const char *devnr, const char *path)
snprintf(devname, sizeof(devname), "%s%s", dev, devnr);
}
- colon = strchr(devname, ':');
+ colon = strchr(devnr, ':');
+ if (colon)
+ part = simple_strtol(colon+1, NULL, 10);
#if CONFIG_IS_ENABLED(ISO_PARTITION)
/* For ISOs we create partition block devices */
@@ -352,17 +425,15 @@ void efi_set_bootdev(const char *dev, const char *devnr, const char *path)
if (colon)
*colon = '\0';
- /* Patch bootefi_device_path to the target device */
- memset(bootefi_device_path[0].str, 0, sizeof(bootefi_device_path[0].str));
- ascii2unicode(bootefi_device_path[0].str, devname);
-
- /* Patch bootefi_image_path to the target file path */
- memset(bootefi_image_path[0].str, 0, sizeof(bootefi_image_path[0].str));
+ /* Patch bootefi_image_path_template to the target file path */
+ memset(bootefi_image_path_template[0].str, 0, sizeof(bootefi_image_path_template[0].str));
if (strcmp(dev, "Net")) {
/* Add leading / to fs paths, because they're absolute */
snprintf(devname, sizeof(devname), "/%s", path);
} else {
snprintf(devname, sizeof(devname), "%s", path);
}
- ascii2unicode(bootefi_image_path[0].str, devname);
+ ascii2unicode(bootefi_image_path_template[0].str, devname);
+
+ make_device_paths(!strcmp(dev, "Net"), desc, part);
}
--
2.13.0

View File

@ -1,15 +1,15 @@
From dfe26348e0255804981754b529b66790972833b9 Mon Sep 17 00:00:00 2001
From 95140df8476e255cb279a60228b9c703b3ca318f Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Mon, 24 Apr 2017 23:45:37 +0100
Date: Wed, 12 Jul 2017 08:43:31 +0100
Subject: [PATCH] use Fedora specific EFI path/name
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
include/config_distro_bootcmd.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
include/config_distro_bootcmd.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
index 0e01e8240d..756ea121e0 100644
index 4b2c493ae3..704dee7772 100644
--- a/include/config_distro_bootcmd.h
+++ b/include/config_distro_bootcmd.h
@@ -88,7 +88,7 @@
@ -30,6 +30,18 @@ index 0e01e8240d..756ea121e0 100644
"if fdt addr ${fdt_addr_r}; then " \
"bootefi ${kernel_addr_r} ${fdt_addr_r};" \
"else " \
@@ -136,9 +136,9 @@
"fi;" \
"done;" \
"if test -e ${devtype} ${devnum}:${distro_bootpart} " \
- "efi/boot/"BOOTEFI_NAME"; then " \
+ "efi/fedora/"BOOTEFI_NAME"; then " \
"echo Found EFI removable media binary " \
- "efi/boot/"BOOTEFI_NAME"; " \
+ "efi/fedora/"BOOTEFI_NAME"; " \
"run boot_efi_binary; " \
"echo EFI LOAD FAILED: continuing...; " \
"fi; " \
--
2.12.2
2.13.0