95 lines
2.2 KiB
Bash
95 lines
2.2 KiB
Bash
#!/usr/bin/env bash
|
|
name='grub'
|
|
release='2'
|
|
version='2.12'
|
|
url='https://ftp.gnu.org/gnu/grub'
|
|
description='GNU GRand Unified Bootloader'
|
|
email='parduscix@yandex.ru'
|
|
maintainer='sulincix'
|
|
license=('GPLv3')
|
|
source=("https://ftp.gnu.org/gnu/grub/grub-$version.tar.xz")
|
|
depends=()
|
|
makedepends=()
|
|
md5sums=('60c564b1bdc39d8e43b3aab4bc0fb140')
|
|
group=(sys.boot)
|
|
uses=(efi bios)
|
|
uses_extra=(ia32)
|
|
arch=('x86_64')
|
|
dontstrip=1
|
|
efi_depends=(efibootmgr)
|
|
ia32_depends=(efibootmgr)
|
|
|
|
unset CFLAGS
|
|
unset CXXFLAGS
|
|
|
|
get_grub_opt(){
|
|
echo -n "--disable-efiemu "
|
|
if [[ "$1" == "efi" ]] ; then
|
|
echo -n "--with-platform=efi --target=x86_64"
|
|
elif [[ "$1" == "ia32" ]] ; then
|
|
echo -n "--with-platform=efi --target=i386"
|
|
elif [[ "$1" == "bios" ]] ; then
|
|
echo -n "--with-platform=pc"
|
|
fi
|
|
}
|
|
|
|
prepare(){
|
|
echo depends bli part_gpt > $name-$version/grub-core/extra_deps.lst
|
|
for tgt in ${uses[@]} ; do
|
|
if ! use $tgt ; then
|
|
continue
|
|
fi
|
|
cp -prfv $name-$version $tgt
|
|
done
|
|
}
|
|
|
|
setup(){
|
|
for tgt in ${uses[@]} ; do
|
|
if ! use $tgt ; then
|
|
continue
|
|
fi
|
|
cd $tgt
|
|
autoreconf -fvi
|
|
./configure --prefix=/usr \
|
|
--sysconfdir=/etc \
|
|
--libdir=/usr/lib64/ \
|
|
--disable-nls \
|
|
--disable-werror \
|
|
--disable-grub-themes \
|
|
$(get_grub_opt $tgt)
|
|
cd ..
|
|
done
|
|
}
|
|
|
|
build(){
|
|
for tgt in ${uses[@]} ; do
|
|
if ! use $tgt ; then
|
|
continue
|
|
fi
|
|
make $jobs -C $tgt
|
|
done
|
|
}
|
|
|
|
package(){
|
|
for tgt in ${uses[@]} ; do
|
|
if ! use $tgt ; then
|
|
continue
|
|
fi
|
|
make $jobs -C $tgt install
|
|
done
|
|
# default grub config
|
|
mkdir -p $DESTDIR/etc/default $DESTDIR/usr/bin/
|
|
{
|
|
echo 'GRUB_DISTRIBUTOR=""'
|
|
echo 'GRUB_TERMINAL_OUTPUT=console'
|
|
echo 'GRUB_CMDLINE_LINUX_DEFAULT="quiet"'
|
|
echo 'GRUB_CMDLINE_LINUX=""'
|
|
echo 'GRUB_DEFAULT=0'
|
|
echo 'GRUB_TIMEOUT=5'
|
|
echo 'GRUB_DISABLE_SUBMENU=y'
|
|
echo 'GRUB_DISABLE_OS_PROBER=true'
|
|
echo 'GRUB_DISABLE_RECOVERY=true'
|
|
} > $DESTDIR/etc/default/grub
|
|
echo "#!/bin/sh" > $DESTDIR/usr/bin/update-grub
|
|
echo "grub-mkconfig -o /boot/grub/grub.cfg" >> $DESTDIR/usr/bin/update-grub
|
|
} |