2019-08-10 19:38:27 -06:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
|
|
|
# Grub is built in a function so the script argument needs to be stored.
|
|
|
|
pkg_dir=$1
|
|
|
|
|
|
|
|
# Change naming from GNU/Linux to Linux.
|
|
|
|
sed 's|GNU/Linux|Linux|' -i grub/util/grub.d/10_linux.in
|
|
|
|
|
|
|
|
build_grub() (
|
|
|
|
cp -R grub "grub-${1##*=}"
|
|
|
|
cd "grub-${1##*=}"
|
|
|
|
|
2019-08-14 10:59:12 -06:00
|
|
|
autoreconf
|
2019-08-10 19:38:27 -06:00
|
|
|
|
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
|
|
|
--sbindir=/usr/bin \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--disable-nls \
|
|
|
|
--disable-werror \
|
2019-08-17 20:18:05 -06:00
|
|
|
--disable-grub-mkfont \
|
|
|
|
--disable-grub-mount \
|
2019-08-10 19:38:27 -06:00
|
|
|
"$@"
|
|
|
|
|
|
|
|
make
|
|
|
|
make DESTDIR="$pkg_dir" install
|
|
|
|
)
|
|
|
|
|
|
|
|
build_grub --with-platform=pc
|
|
|
|
build_grub --with-platform=efi --disable-efiemu
|
|
|
|
|
|
|
|
# Install /etc/default/grub (used by grub-mkconfig).
|
|
|
|
install -Dm0644 grub.default "$1/etc/default/grub"
|
|
|
|
|
|
|
|
# Remove gdb debugging files.
|
|
|
|
(
|
|
|
|
cd "$pkg_dir"
|
|
|
|
rm -f usr/lib/grub/*/*.module
|
|
|
|
rm -f usr/lib/grub/*/*.image
|
|
|
|
rm -f usr/lib/grub/*/kernel.exec
|
|
|
|
rm -f usr/lib/grub/*/gdb_grub
|
|
|
|
rm -f usr/lib/grub/*/gmodule.pl
|
|
|
|
rm -f usr/lib/charset.alias
|
|
|
|
) ||:
|
|
|
|
|
|
|
|
# Remove unneedded file by musl
|
|
|
|
rm -f "$1/usr/lib/charset.alias"
|