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