From 425556543d7a4d535d73f6778389c0424a5f60d1 Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Tue, 2 May 2023 13:09:13 +0900 Subject: [PATCH] packaging: Add u-boot-visionfive2 spec file Add u-boot-visionfive2 spec file. Change-Id: I2d3f0fb2c3865779299a3ba2a3e03ae626d5e6eb Signed-off-by: Jaehoon Chung --- packaging/u-boot-visionfive2.spec | 102 ++++++++++++++++++++++++++++++++++ packaging/u_boot_visionfive2.manifest | 5 ++ 2 files changed, 107 insertions(+) create mode 100644 packaging/u-boot-visionfive2.spec create mode 100644 packaging/u_boot_visionfive2.manifest diff --git a/packaging/u-boot-visionfive2.spec b/packaging/u-boot-visionfive2.spec new file mode 100644 index 0000000..f796df0 --- /dev/null +++ b/packaging/u-boot-visionfive2.spec @@ -0,0 +1,102 @@ +Name: u-boot-visionfive2 +Version: 2022.10 +Release: 0 +Summary: Das U-Boot - Tizen bootloader +Group: System/Kernel +License: GPL-2.0+ +ExclusiveArch: riscv64 +URL: https://source.denx.de/u-boot/u-boot.git +Source0: u-boot-%{version}.tar.bz2 +Source1001: u_boot_visionfive2.manifest + +BuildRequires: gcc >= 6.0 +BuildRequires: bc +BuildRequires: flex +BuildRequires: bison +BuildRequires: libopenssl1.1-devel +BuildRequires: opensbi +BuildRequires: python3-devel +BuildRequires: swig +BuildRequires: python3-setuptools + +%description +u-boot - Tizen bootloader for visionfive2 boards based + +%package -n u-boot-tools +Summary: Companion tools for Das U-Boot bootloader +Group: System/Kernel + +%description -n u-boot-tools +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. + +%prep +%setup -q -n u-boot-%{version} + +%build +%{?asan:/usr/bin/gcc-unforce-options} +cp %{SOURCE1001} . + +CONFIG=tizen_starfive_visionfive2_defconfig + +make mrproper + +# Set configuration +make $CONFIG + +# Build tools +make %{?_smp_mflags} HOSTCC="gcc $RPM_OPT_FLAGS" HOSTSTRIP=/bin/true tools + +make HOSTCC="gcc $RPM_OPT_FLAGS" envtools + +# Build Starfive SPL tool and Create SPL Image +cd tools/starfive/spl_tool +make +cd - + +# Build u-boot +export PATH="$PATH:tools" +make OPENSBI=/platform/generic/firmware/fw_dynamic.bin %{?_smp_mflags} EXTRAVERSION=`echo %{vcs} | sed 's/.*u-boot.*#\(.\{9\}\).*/-g\1-TIZEN.org/'` + +# Build SPL TOOL of StarFive +tools/starfive/spl_tool/spl_tool -c -f spl/u-boot-spl.bin + +# Generate uboot.env +./scripts/get_default_envs.sh > default_envs.txt +mkenvimage -s 16384 -o uboot.env default_envs.txt +rm default_envs.txt + +%install +rm -rf %{buildroot} + +# Tools installation +mkdir -p %{buildroot}%{_bindir} +install -p -m 0755 tools/mkimage %{buildroot}%{_bindir} +install -p -m 0755 tools/env/fw_printenv %{buildroot}%{_bindir} +install -p -m 0755 scripts/dtc/dtc %{buildroot}%{_bindir} +( cd %{buildroot}%{_bindir}; ln -sf fw_printenv fw_setenv ) + +# u-boot installation +mkdir -p %{buildroot}/boot +mkdir -p %{buildroot}/var/tmp +install -m 755 u-boot.itb %{buildroot}/var/tmp/ +install -m 755 uboot.env %{buildroot}/boot/ +install -m 755 spl/u-boot-spl.bin.normal.out %{buildroot}/var/tmp/ + +%clean + +%files +%manifest u_boot_visionfive2.manifest +%defattr(-,root,root,-) +/var/tmp/u-boot.itb +/var/tmp/u-boot-spl.bin.normal.out +/boot/uboot.env + +%files -n u-boot-tools +%manifest u_boot_visionfive2.manifest +%defattr(-,root,root,-) +%{_bindir}/mkimage +%{_bindir}/fw_printenv +%{_bindir}/fw_setenv +%{_bindir}/dtc diff --git a/packaging/u_boot_visionfive2.manifest b/packaging/u_boot_visionfive2.manifest new file mode 100644 index 0000000..017d22d --- /dev/null +++ b/packaging/u_boot_visionfive2.manifest @@ -0,0 +1,5 @@ + + + + + -- 2.7.4