aboutsummaryrefslogtreecommitdiff
path: root/core/grub/build
diff options
context:
space:
mode:
authorCem Keylan <cem@ckyln.com>2019-12-09 19:17:24 +0300
committerCem Keylan <cem@ckyln.com>2019-12-09 19:17:24 +0300
commit03423e0583057cbe5a16f8439183e2dbc0e8dd7c (patch)
tree81fe3ba69d94146f83fb5541d1fb2da0ac4eac08 /core/grub/build
downloadrepository-03423e0583057cbe5a16f8439183e2dbc0e8dd7c.tar.gz
secondary commit
Diffstat (limited to 'core/grub/build')
-rwxr-xr-xcore/grub/build38
1 files changed, 38 insertions, 0 deletions
diff --git a/core/grub/build b/core/grub/build
new file mode 100755
index 00000000..d0cee821
--- /dev/null
+++ b/core/grub/build
@@ -0,0 +1,38 @@
+#!/bin/sh -e
+
+# Grub is built in a function so the script argument needs to be stored.
+pkg_dir=$1
+
+build_grub() (
+ cp -a grub "grub-${1##*=}"
+ cd "grub-${1##*=}"
+
+ ./configure \
+ --prefix=/usr \
+ --sbindir=/usr/bin \
+ --sysconfdir=/etc \
+ --disable-werror \
+ --disable-grub-mkfont \
+ --disable-grub-mount \
+ "$@"
+
+ 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/usr/lib"
+
+ rm -f grub/*/*.module
+ rm -f grub/*/*.image
+ rm -f grub/*/kernel.exec
+ rm -f grub/*/gdb_grub
+ rm -f grub/*/gmodule.pl
+)