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