blob: 70da3f051e237be8a14ed279a1119c63de7d56b4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
|
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer:
pkgname=grub
_ver=2.02~beta3
pkgver=2.02_beta3
pkgrel=5
pkgdesc="Bootloader with support for Linux, Multiboot and more"
url="https://www.gnu.org/software/grub/"
arch="all !armhf"
license="GPLv3+"
depends=""
depends_dev=""
makedepends="$depends_dev bison flex linux-headers xz-dev lvm2-dev
automake autoconf libtool python2 freetype-dev"
install=""
# strip handled by grub Makefiles, abuild strip breaks xen pv-grub
options="!strip"
subpackages="$pkgname-dev $pkgname-doc"
# currently grub only builds on x86*, aarch64 and ppc64le systems
case "$CARCH" in
x86) subpackages="$subpackages $pkgname-efi $pkgname-bios" ;;
x86_64) subpackages="$subpackages $pkgname-efi $pkgname-bios $pkgname-xenhost" ;;
aarch64) subpackages="$subpackages $pkgname-efi" ;;
ppc64le) subpackages="$subpackages $pkgname-ieee1275" ;;
esac
source="ftp://alpha.gnu.org/gnu/grub/grub-$_ver.tar.xz
2.02_beta3-gcc6-ld-no-pie.patch
fix-gcc-no-pie-specs.patch
grub2-accept-empty-module.patch
grub-xen-host_grub.cfg
2.02_beta3-mkconfig-alpine.patch
do-not-require-unifont-on-powerpc-ieee1275.patch
"
builddir="$srcdir/grub-$_ver"
_build_bios() {
msg "Building grub for platform BIOS"
cd $builddir/bios
./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--localstatedir=/var \
--disable-nls \
--disable-werror \
--with-platform=pc \
|| return 1
make || return 1
}
_build_efi() {
msg "Building grub for platform EFI"
cd $builddir/efi
./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--localstatedir=/var \
--disable-nls \
--disable-werror \
--with-platform=efi \
--disable-efiemu \
|| return 1
make || return 1
}
_build_xen() {
msg "Building grub for platform XEN"
cd $builddir/xen
./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--localstatedir=/var \
--disable-nls \
--disable-werror \
--with-platform=xen \
--target=$CARCH \
|| return 1
make || return 1
}
_build_ieee1275() {
msg "Building grub for platform IEEE1275"
cd $builddir/ieee1275
./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--localstatedir=/var \
--disable-nls \
--disable-werror \
--with-platform=ieee1275 \
|| return 1
make || return 1
}
build() {
cd "$builddir"
autoreconf -vif || return 1
cd "$srcdir"
tmpdir="$srcdir"/tmp
mv "$builddir" "$tmpdir"
mkdir "$builddir"
cp -r "$tmpdir" "$builddir"/bios
cp -r "$tmpdir" "$builddir"/efi
cp -r "$tmpdir" "$builddir"/xen
mv "$tmpdir" "$builddir"/ieee1275
case "$CARCH" in
x86)
_build_bios || return 1
_build_efi || return 1 ;;
x86_64)
_build_bios || return 1
_build_efi || return 1
_build_xen || return 1 ;;
aarch64)
_build_efi || return 1 ;;
ppc64le)
_build_ieee1275 || return 1 ;;
esac
}
_install_bios() {
cd "$builddir"/bios
make DESTDIR="$pkgdir" install-strip || return 1
}
_install_efi() {
cd "$builddir"/efi
make DESTDIR="$pkgdir" install-strip || return 1
}
_install_xen() {
cd "$builddir"/xen
grub_dir=`mktemp -d`
cfg=`mktemp`
grub_memdisk=`mktemp`
mkdir -p $grub_dir/boot/grub
echo 'normal (memdisk)/grub.cfg' > $cfg
sed -e "s/@@PVBOOT_ARCH@@/$CARCH/g" \
$srcdir/grub-xen-host_grub.cfg \
> $grub_dir/grub.cfg
tar -cf - -C $grub_dir grub.cfg > $grub_memdisk
./grub-mkimage \
-O $CARCH-xen \
-c $cfg \
-d ./grub-core ./grub-core/*.mod \
-m $grub_memdisk \
-o $pkgdir/grub-$CARCH-xen.bin
rm -r "$grub_dir"
rm "$cfg"
rm "$grub_memdisk"
}
_install_ieee1275() {
cd "$builddir"/ieee1275
make DESTDIR="$pkgdir" install-strip || return 1
}
package() {
# install BIOS & EFI version into the same directory
# and overwrite similar files.
case "$CARCH" in
x86)
_install_bios
_install_efi ;;
x86_64)
_install_bios
_install_efi
_install_xen ;;
aarch64)
_install_efi ;;
ppc64le)
_install_ieee1275 ;;
esac
rm -f "$pkgdir"/usr/lib/charset.alias
}
bios() {
pkgdesc="$pkgdesc (BIOS version)"
depends="$pkgname"
mkdir -p $subpkgdir/usr/lib/grub
mv $pkgdir/usr/lib/grub/*-pc $subpkgdir/usr/lib/grub/
}
efi() {
pkgdesc="$pkgdesc (EFI version)"
depends="$pkgname"
mkdir -p $subpkgdir/usr/lib/grub
mv $pkgdir/usr/lib/grub/*-efi $subpkgdir/usr/lib/grub/
}
xenhost() {
pkgdesc="$pkgdesc (XEN host version)"
mkdir -p $subpkgdir/usr/lib/grub-xen
mv $pkgdir/*-xen.bin $subpkgdir/usr/lib/grub-xen/
}
ieee1275() {
pkgdesc="$pkgdesc (IEEE1275 version)"
depends="$pkgname"
mkdir -p $subpkgdir/usr/lib/grub
mv $pkgdir/usr/lib/grub/*-ieee1275 $subpkgdir/usr/lib/grub/
}
sha512sums="4a530efef4dae45f4046cf3550563f14acb24d25cb88d5e06c93953ca5b1eec115118c6860233a9f627edcddae2571e5d6b867b70ff9dd5c184c9fef83ef7e11 grub-2.02~beta3.tar.xz
fc15c95bf26b28eee3b5a0d8e5fac538445179cea19a8657cd360e37dd5a95010ea2b899d1e4f3692b778a71f79526539ad1c741f028186f0daf135ee1678da0 2.02_beta3-gcc6-ld-no-pie.patch
b9eab870006ab7842e0af27171d3b66fea10835d3fd4e606f241a9898aa28bfc4c1cdf59cece8ad50d2e284a44cba74eb0f390ac29627518f86257a8d586976e fix-gcc-no-pie-specs.patch
098a1742aef131c85d63b934a9815879b991f2e73030cb90ac4b5dcd07d249fa0dd0a281e52ada0e10f05d59223493bd416eb47543242bf0ba336a0ebc9b2a1a grub2-accept-empty-module.patch
4e7394e0fff6772c89683039ccf81099ebbfe4f498e6df408977a1488fd59389b6e19afdbf0860ec271e2b2aea0df7216243dcc8235d1ca3af0e7f4d0a9d60a4 grub-xen-host_grub.cfg
5de7c1cc11640a3892447f0daa1e3fd1f67b0c474c8aec555e4e6315b5e6c00491ba02c88b420cec221da0640c6961d639f148746df14a0b2c15bda7989cd25c 2.02_beta3-mkconfig-alpine.patch
dde35771d15d85b1fde29454c24772f65acf4d7c1786e8bc05e159f7e9ef3437a5b6fa04e0d87342cdb90d4521fd88888a7853bb88bb0d659df5fb297e27c8a7 do-not-require-unifont-on-powerpc-ieee1275.patch"
|