Accepting request 614464 from hardware👢staging

OBS-URL: https://build.opensuse.org/request/show/614464
OBS-URL: https://build.opensuse.org/package/show/hardware:boot/u-boot?expand=0&rev=20
This commit is contained in:
2018-06-07 06:57:52 +00:00
committed by Git OBS Bridge
parent cbaf4717e0
commit b823b5e083
148 changed files with 5292 additions and 2580 deletions

View File

@@ -18,6 +18,7 @@
#
%bcond_with uboot_atf
%bcond_with uboot_atf_pine64
%define mvebu_spl 0
@@ -29,9 +30,12 @@
%define imx6_spl 0
%define socfpga_spl 0
%if "rpi" == "rpi" || "rpi" == "rpi2" || "rpi" == "rpi332b" || "rpi" == "rpi3"
%if "rpi" == "rpi" || "rpi" == "rpi2" || "rpi" == "rpi3"
%define is_rpi 1
%endif
%if "rpi" == "evb-rk3399" || "rpi" == "firefly-rk3399" || "rpi" == "puma-rk3399"
%define is_rk3399 1
%endif
# archive_version differs from version for RC version only
%define archive_version 2018.05
@@ -58,28 +62,42 @@ Patch0007: 0007-tools-zynqmpimage-Move-defines-to-h.patch
Patch0008: 0008-MAINTAINERS-Declare-tools-zynq-.-c-.patch
Patch0009: 0009-tools-zynqmpimage-Add-bif-support.patch
Patch0010: 0010-tools-zynqmpbif-Add-support-for-loa.patch
Patch0011: 0011-rockchip-make_fit_atf-use-elf-entry.patch
Patch0012: 0012-rockchip-make_fit_atf-make-python3-.patch
Patch0013: 0013-rockchip-make_fit_atf.py-depends-on.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if "%{name}" == "u-boot-pine64plus" && %{with uboot_atf_pine64}
BuildRequires: arm-trusted-firmware-pine64
%endif
%if 0%{?is_rk3399} && %{with uboot_atf}
BuildRequires: arm-trusted-firmware-rk3399
%endif
BuildRequires: bc
# Arndale board needs DTC >= 1.4
BuildRequires: dtc >= 1.4.0
# u-boot-clearfog (tools/kwbimage.c) needs openssl to build
BuildRequires: libopenssl-devel
BuildRequires: python-devel
%if %{with uboot_atf}
%if "%{name}" == "u-boot-evb-rk3399" || "%{name}" == "u-boot-firefly-rk3399"
# make_fit_atf.py
BuildRequires: python-pyelftools
%endif
%endif
BuildRequires: swig
%if "%{name}" == "u-boot-qemu-ppce500"
# Owns /usr/share/qemu directory
BuildRequires: qemu
Provides: qemu-ppc:%{_datadir}/qemu/u-boot.e500
%endif
%if 0%{?is_rpi}
# Owns /boot/vc directory
BuildRequires: raspberrypi-firmware
%endif
%if "%{name}" == "u-boot-zynqmp"
BuildRequires: zynqmp-dts
%endif
%if 0%{?is_rpi}
# Owns /boot/vc directory
BuildRequires: raspberrypi-firmware
# For mountpoint
Requires(post): util-linux
%endif
@@ -115,6 +133,9 @@ This package contains documentation for U-Boot firmware.
%patch0008 -p1
%patch0009 -p1
%patch0010 -p1
%patch0011 -p1
%patch0012 -p1
%patch0013 -p1
%build
export SOURCE_DATE_EPOCH=$(date -d "$(head -n 2 %{_sourcedir}/%{name}.changes | tail -n 1 | cut -d- -f1 )" +%s)
@@ -122,10 +143,21 @@ export SOURCE_DATE_EPOCH=$(date -d "$(head -n 2 %{_sourcedir}/%{name}.changes |
export BL31=/boot/bl31.bin
%endif
%if %{with uboot_atf}
%if "%{name}" == "u-boot-evb-rk3399" || "%{name}" == "u-boot-firefly-rk3399"
cp /usr/share/arm-trusted-firmware-rk3399/bl31.elf .
%endif
%endif
make %{?_smp_mflags} CROSS_COMPILE= HOSTCFLAGS="$RPM_OPT_FLAGS" rpi_defconfig
echo "Attempting to enable fdt apply command (.dtbo) support."
echo "CONFIG_OF_LIBFDT_OVERLAY=y" >> .config
make %{?_smp_mflags} CROSS_COMPILE= HOSTCFLAGS="$RPM_OPT_FLAGS" USE_PRIVATE_LIBGG=yes
make %{?_smp_mflags} CROSS_COMPILE= HOSTCFLAGS="$RPM_OPT_FLAGS" \
%if ("%{name}" == "u-boot-evb-rk3399" || "%{name}" == "u-boot-firefly-rk3399") && %{with uboot_atf}
all u-boot.itb
%else
all
%endif
%ifarch aarch64
%if %sunxi_spl == 1
@@ -169,6 +201,9 @@ for f in u-boot u-boot.bin u-boot.dtb u-boot-dtb.bin; do
done
%else
install -D -m 0644 u-boot.bin %{buildroot}%{uboot_dir}/u-boot.bin
%if ("%{name}" == "u-boot-evb-rk3399" || "%{name}" == "u-boot-firefly-rk3399") && %{with uboot_atf}
install -D -m 0644 u-boot.itb %{buildroot}%{uboot_dir}/u-boot.itb
%endif
%if "%{name}" == "u-boot-qemu-ppce500"
mv %{buildroot}%{uboot_dir}/u-boot.bin %{buildroot}%{uboot_dir}/u-boot.e500
%endif
@@ -203,6 +238,9 @@ install -D -m 0644 SPL %{buildroot}%{uboot_dir}/imx6-spl.bin
%if %socfpga_spl == 1
install -D -m 0644 u-boot-with-spl.sfp %{buildroot}%{uboot_dir}/u-boot-with-spl.sfp
%endif
%if "%{name}" == "u-boot-rpi3"
echo -e "# Boot in AArch64 mode\narm_control=0x200" > %{buildroot}%{uboot_dir}/ubootconfig.txt
%endif
%if 0%{?is_rpi}
%post
@@ -213,14 +251,18 @@ install -D -m 0644 u-boot-with-spl.sfp %{buildroot}%{uboot_dir}/u-boot-with-spl.
# c) Mounted as /boot/efi, with /boot/vc as symlink, then nothing to be done.
# d) Mounted as /boot/efi, with /boot/vc a directory, then copy files over.
if mountpoint -q /boot/efi; then
[[ "$(readlink -f /boot/efi)" -ef "$(readlink -f %{uboot_dir})" ]] || cp %{uboot_dir}/u-boot.bin /boot/efi/
if ! [[ "$(readlink -f /boot/efi)" -ef "$(readlink -f %{uboot_dir})" ]]; then
[ -f %{uboot_dir}/ubootconfig.txt ] && cp %{uboot_dir}/ubootconfig.txt /boot/efi
cp %{uboot_dir}/u-boot.bin /boot/efi/
fi
fi
%endif
%files
%defattr(-,root,root)
%license Licenses/gpl-2.0.txt
%doc README
%{uboot_dir}/*
%doc Licenses/gpl-2.0.txt README
%files doc
%defattr(-,root,root)