2
0
mirror of https://codeberg.org/kiss-community/repo synced 2024-12-25 16:50:07 -07:00
repo/core/grub/build

50 lines
1.1 KiB
Plaintext
Raw Normal View History

2019-06-19 00:59:59 -06:00
#!/bin/sh -e
2019-06-25 11:35:19 -06:00
(cd grub
patch -p1 < 0008-Fix-packed-not-aligned-error-on-GCC-8.patch
patch -p1 < grub-2.02-relocation_fix-1.patch)
2019-06-19 05:09:49 -06:00
# Grub is built in a function so the script argument needs to be stored.
pkg_dir=$1
2019-07-17 07:21:30 -06:00
# Change naming from GNU/Linux to Linux.
sed 's|GNU/Linux|Linux|' -i grub/util/grub.d/10_linux.in
2019-06-19 05:09:49 -06:00
build_grub() (
cp -R grub "grub-${1##*=}"
cd "grub-${1##*=}"
2019-06-25 11:24:29 -06:00
autoreconf -fi
2019-06-19 05:09:49 -06:00
./configure \
--prefix=/usr \
--sbindir=/usr/bin \
2019-07-17 07:28:45 -06:00
--sysconfdir=/etc \
2019-06-19 05:09:49 -06:00
--disable-nls \
--disable-werror \
"$@"
make
make DESTDIR="$pkg_dir" install
)
build_grub --with-platform=pc
build_grub --with-platform=efi --disable-efiemu
2019-06-19 05:22:35 -06:00
2019-07-17 07:21:30 -06:00
# Install /etc/default/grub (used by grub-mkconfig).
install -Dm0644 grub.default "$1/etc/default/grub"
2019-06-19 05:22:35 -06:00
# 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
2019-06-25 08:06:59 -06:00
rm -f usr/lib/charset.alias
2019-06-19 05:22:35 -06:00
) ||:
2019-07-17 07:21:30 -06:00
# Remove unneedded file by musl
rm -f "$1/usr/lib/charset.alias"