Name: u-boot Version: 2020.10 Release: 0 Summary: Das U-Boot - Tizen bootloader Group: System/Kernel License: GPL-2.0+ ExclusiveArch: %{arm} URL: https://source.denx.de/u-boot/u-boot.git Source0: %{name}-%{version}.tar.bz2 Source1001: u_boot.manifest BuildRequires: gcc >= 6.0 BuildRequires: flex BuildRequires: bison %description u-boot - Tizen bootloader for Embedded boards based on ARM processor #TODO: Describe rpm package information depending on board %package -n u-boot-pkg Summary: A bootloader for Embedded system Group: System/Kernel %description -n u-boot-pkg A boot loader for embedded systems. Das U-Boot is a cross-platform bootloader for embedded systems, used as the default boot loader by several board vendors. It is intended to be easy to port and to debug, and runs on many supported architectures, including PPC, ARM, MIPS, x86, m68k, NIOS, and Microblaze. %ifarch %{arm} %global use_mmc_storage 1 %endif %prep %setup -q -n %{name}-%{version} %build %{?asan:/usr/bin/gcc-unforce-options} cp %{SOURCE1001} . CONFIG=tizen_defconfig make mrproper # Build dtc make HOSTCC="gcc $RPM_OPT_FLAGS" -C tools/dtc # Set configuration make $CONFIG # Build tools make %{?_smp_mflags} HOSTCC="gcc $RPM_OPT_FLAGS" HOSTSTRIP=/bin/true tools %if 1%{?use_mmc_storage} make HOSTCC="gcc $RPM_OPT_FLAGS" CONFIG_ENV_IS_IN_MMC=y envtools %else make HOSTCC="gcc $RPM_OPT_FLAGS" envtools %endif # Build u-boot export PATH="$PATH:tools:tools/dtc/" make %{?_smp_mflags} EXTRAVERSION=`echo %{vcs} | sed 's/.*u-boot.*#\(.\{9\}\).*/-g\1-TIZEN.org/'` # Prepare proper dtb image: cat u-boot-nodtb.bin multi.dtb > u-boot-multi.bin chmod 755 tools/mkimage_multidtb.sh mkimage_multidtb.sh u-boot-nodtb.bin # Sign u-boot-multi.bin - output is: u-boot-mmc.bin chmod 755 tools/mkimage_signed.sh mkimage_signed.sh u-boot-multi.bin $CONFIG # Generate params.bin cp `find ./env -name "built-in.o"` copy_env_common.o objcopy -O binary --only-section=.rodata.default_environment `find . -name "copy_env_common.o"` tr '\0' '\n' < copy_env_common.o > default_envs.txt mkenvimage -s 16384 -o params.bin default_envs.txt rm copy_env_common.o default_envs.txt %install rm -rf %{buildroot} # u-boot installation mkdir -p %{buildroot}/var/tmp/u-boot install -d %{buildroot}/var/tmp/u-boot install -m 755 u-boot.bin %{buildroot}/var/tmp/u-boot install -m 755 u-boot-mmc.bin %{buildroot}/var/tmp/u-boot install -m 755 params.bin %{buildroot}/var/tmp/u-boot %clean %files %manifest u_boot.manifest %defattr(-,root,root,-) /var/tmp/u-boot