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