]> git.pld-linux.org Git - packages/uboot.git/blob - uboot.spec
add image for raspberry pi (arm64); rel 2
[packages/uboot.git] / uboot.spec
1 Summary:        Das U-Boot -- the Universal Boot Loader
2 Summary(pl.UTF-8):      Das U-Boot - uniwersalny bootloader
3 Name:           uboot
4 Version:        2023.07.02
5 Release:        2
6 License:        GPL v2
7 Group:          Applications/System
8 Source0:        https://ftp.denx.de/pub/u-boot/u-boot-%{version}.tar.bz2
9 # Source0-md5:  001a0c1ffedd9a6e8d7af915d4d68b02
10 Source1:        https://github.com/hardkernel/u-boot/archive/travis/odroidc4-189/odroid-189.tar.gz
11 # Source1-md5:  dd117b6180ad5c9abb3303b31e57e7b4
12 Patch0:         rpi-Enable-using-the-DT-provided-by-the-Raspberry-Pi.patch
13 Patch2:         odroid-n2-binutils-2.39.patch
14 Patch3:         hardkernel-uboot-gcc5.patch
15 Patch4:         hardkernel-uboot-werror.patch
16 Patch5:         hardkernel-uboot-arm_cross.patch
17 Patch6:         hardkernel-uboot-no_stdint.patch
18 Patch7:         hardkernel-uboot-x86_64_bin.patch
19 Patch8:         hardkernel-uboot-acs.patch
20 Patch9:         hardkernel-uboot-uboot_payload.patch
21 URL:            https://www.denx.de/wiki/U-Boot
22 BuildRequires:  bison
23 BuildRequires:  dtc
24 BuildRequires:  flex
25 BuildRequires:  gnutls-devel
26 BuildRequires:  libuuid-devel
27 BuildRequires:  openssl-devel
28 BuildRequires:  python3
29 BuildRequires:  python3-elftools
30 BuildRequires:  python3-libfdt
31 BuildRequires:  python3-modules
32 BuildRequires:  python3-setuptools
33 BuildRequires:  rpmbuild(macros) >= 2.007
34 %ifarch aarch64
35 BuildRequires:  arm-trusted-firmware-armv8
36 BuildRequires:  box64
37 BuildRequires:  crossarm-gcc
38 BuildRequires:  qemu-user
39 BuildConflicts: libfdt-devel
40 %endif
41 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42
43 %define         common_configs  tools-only
44
45 %ifarch %{armv6}
46 %define         arch_configs    qemu_arm rpi_0_w rpi_2
47 %endif
48 %ifarch %{armv7}
49 %define         arch_configs    qemu_arm rpi_2
50 %endif
51 %ifarch aarch64
52 %define         arch_configs    odroid-n2 pinebook-pro-rk3399 qemu_arm64 rpi_arm64
53 %endif
54 %ifarch %{ix86}
55 %define         arch_configs    qemu-x86
56 %endif
57 %ifarch %{x8664}
58 %define         arch_configs    qemu-x86_64
59 %endif
60
61 %define         configs %{common_configs} %{?arch_configs}
62
63 %define         rk3399_configs pinebook-pro-rk3399
64
65 %define         imagedir        %{_datadir}/uboot
66
67 %description
68 Das U-Boot (Universal Bootloader, German for "the submarine") is a
69 boot loader for a number of different computer architectures,
70 including PPC, ARM, AVR32, MIPS, x86, 68k, Nios, and MicroBlaze.
71
72 %description -l pl.UTF-8
73 Das U-Boot (Universal Bootloader lub "łódź podwodna" po niemiecku) to
74 bootloader dla wielu różnych architektur komputerów, w tym PPC, ARM,
75 AVR32, MIPS, x86, 68k, Nios i MicroBlaze.
76
77 %package image-odroid-n2
78 Summary:        U-Boot firmware images for Odroid N2/N2+
79 Summary(pl.UTF-8):      Obrazy firmware'u U-Boot dla urządzeń Odroid N2/N2+
80 Group:          Applications/System
81 Requires:       %{name} = %{version}-%{release}
82
83 %description image-odroid-n2
84 U-Boot firmware images for Odroid N2/N2+.
85
86 %description image-odroid-n2 -l pl.UTF-8
87 Obrazy firmware'u U-Boot dla urządzeń Odroid N2/N2+.
88
89 %package image-pinebook-pro
90 Summary:        U-Boot firmware images for Pinebook Pro
91 Summary(pl.UTF-8):      Obrazy firmware'u U-Boot dla urządzeń Pinebook Pro
92 Group:          Applications/System
93 Requires:       %{name} = %{version}-%{release}
94
95 %description image-pinebook-pro
96 U-Boot firmware images for Pinebook Pro.
97
98 %description image-pinebook-pro -l pl.UTF-8
99 Obrazy firmware'u U-Boot dla urządzeń Pinebook Pro.
100
101 %package image-qemu
102 Summary:        U-Boot firmware images for QEMU
103 Summary(pl.UTF-8):      Obrazy firmware'u U-Boot dla QEMU
104 Group:          Applications/System
105 Requires:       %{name} = %{version}-%{release}
106
107 %description image-qemu
108 U-Boot firmware images for QEMU.
109
110 %description image-qemu -l pl.UTF-8
111 Obrazy firmware'u U-Boot dla QEMU.
112
113 %package image-raspberry-pi-arm64
114 Summary:        U-Boot firmware image for 64-bit Raspberry Pi boards
115 Summary(pl.UTF-8):      Obrazy firmware'u U-Boot dla 64-bitowych urządzeń Raspberry Pi
116 Group:          Applications/System
117 Requires:       %{name} = %{version}-%{release}
118
119 %description image-raspberry-pi-arm64
120 U-Boot firmware image for 64-bit Raspberry Pi boards.
121
122 %description image-raspberry-pi-arm64 -l pl.UTF-8
123 Obrazy firmware'u U-Boot dla 64-bitowych urządzeń Raspberry Pi
124
125 %package image-raspberry-pi-2
126 Summary:        U-Boot firmware image for Raspberry Pi 2
127 Summary(pl.UTF-8):      Obrazy firmware'u U-Boot dla urządzeń Raspberry Pi 2
128 Group:          Applications/System
129 Requires:       %{name} = %{version}-%{release}
130
131 %description image-raspberry-pi-2
132 U-Boot firmware image for Raspberry Pi 2.
133
134 %description image-raspberry-pi-2 -l pl.UTF-8
135 Obrazy firmware'u U-Boot dla urządzeń Raspberry Pi 2.
136
137 %package image-raspberry-pi-zero
138 Summary:        U-Boot firmware image for Raspberry Pi Zero
139 Summary(pl.UTF-8):      Obrazy firmware'u U-Boot dla urządzeń Raspberry Pi Zero
140 Group:          Applications/System
141 Requires:       %{name} = %{version}-%{release}
142
143 %description image-raspberry-pi-zero
144 U-Boot firmware image for Raspberry Pi Zero.
145
146 %description image-raspberry-pi-zero -l pl.UTF-8
147 Obrazy firmware'u U-Boot dla urządzeń Raspberry Pi Zero.
148
149 %package mkimage
150 Summary:        Generate kernel image for U-Boot
151 Summary(pl.UTF-8):      Generowanie obrazu jądra dla U-Boota
152 Group:          Applications/System
153
154 %description mkimage
155 This package contains the mkimage utility, which encapsulates a
156 compressed "uImage" Linux kernel image with header information, CRC32
157 checksum, etc., for use with the U-Boot bootloader.
158
159 mkimage can also be used to create ramdisk images for use with U-Boot,
160 either separated from the Linux kernel image, or combined into one
161 file. mkimage encapsulates the images with a 64 byte header containing
162 information about target architecture, operating system, image type,
163 compression method, entry points, time stamp, CRC32 checksums, etc.
164
165 %description mkimage -l pl.UTF-8
166 Ten pakiet zawiera narzędzie mkimage, łączące skompresowany obraz
167 jądra Linuksa "uImage" w nagłówkiem, sumą kontrolną CRC32 itp. do
168 wykorzystania przez bootloader U-Boot.
169
170 mkimage może być używane także do tworzenia obrazów ramdysków do
171 wykorzystania przez U-Boota - osobnych w stosunku do obrazu jądra lub
172 połączonych w jeden plik. mkimage obudowuje obrazy w 64-bajtowy
173 nagłówek zawierający informacje o architekturze docelowej, systemie
174 operacyjnym, rodzaju obrazu, metodzie kompresji, punktach wejściowych,
175 czasie utworzenia, sumach kontrolnych CRC32 itp.
176
177 %prep
178 %setup -q -n u-boot-%{version}
179 %ifarch %{arm} aarch64
180 %patch0 -p1
181 %endif
182 %ifarch aarch64
183 install -d build/hardkernel-uboot-odroid
184 tar xf %{SOURCE1} -C build/hardkernel-uboot-odroid
185 mv build/hardkernel-uboot-odroid/u-boot*/* build/hardkernel-uboot-odroid
186 cd build/hardkernel-uboot-odroid
187 %patch2 -p1
188 %patch3 -p1
189 %patch4 -p1
190 %patch5 -p1
191 %patch6 -p1
192 %patch7 -p1
193 %patch8 -p1
194 %patch9 -p1
195 cd ../..
196 %endif
197
198 %build
199 for config in %configs; do
200         if echo ' %rk3399_configs ' | grep -q " $config "; then
201                 mkdir -p build/$config
202                 cp -p /usr/share/arm-trusted-firmware/rk3399/* build/$config
203         fi
204         %{__make} ${config}_defconfig \
205                 CC="%{__cc}" \
206                 HOSTCC="%{__cc}" \
207                 STRIP=: \
208                 HOSTCFLAGS="%{rpmcflags}" \
209                 HOSTLDFLAGS="%{rpmldflags}" \
210                 V=1 \
211                 O=build/$config
212         %{__make} \
213                 $(test "$config" = "tools-only" && echo tools-only) \
214                 CC="%{__cc}" \
215                 HOSTCC="%{__cc}" \
216                 DTC=/usr/bin/dtc \
217                 STRIP=: \
218                 HOSTCFLAGS="%{rpmcflags}" \
219                 HOSTLDFLAGS="%{rpmldflags}" \
220                 V=1 \
221                 O=build/$config \
222                 BL31=bl31.elf
223 done
224 %ifarch aarch64
225 cd build/hardkernel-uboot-odroid
226 %{__make} odroidn2_defconfig \
227         V=1
228 %{__make} \
229         CROSS_COMPILE= \
230         ARM_CROSS_COMPILE=arm-linux-gnueabi- \
231         UBOOT_PAYLOAD=$(pwd)/../odroid-n2/u-boot.bin \
232         X86_64_DYNAMIC_WRAPPER=/usr/bin/box64 \
233         X86_64_STATIC_WRAPPER=/usr/bin/qemu-x86_64 \
234         V=1
235 cd ../..
236 %endif
237
238 %install
239 rm -rf $RPM_BUILD_ROOT
240 install -d $RPM_BUILD_ROOT{%{_bindir},%{imagedir}}
241
242 for config in %configs; do
243         if [ "$config" = "tools-only" ]; then
244                 install build/$config/tools/mkimage $RPM_BUILD_ROOT%{_bindir}
245         elif echo ' %rk3399_configs ' | grep -q " $config "; then
246                 install -d $RPM_BUILD_ROOT%{imagedir}/$config
247                 cp -p build/$config/{idbloader.img,u-boot.itb} $RPM_BUILD_ROOT%{imagedir}/$config
248         elif [ $config = "odroid-n2" ]; then
249                 install -d $RPM_BUILD_ROOT%{imagedir}/$config
250                 cp -p build/hardkernel-uboot-odroid/sd_fuse/u-boot.bin $RPM_BUILD_ROOT%{imagedir}/$config
251         else
252                 install -d $RPM_BUILD_ROOT%{imagedir}/$config
253                 cp -p build/$config/u-boot.bin $RPM_BUILD_ROOT%{imagedir}/$config
254         fi
255 done
256
257 %clean
258 rm -rf $RPM_BUILD_ROOT
259
260 %files
261 %defattr(644,root,root,755)
262 %doc MAINTAINERS README
263 %dir %{imagedir}
264
265 %ifarch aarch64
266 %files image-odroid-n2
267 %defattr(644,root,root,755)
268 %{imagedir}/odroid-n2
269
270 %files image-pinebook-pro
271 %defattr(644,root,root,755)
272 %{imagedir}/pinebook-pro-rk3399
273
274 %files image-qemu
275 %defattr(644,root,root,755)
276 %{imagedir}/qemu_arm64
277
278 %files image-raspberry-pi-arm64
279 %defattr(644,root,root,755)
280 %{imagedir}/rpi_arm64
281 %endif
282
283 %ifarch %{armv6} %{armv7}
284 %files image-qemu
285 %defattr(644,root,root,755)
286 %{imagedir}/qemu_arm
287
288 %files image-raspberry-pi-2
289 %defattr(644,root,root,755)
290 %{imagedir}/rpi_2
291 %endif
292
293 %ifarch %{armv6}
294 %files image-raspberry-pi-zero
295 %defattr(644,root,root,755)
296 %{imagedir}/rpi_0_w
297 %endif
298
299 %ifarch %{ix86}
300 %files image-qemu
301 %defattr(644,root,root,755)
302 %{imagedir}/qemu-x86
303 %endif
304
305 %ifarch %{x8664}
306 %files image-qemu
307 %defattr(644,root,root,755)
308 %{imagedir}/qemu-x86_64
309 %endif
310
311 %files mkimage
312 %defattr(644,root,root,755)
313 %attr(755,root,root) %{_bindir}/mkimage
This page took 0.113221 seconds and 3 git commands to generate.