2019-08-10 19:38:27 -06:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
2020-03-05 10:17:42 -07:00
|
|
|
# Grub expects Python but it isn't actually needed. Give
|
|
|
|
# it something fake so that configure passes.
|
|
|
|
export PYTHON=/bin/true
|
|
|
|
|
|
|
|
# Disable the post-python mv calls as a means of disabling
|
|
|
|
# the Python tooling. The /bin/true above will create a
|
|
|
|
# blank file, this prevents the blank file from overwriting
|
|
|
|
# the existing one.
|
2021-07-03 14:22:55 -06:00
|
|
|
for f in ./*/Makefile.in; do
|
|
|
|
sed 's/mv $@.new $@/:/g' "$f" > _
|
|
|
|
mv -f _ "$f"
|
|
|
|
done
|
2020-03-05 10:17:42 -07:00
|
|
|
|
2020-02-11 09:55:35 -07:00
|
|
|
# Strip '-march' from 'CFLAGS' as per advice from upstream.
|
|
|
|
# Fixes build fails on specific hardware.
|
2020-09-13 13:16:06 -06:00
|
|
|
CFLAGS=$(printf %s "$CFLAGS" | sed 's/-march=[^ ]*//g')
|
|
|
|
CFLAGS=$(printf %s "$CXXFLAGS" | sed 's/-march=[^ ]*//g')
|
2020-02-11 09:55:35 -07:00
|
|
|
|
2019-08-10 19:38:27 -06:00
|
|
|
build_grub() (
|
|
|
|
cd "grub-${1##*=}"
|
|
|
|
|
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
|
|
|
--sbindir=/usr/bin \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--disable-werror \
|
2020-03-05 09:39:48 -07:00
|
|
|
--disable-nls \
|
2019-08-17 20:18:05 -06:00
|
|
|
--disable-grub-mkfont \
|
|
|
|
--disable-grub-mount \
|
2019-08-10 19:38:27 -06:00
|
|
|
"$@"
|
|
|
|
|
|
|
|
make
|
2021-07-15 03:16:05 -06:00
|
|
|
make install
|
2019-08-10 19:38:27 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
build_grub --with-platform=pc
|
|
|
|
build_grub --with-platform=efi --disable-efiemu
|
|
|
|
|
2021-07-01 10:17:07 -06:00
|
|
|
mkdir -p "$1/etc/default"
|
|
|
|
cp -f grub.default "$1/etc/default/grub"
|
2019-08-10 19:38:27 -06:00
|
|
|
|
|
|
|
# Remove gdb debugging files.
|
|
|
|
(
|
2021-07-15 06:19:33 -06:00
|
|
|
cd "$1/usr/lib"
|
2019-09-07 09:14:04 -06:00
|
|
|
|
|
|
|
rm -f grub/*/*.module
|
|
|
|
rm -f grub/*/*.image
|
|
|
|
rm -f grub/*/kernel.exec
|
|
|
|
rm -f grub/*/gdb_grub
|
|
|
|
rm -f grub/*/gmodule.pl
|
|
|
|
)
|