]> git.pld-linux.org Git - packages/uboot.git/blob - uboot.spec
fix for emmc boot on rk3399
[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:        2021.10
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:  f1392080facf59dd2c34096a5fd95d4c
10 Patch0:         rpi-Enable-using-the-DT-provided-by-the-Raspberry-Pi.patch
11 Patch1:         %{name}-pbp_usb_hang.patch
12 Patch2:         rk3399-emmc.patch
13 URL:            https://www.denx.de/wiki/U-Boot
14 %ifarch aarch64
15 BuildRequires:  arm-trusted-firmware-armv8
16 %endif
17 BuildRequires:  bison
18 BuildRequires:  dtc
19 BuildRequires:  flex
20 BuildRequires:  openssl-devel
21 BuildRequires:  rpmbuild(macros) >= 2.007
22 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23
24 %define         common_configs  tools-only
25
26 %ifarch %{armv6}
27 %define         arch_configs    rpi_0_w rpi_2
28 %endif
29 %ifarch %{armv7}
30 %define         arch_configs    rpi_2
31 %endif
32 %ifarch aarch64
33 %define         arch_configs    pinebook-pro-rk3399
34 %endif
35
36 %define         configs %{common_configs} %{?arch_configs}
37
38 %define         rk3399_configs pinebook-pro-rk3399
39
40 %define         imagedir        %{_datadir}/uboot
41
42 %description
43 Das U-Boot (Universal Bootloader, German for "the submarine") is a
44 boot loader for a number of different computer architectures,
45 including PPC, ARM, AVR32, MIPS, x86, 68k, Nios, and MicroBlaze.
46
47 %description -l pl.UTF-8
48 Das U-Boot (Universal Bootloader lub "łódź podwodna" po niemiecku) to
49 bootloader dla wielu różnych architektur komputerów, w tym PPC, ARM,
50 AVR32, MIPS, x86, 68k, Nios i MicroBlaze.
51
52 %package image-pinebook-pro
53 Summary:        U-Boot firmware images for Pinebook Pro
54 Summary(pl.UTF-8):      Obrazy firmware'u U-Boot dla urządzeń Pinebook Pro
55 Group:          Applications/System
56
57 %description image-pinebook-pro
58 U-Boot firmware images for Pinebook Pro.
59
60 %description image-pinebook-pro -l pl.UTF-8
61 Obrazy firmware'u U-Boot dla urządzeń Pinebook Pro.
62
63 %package image-raspberry-pi-2
64 Summary:        U-Boot firmware image for Raspberry Pi 2
65 Summary(pl.UTF-8):      Obrazy firmware'u U-Boot dla urządzeń Raspberry Pi 2
66 Group:          Applications/System
67
68 %description image-raspberry-pi-2
69 U-Boot firmware image for Raspberry Pi 2.
70
71 %description image-raspberry-pi-2 -l pl.UTF-8
72 Obrazy firmware'u U-Boot dla urządzeń Raspberry Pi 2.
73
74 %package image-raspberry-pi-zero
75 Summary:        U-Boot firmware image for Raspberry Pi Zero
76 Summary(pl.UTF-8):      Obrazy firmware'u U-Boot dla urządzeń Raspberry Pi Zero
77 Group:          Applications/System
78
79 %description image-raspberry-pi-zero
80 U-Boot firmware image for Raspberry Pi Zero.
81
82 %description image-raspberry-pi-zero -l pl.UTF-8
83 Obrazy firmware'u U-Boot dla urządzeń Raspberry Pi Zero.
84
85 %package mkimage
86 Summary:        Generate kernel image for U-Boot
87 Summary(pl.UTF-8):      Generowanie obrazu jądra dla U-Boota
88 Group:          Applications/System
89
90 %description mkimage
91 This package contains the mkimage utility, which encapsulates a
92 compressed "uImage" Linux kernel image with header information, CRC32
93 checksum, etc., for use with the U-Boot bootloader.
94
95 mkimage can also be used to create ramdisk images for use with U-Boot,
96 either separated from the Linux kernel image, or combined into one
97 file. mkimage encapsulates the images with a 64 byte header containing
98 information about target architecture, operating system, image type,
99 compression method, entry points, time stamp, CRC32 checksums, etc.
100
101 %description mkimage -l pl.UTF-8
102 Ten pakiet zawiera narzędzie mkimage, łączące skompresowany obraz
103 jądra Linuksa "uImage" w nagłówkiem, sumą kontrolną CRC32 itp. do
104 wykorzystania przez bootloader U-Boot.
105
106 mkimage może być używane także do tworzenia obrazów ramdysków do
107 wykorzystania przez U-Boota - osobnych w stosunku do obrazu jądra lub
108 połączonych w jeden plik. mkimage obudowuje obrazy w 64-bajtowy
109 nagłówek zawierający informacje o architekturze docelowej, systemie
110 operacyjnym, rodzaju obrazu, metodzie kompresji, punktach wejściowych,
111 czasie utworzenia, sumach kontrolnych CRC32 itp.
112
113 %prep
114 %setup -q -n u-boot-%{version}
115 %ifarch %{arm} aarch64
116 %patch0 -p1
117 %endif
118 %ifarch aarch64
119 %patch1 -p1
120 %patch2 -p1
121 %endif
122
123 %build
124 for config in %configs; do
125         if echo ' %rk3399_configs ' | grep -q " $config "; then
126                 mkdir -p build/$config
127                 cp -p /usr/share/arm-trusted-firmware/rk3399/* build/$config
128         fi
129         %{__make} ${config}_defconfig \
130                 CC="%{__cc}" \
131                 HOSTCC="%{__cc}" \
132                 STRIP=: \
133                 HOSTCFLAGS="%{rpmcflags}" \
134                 HOSTLDFLAGS="%{rpmldflags}" \
135                 V=1 \
136                 O=build/$config
137         %{__make} \
138                 $(test "$config" = "tools-only" && echo tools-only) \
139                 CC="%{__cc}" \
140                 HOSTCC="%{__cc}" \
141                 STRIP=: \
142                 HOSTCFLAGS="%{rpmcflags}" \
143                 HOSTLDFLAGS="%{rpmldflags}" \
144                 V=1 \
145                 O=build/$config
146 done
147
148 %install
149 rm -rf $RPM_BUILD_ROOT
150 install -d $RPM_BUILD_ROOT{%{_bindir},%{imagedir}}
151
152 for config in %configs; do
153         if [ "$config" = "tools-only" ]; then
154                 install build/$config/tools/mkimage $RPM_BUILD_ROOT%{_bindir}
155         elif echo ' %rk3399_configs ' | grep -q " $config "; then
156                 install -d $RPM_BUILD_ROOT%{imagedir}/$config
157                 cp -p build/$config/{idbloader.img,u-boot.itb} $RPM_BUILD_ROOT%{imagedir}/$config
158         else
159                 install -d $RPM_BUILD_ROOT%{imagedir}/$config
160                 cp -p build/$config/u-boot.bin $RPM_BUILD_ROOT%{imagedir}/$config
161         fi
162 done
163
164 %clean
165 rm -rf $RPM_BUILD_ROOT
166
167 %files
168 %defattr(644,root,root,755)
169 %doc MAINTAINERS README
170 %dir %{imagedir}
171
172 %ifarch aarch64
173 %files image-pinebook-pro
174 %defattr(644,root,root,755)
175 %{imagedir}/pinebook-pro-rk3399
176 %endif
177
178 %ifarch %{armv6} %{armv7}
179 %files image-raspberry-pi-2
180 %defattr(644,root,root,755)
181 %{imagedir}/rpi_2
182 %endif
183
184 %ifarch %{armv6}
185 %files image-raspberry-pi-zero
186 %defattr(644,root,root,755)
187 %{imagedir}/rpi_0_w
188 %endif
189
190 %files mkimage
191 %defattr(644,root,root,755)
192 %attr(755,root,root) %{_bindir}/mkimage
This page took 0.062001 seconds and 3 git commands to generate.