4 Summary: Das U-Boot - Tizen bootloader
7 ExclusiveArch: %{arm} aarch64
8 URL: http://git.denx.de/u-boot.git
9 Source0: %{name}-%{version}.tar.bz2
10 Source1001: u_boot.manifest
12 BuildRequires: gcc >= 4.8
17 u-boot - Tizen bootloader for Embedded boards based on ARM processor
19 #TODO: Describe rpm package information depending on board
20 %package -n u-boot-pkg
21 Summary: A bootloader for Embedded system
24 %description -n u-boot-pkg
25 A boot loader for embedded systems.
26 Das U-Boot is a cross-platform bootloader for embedded systems,
27 used as the default boot loader by several board vendors. It is
28 intended to be easy to port and to debug, and runs on many
29 supported architectures, including PPC, ARM, MIPS, x86, m68k, NIOS,
32 %package -n u-boot-tools
33 Summary: Companion tools for Das U-Boot bootloader
37 %description -n u-boot-tools
38 This package includes the mkimage program, which allows generation of U-Boot
39 images in various formats, and the fw_printenv and fw_setenv programs to read
40 and modify U-Boot's environment.
43 %global use_mmc_storage 1
47 %define tool tools-only
53 %setup -q -n %{name}-%{version}
58 CONFIG=tizen_defconfig
63 make HOSTCC="gcc $RPM_OPT_FLAGS" -C tools/dtc
69 make %{?_smp_mflags} HOSTCC="gcc $RPM_OPT_FLAGS" HOSTSTRIP=/bin/true %{tool}
71 %if 1%{?use_mmc_storage}
72 make HOSTCC="gcc $RPM_OPT_FLAGS" CONFIG_ENV_IS_IN_MMC=y env
74 make HOSTCC="gcc $RPM_OPT_FLAGS" env
79 export PATH="$PATH:tools:tools/dtc/"
80 make %{?_smp_mflags} EXTRAVERSION=`echo %{vcs} | sed 's/.*u-boot.*#\(.\{9\}\).*/-g\1-TIZEN.org/'`
82 # Prepare proper dtb image: cat u-boot-nodtb.bin multi.dtb > u-boot-multi.bin
83 chmod 755 tools/mkimage_multidtb.sh
84 mkimage_multidtb.sh u-boot-nodtb.bin
86 # Sign u-boot-multi.bin - output is: u-boot-mmc.bin
87 chmod 755 tools/mkimage_signed.sh
88 mkimage_signed.sh u-boot-multi.bin $CONFIG
91 cp `find . -name "env_common.o"` copy_env_common.o
92 objcopy -O binary --only-section=.rodata.default_environment `find . -name "copy_env_common.o"`
93 tr '\0' '\n' < copy_env_common.o > default_envs.txt
94 mkenvimage -s 16384 -o params.bin default_envs.txt
95 rm copy_env_common.o default_envs.txt
102 mkdir -p %{buildroot}%{_bindir}
103 install -p -m 0755 tools/mkimage %{buildroot}%{_bindir}
104 install -p -m 0755 tools/env/fw_printenv %{buildroot}%{_bindir}
105 install -p -m 0755 tools/dtc/dtc %{buildroot}%{_bindir}
106 ( cd %{buildroot}%{_bindir}; ln -sf fw_printenv fw_setenv )
108 # u-boot installation
110 mkdir -p %{buildroot}/var/tmp/u-boot
111 install -d %{buildroot}/var/tmp/u-boot
112 install -m 755 u-boot.bin %{buildroot}/var/tmp/u-boot
113 install -m 755 u-boot-mmc.bin %{buildroot}/var/tmp/u-boot
114 install -m 755 params.bin %{buildroot}/var/tmp/u-boot
121 %manifest u_boot.manifest
122 %defattr(-,root,root,-)
126 %files -n u-boot-tools
127 %manifest u_boot.manifest
128 %defattr(-,root,root,-)
130 %{_bindir}/fw_printenv