uboot-tools/uboot-tools.spec

321 lines
10 KiB
RPMSpec
Raw Normal View History

%global _default_patch_fuzz 2
2021-04-12 17:09:46 +08:00
%global with_armv8 1
2020-01-17 10:30:02 +08:00
Name: uboot-tools
Version: 2024.01
Release: 2
2020-01-17 10:30:02 +08:00
Summary: tools for U-Boot
2022-05-11 14:12:51 +08:00
License: GPL-2.0-or-later and Public Domain and GPL-2.0-only
2020-01-17 10:30:02 +08:00
URL: http://www.denx.de/wiki/U-Boot
2020-12-16 14:45:57 +08:00
Source0: https://ftp.denx.de/pub/u-boot/u-boot-%{version}.tar.bz2
Source1: aarch64-boards
Source2: 10-devicetree.install
Patch1: backport-uefi-distro-load-FDT-from-any-partition-on-boot-device.patch
Patch2: backport-disable-VBE-by-default.patch
Patch3: backport-Provide-a-fallback-to-smbios-tables.patch
Patch4: backport-enable-bootmenu-by-default.patch
Patch5: backport-uefi-Boot-var-automatic-management-for-removable-medias.patch
Patch6: backport-rockchip-Add-initial-support-for-the-PinePhone-Pro.patch
Patch7: backport-CVE-2024-57254.patch
Patch8: backport-CVE-2024-57255.patch
Patch9: backport-CVE-2024-57256.patch
Patch10: backport-CVE-2024-57257.patch
Patch11: backport-0001-CVE-2024-57258.patch
Patch12: backport-0002-CVE-2024-57258.patch
Patch13: backport-0003-CVE-2024-57258.patch
Patch14: backport-CVE-2024-57259.patch
2021-07-21 14:37:40 +08:00
BuildRequires: bc dtc gcc make flex bison git-core openssl-devel
BuildRequires: python3-unversioned-command python3-devel python3-setuptools
BuildRequires: python3-libfdt python3-pyelftools SDL2-devel swig
BuildRequires: perl gnutls-devel ncurses-devel libuuid-devel
# this required when /usr/bin/python link to python3
BuildRequires: python3-devel
2021-04-12 17:09:46 +08:00
%if %{with_armv8}
2019-11-06 19:54:55 +08:00
%ifarch aarch64
BuildRequires: arm-trusted-firmware-armv8
BuildRequires: python3-pyelftools
2019-11-06 19:54:55 +08:00
%endif
2021-04-12 17:09:46 +08:00
%endif
2019-11-06 19:54:55 +08:00
Requires: dtc systemd
%description
This package includes the mkimage program, which allows generation of U-Boot
images in various formats, and the fw_printenv and fw_setenv programs to read
and modify U-Boot's environment.
2021-04-12 17:09:46 +08:00
%if %{with_armv8}
2019-11-06 19:54:55 +08:00
%ifarch aarch64
%package -n uboot-images-armv8
Summary: u-boot bootloader images for aarch64 boards
Requires: uboot-tools
BuildArch: noarch
%description -n uboot-images-armv8
u-boot bootloader images for aarch64 boards
%endif
%ifarch %{arm}
%package -n uboot-images-armv7
Summary: u-boot bootloader images for armv7 boards
Requires: uboot-tools
BuildArch: noarch
%description -n uboot-images-armv7
u-boot bootloader images for armv7 boards
%endif
%ifarch %{arm} aarch64
%package -n uboot-images-elf
Summary: u-boot bootloader images for armv7 boards
Requires: uboot-tools
Obsoletes: uboot-images-qemu < %{version}-%{release}
Provides: uboot-images-qemu = %{version}-%{release}
2019-11-06 19:54:55 +08:00
%description -n uboot-images-elf
u-boot bootloader ELF images for use with qemu and other platforms
%endif
2021-04-12 17:09:46 +08:00
%endif
2019-11-06 19:54:55 +08:00
%package_help
%prep
%autosetup -p1 -n u-boot-%{version}
cp %SOURCE1 .
2019-11-06 19:54:55 +08:00
%build
mkdir builds
%make_build HOSTCC="gcc $RPM_OPT_FLAGS" CROSS_COMPILE="" tools-only_defconfig O=builds/
%make_build HOSTCC="gcc $RPM_OPT_FLAGS" CROSS_COMPILE="" tools-all O=builds/
2021-04-12 17:09:46 +08:00
%if %{with_armv8}
2019-11-06 19:54:55 +08:00
%ifarch aarch64 %{arm}
for board in $(cat %{_arch}-boards)
do
echo "Building board: $board"
2020-01-15 03:39:26 +08:00
if [[ " ${rk3399[*]} " == *" $board "* ]]; then
echo "Board: $board skipping"
continue
fi
2019-11-06 19:54:55 +08:00
mkdir builds/$(echo $board)/
sun50i=(a64-olinuxino amarula_a64_relic bananapi_m2_plus_h5 bananapi_m64 libretech_all_h3_cc_h5 nanopi_neo2 nanopi_neo_plus2 orangepi_pc2 orangepi_prime orangepi_win orangepi_zero_plus orangepi_zero_plus2 pine64-lts pine64_plus pinebook pinephone pinetab sopine_baseboard teres_i)
2019-11-06 19:54:55 +08:00
if [[ " ${sun50i[*]} " == *" $board "* ]]; then
echo "Board: $board using sun50i_a64"
cp /usr/share/arm-trusted-firmware/sun50i_a64/* builds/$(echo $board)/
fi
sun50h6=(orangepi_lite2 orangepi_one_plus pine_h64)
if [[ " ${sun50h6[*]} " == *" $board "* ]]; then
2019-11-06 19:54:55 +08:00
echo "Board: $board using sun50i_h6"
cp /usr/share/arm-trusted-firmware/sun50i_h6/* builds/$(echo $board)/
fi
rk3328=(evb-rk3328 rock64-rk3328)
if [[ " ${rk3328[*]} " == *" $board "* ]]; then
echo "Board: $board using rk3328"
cp /usr/share/arm-trusted-firmware/rk3328/* builds/$(echo $board)/
fi
rk3399=(evb-rk3399 ficus-rk3399 khadas-edge-captain-rk3399 khadas-edge-v-rk3399 khadas-edge-rk3399 nanopc-t4-rk3399 nanopi-m4-rk3399 nanopi-neo4-rk3399 orangepi-rk3399 pinebook-pro-rk3399 puma-rk3399 rock960-rk3399 rock-pi-4-rk3399 rockpro64-rk3399 roc-pc-rk3399)
2019-11-06 19:54:55 +08:00
if [[ " ${rk3399[*]} " == *" $board "* ]]; then
echo "Board: $board using rk3399"
cp /usr/share/arm-trusted-firmware/rk3399/* builds/$(echo $board)/
fi
# End ATF
BINMAN_ALLOW_MISSING=1 make $(echo $board)_defconfig O=builds/$(echo $board)/
BINMAN_ALLOW_MISSING=1 %make_build HOSTCC="gcc $RPM_OPT_FLAGS" CROSS_COMPILE="" O=builds/$(echo $board)/
2019-11-06 19:54:55 +08:00
done
%endif
2021-04-12 17:09:46 +08:00
%endif
2019-11-06 19:54:55 +08:00
%install
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_sysconfdir}
mkdir -p %{buildroot}%{_mandir}/man1
mkdir -p %{buildroot}%{_datadir}/uboot/
2021-04-12 17:09:46 +08:00
%if %{with_armv8}
2019-11-06 19:54:55 +08:00
%ifarch aarch64
for board in $(cat %{_arch}-boards)
do
mkdir -p %{buildroot}%{_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
do
if [ -f builds/$(echo $board)/$(echo $file) ]; then
install -p -m 0644 builds/$(echo $board)/$(echo $file) %{buildroot}%{_datadir}/uboot/$(echo $board)/
fi
done
done
%endif
%ifarch %{arm}
for board in $(cat %{_arch}-boards)
do
mkdir -p %{buildroot}%{_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) %{buildroot}%{_datadir}/uboot/$(echo $board)/
fi
done
done
for board in $(cat %{_arch}-boards)
do
if [ -f %{buildroot}%{_datadir}/uboot/$(echo $board)/u-boot-sunxi-with-spl.bin ]; then
rm -f %{buildroot}%{_datadir}/uboot/$(echo $board)/u-boot.*
fi
if [ -f %{buildroot}%{_datadir}/uboot/$(echo $board)/MLO ]; then
rm -f %{buildroot}%{_datadir}/uboot/$(echo $board)/u-boot.bin
fi
if [ -f %{buildroot}%{_datadir}/uboot/$(echo $board)/SPL ]; then
rm -f %{buildroot}%{_datadir}/uboot/$(echo $board)/u-boot.bin
fi
if [ -f %{buildroot}%{_datadir}/uboot/$(echo $board)/u-boot.imx ]; then
rm -f %{buildroot}%{_datadir}/uboot/$(echo $board)/u-boot.bin
fi
done
%endif
2021-04-12 17:09:46 +08:00
%endif
2019-11-06 19:54:55 +08:00
for tool in dumpimage env/fw_printenv fit_check_sign fit_info gdb/gdbcont gdb/gdbsend gen_eth_addr gen_ethaddr_crc ifwitool img2srec kwboot mkeficapsule mkenvimage mkimage mksunxiboot ncb proftool sunxi-spl-image-builder
2019-11-06 19:54:55 +08:00
do
install -p -m 0755 builds/tools/$tool %{buildroot}%{_bindir}
done
install -p -m 0644 doc/mkimage.1 %{buildroot}%{_mandir}/man1
install -p -m 0755 builds/tools/env/fw_printenv %{buildroot}%{_bindir}
( cd %{buildroot}%{_bindir}; ln -sf fw_printenv fw_setenv )
install -p -m 0644 tools/env/fw_env.config %{buildroot}%{_sysconfdir}
mkdir -p %{buildroot}/lib/kernel/install.d/
install -p -m 0755 %{SOURCE2} %{buildroot}/lib/kernel/install.d/
2019-11-06 19:54:55 +08:00
%files
%defattr(-,root,root)
%doc README
%{_bindir}/*
/lib/kernel/install.d/10-devicetree.install
%dir %{_datadir}/uboot/
%config(noreplace) %{_sysconfdir}/fw_env.config
2021-04-12 17:09:46 +08:00
%if %{with_armv8}
2019-11-06 19:54:55 +08:00
%ifarch aarch64
%files -n uboot-images-armv8
%defattr(-,root,root)
%{_datadir}/uboot/*
%endif
%ifarch %{arm}
%files -n uboot-images-armv7
%defattr(-,root,root)
%{_datadir}/uboot/*
%endif
%ifarch %{arm} aarch64
%files -n uboot-images-elf
%defattr(-,root,root)
%endif
2021-04-12 17:09:46 +08:00
%endif
2019-11-06 19:54:55 +08:00
%files help
%doc README doc/develop/distro.rst doc/README.gpt
%doc doc/develop/uefi doc/usage doc/arch/arm64.rst
%{_mandir}/man1/mkimage.1*
2019-11-06 19:54:55 +08:00
%changelog
* Wed Feb 19 2025 lingsheng <lingsheng1@h-partners.com> - 2024.01-2
- fix CVE-2024-57254 CVE-2024-57255 CVE-2024-57256 CVE-2024-57257 CVE-2024-57258 CVE-2024-57259
* Thu Feb 29 2024 xingwei <xingwei14@h-partners.com> - 2024.01-1
- Type:requirement
- ID:NA
- SUG:NA
- update to 2024.01
2022-09-28 08:17:36 +00:00
* Wed Sep 28 2022 zhouwenpei <zhouwenpei1@h-partners.com> - 2021.10-7
- fix CVE-2022-30767
2022-07-26 22:07:09 +08:00
* Wed Jul 20 2022 cenhuilin <cenhuilin@kylinos.cn> - 2021.10-6
- fix CVE-2022-33967
2022-07-12 10:17:50 +08:00
* Tue Jul 12 2022 zhouwenpei <zhouwenpei1@h-partners.com> - 2021.10-5
- fix CVE-2022-34835
2022-05-11 14:12:51 +08:00
* Wed May 11 2022 liuyumeng <liuyumeng5@h-partners.com> - 2021.10-4
- fix license error
2022-05-07 16:21:26 +08:00
* Sat May 07 2022 liuyumeng <liuyumeng5@h-partners.com> - 2021.10-3
- fix license error
2022-04-13 11:30:26 +08:00
* Wed Apr 13 2022 yangcheng <yangcheng87@h-partners.com> - 2021.10-2
- Add perl buildrequires to resolve compilation error
2021-12-06 18:08:31 +08:00
* Mon Dec 6 2021 yangcheng <yangcheng87@huawei.com> - 2021.10-1
- Upgrade to 2021.10
2021-07-21 14:37:40 +08:00
* Wed Jul 21 2021 yushaogui <yushaogui@huawei.com> - 2020.07-7
- Delete a Buildrequires for gdb
2021-04-12 17:09:46 +08:00
* Mon Apr 19 2021 liuyumeng <liuyumeng@huawei.com> - 2020.07-6
- Compilation optimzation
2021-03-16 20:44:51 +08:00
* Tue Mar 16 2021 yanglu <yanglu@60huawei.com> - 2020.07-5
- Type:cves
- ID:CVE-2021-27097 CVE-2021-27138
- SUG:NA
- DESC:fix CVE-2021-27097CVE-2021-27138
2020-12-16 14:45:57 +08:00
* Wed Dec 16 2020 zhanzhimin <zhanzhimin@huawei.com> - 2020.07-4
- Update Source0
* Wed Oct 21 2020 jinzhimin <jinzhimin2@huawei.com> - 2020.07-3
- modify buildrequire to python3-unversioned-command
2020-09-10 17:12:20 +08:00
* Tue Sep 10 2020 chengguipeng<chengguipeng1@huawei.com> - 2020.07-2
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:modify source0 url
* Fri Jul 31 2020 chengguipeng<chengguipeng1@huawei.com> 2020.07-1
- Upgrade to 2020.07-1
2020-06-19 15:39:34 +08:00
* Fri Jun 19 2020 zhujunhao <zhujunhao8@huawei.com> - 2018.09-9
- drop python2 requires
2020-03-20 12:07:29 +08:00
* Fri Mar 20 2020 songnannan <songnannan2@huawei.com> - 2018.09-8
- add gdb in buildrequires
* Sat Feb 29 2020 hexiujun <hexiujun1@huawei.com> - 2018.09-7
- Type:enhancement
- ID:NA
- SUG:NA
- DESC: compatible with python3 compile environment
2020-01-17 10:22:42 +08:00
* Fri Jan 17 2020 Tianfei <tianfei16@huawei.com> - 2018.09-6
- Type:bugfix
- ID:NA
- SUG:NA
- DESC: delete patch
2020-01-15 03:39:26 +08:00
* Tue Jan 14 2020 openEuler Buildteam <buildteam@openeuler.org> - 2018.09-5
- Type:bugfix
- Id:NA
- SUG:NA
- DESC:close 3399
2019-11-06 19:54:55 +08:00
* Fri Oct 25 2019 openEuler Buildteam <buildteam@openeuler.org> - 2018.09-4
- Type:bugfix
- Id:NA
- SUG:NA
- DESC:add the README files to the main package
* Sat Oct 12 2019 openEuler Buildteam <buildteam@openeuler.org> - 2018.09-3
- Package init