summaryrefslogtreecommitdiffstats
path: root/source/a/grub/grub.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/a/grub/grub.SlackBuild')
-rwxr-xr-xsource/a/grub/grub.SlackBuild43
1 files changed, 24 insertions, 19 deletions
diff --git a/source/a/grub/grub.SlackBuild b/source/a/grub/grub.SlackBuild
index ba7ecd8b1..5bd18cdb7 100755
--- a/source/a/grub/grub.SlackBuild
+++ b/source/a/grub/grub.SlackBuild
@@ -1,6 +1,6 @@
-#!/bin/sh
+#!/bin/bash
-# Copyright 2013, 2016 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2013, 2016, 2017, 2018 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,9 +22,13 @@
# Modified 2016 by Eric Hameleers <alien@slackware.com> for Slackware Live Edition.
+cd $(dirname $0) ; CWD=$(pwd)
+
PKGNAM=grub
-VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-5}
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.xz | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+# Better to use _ than ~ in the package filenames version:
+PKGVER=$(echo $VERSION | tr '~' '_')
+BUILD=${BUILD:-2}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -37,6 +41,14 @@ if [ -z "$ARCH" ]; then
export ARCH
fi
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PKGNAM-$PKGVER-$ARCH-$BUILD.txz"
+ exit 0
+fi
+
NUMJOBS=${NUMJOBS:-" -j7 "}
if [ "$ARCH" = "i386" ]; then
@@ -70,7 +82,6 @@ else
LIBDIRSUFFIX=""
fi
-CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-$PKGNAM
@@ -79,8 +90,8 @@ mkdir -p $TMP $PKG
cd $TMP
rm -rf $PKGNAM-$VERSION
-tar xvf $CWD/$PKGNAM-$VERSION.tar.?z* || exit 1
-cd $PKGNAM-$VERSION
+tar xvf $CWD/$PKGNAM-$VERSION.tar.xz || exit 1
+cd $PKGNAM-$VERSION || exit 1
chown -R root:root .
find . \
@@ -92,15 +103,9 @@ find . \
# Use /boot/initrd.gz as a valid initrd name:
zcat $CWD/initrd_naming.patch | patch -p1 --verbose || exit 1
-# Patch for recent glibc:
-zcat $CWD/txtHRnXiHYUrM.txt.gz | patch -p0 --verbose || exit 1
-
# Support DejaVuSansMono font (dejavusansmono.pf2) by default:
zcat $CWD/grub.dejavusansmono.gfxterm.font.diff.gz | patch -p1 --verbose || exit 1
-# Terminate EFI several times. This is a workaround for broken UEFI firmware.
-zcat $CWD/grub.e75fdee420a7ad95e9a465c9699adc2e2e970440.terminate.efi.several.times.diff.gz | patch -p1 --verbose || exit 1
-
# Fix security issue when reading username and password:
zcat $CWD/0001-Fix-CVE-2015-8370-Grub2-user-pass-vulnerability.patch.gz | patch -p1 --verbose || exit 1
@@ -116,10 +121,10 @@ build_grub() {
--infodir=/usr/info \
--mandir=/usr/man \
--disable-werror \
- $EFI_DO
+ $EFI_DO || exit 1
# Build and install:
- make clean
+ make clean || exit 1
make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG || exit 1
@@ -129,13 +134,13 @@ build_grub() {
# Build 32bit and 64bit efi targets if requested:
if [ -n "$EFI32_FLAGS" ]; then
- build_grub $EFI32_FLAGS
+ build_grub $EFI32_FLAGS || exit 1
fi
if [ -n "$EFI_FLAGS" ]; then
- build_grub $EFI_FLAGS
+ build_grub $EFI_FLAGS || exit 1
fi
# Always end with regular build:
-build_grub
+build_grub || exit 1
# Preserve the contents of /etc/grub.d/40_custom:
mv $PKG/etc/grub.d/40_custom $PKG/etc/grub.d/40_custom.new
@@ -212,5 +217,5 @@ zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
-/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
+/sbin/makepkg -l y -c n $TMP/$PKGNAM-$PKGVER-$ARCH-$BUILD.txz