summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libre/grub/PKGBUILD130
-rw-r--r--libre/grub/grub-10_linux-rebrand-free-distros.patch28
2 files changed, 129 insertions, 29 deletions
diff --git a/libre/grub/PKGBUILD b/libre/grub/PKGBUILD
index f105a8932..213e7dee0 100644
--- a/libre/grub/PKGBUILD
+++ b/libre/grub/PKGBUILD
@@ -1,9 +1,15 @@
# Maintainer (Arch): Tobias Powalowski <tpowa@archlinux.org>
# Maintainer (Arch): Ronald van Haren <ronald.archlinux.org>
-# Contributor (Arch): Keshav Padram Amburay <(the ddoott ridikulus ddoott rat) (aatt) (gemmaeiil) (ddoott) (ccoomm)>
+# Contributor (Arch): Keshav Amburay <(the ddoott ridikulus ddoott rat) (aatt) (gemmaeiil) (ddoott) (ccoomm)>
# Maintainer: André Silva <emulatorman@parabola.nu>
# Contributor: Márcio Silva <coadde@parabola.nu>
+## "1" to enable IA32-EFI build in Arch x86_64, "0" to disable
+_IA32_EFI_IN_ARCH_X64="1"
+
+## "1" to enable EMU build, "0" to disable
+_GRUB_EMU_BUILD="0"
+
_pkgver="2.02"
_GRUB_GIT_TAG="grub-2.02-beta2"
@@ -12,10 +18,13 @@ _UNIFONT_VER="6.3.20131217"
[[ "${CARCH}" == "x86_64" ]] && _EFI_ARCH="x86_64"
[[ "${CARCH}" == "i686" ]] && _EFI_ARCH="i386"
+[[ "${CARCH}" == "x86_64" ]] && _EMU_ARCH="x86_64"
+[[ "${CARCH}" == "i686" ]] && _EMU_ARCH="i386"
+
pkgname="grub"
pkgdesc="GNU GRand Unified Bootloader (2), (Parabola rebranded)"
pkgver=2.02.beta2
-pkgrel=3.1
+pkgrel=4
epoch="1"
url="https://www.gnu.org/software/grub/"
arch=('x86_64' 'i686')
@@ -24,9 +33,9 @@ backup=('etc/default/grub' 'etc/grub.d/40_custom')
install="${pkgname}.install"
options=('!makeflags')
-conflicts=('grub-common' 'grub-bios' "grub-efi-${_EFI_ARCH}" 'grub-legacy')
-replaces=('grub-common' 'grub-bios' "grub-efi-${_EFI_ARCH}")
-provides=('grub-common' 'grub-bios' "grub-efi-${_EFI_ARCH}")
+conflicts=('grub-common' 'grub-bios' 'grub-emu' "grub-efi-${_EFI_ARCH}" 'grub-legacy')
+replaces=('grub-common' 'grub-bios' 'grub-emu' "grub-efi-${_EFI_ARCH}")
+provides=('grub-common' 'grub-bios' 'grub-emu' "grub-efi-${_EFI_ARCH}")
makedepends=('git' 'rsync' 'xz' 'freetype2' 'ttf-dejavu' 'python' 'autogen'
'texinfo' 'help2man' 'gettext' 'device-mapper' 'fuse')
@@ -39,12 +48,18 @@ optdepends=('freetype2: For grub-mkfont usage'
'os-prober: To detect other OSes when generating grub.cfg in BIOS systems'
'mtools: For grub-mkrescue FAT FS support')
+if [[ "${_GRUB_EMU_BUILD}" == "1" ]]; then
+ makedepends+=('libusbx' 'sdl')
+ optdepends+=('libusbx: For grub-emu USB support'
+ 'sdl: For grub-emu SDL support')
+fi
+
source=("grub-${_pkgver}::git+git://git.sv.gnu.org/grub.git#tag=${_GRUB_GIT_TAG}"
"grub-extras::git+git://git.sv.gnu.org/grub-extras.git#branch=master"
"http://ftp.gnu.org/gnu/unifont/unifont-${_UNIFONT_VER}/unifont-${_UNIFONT_VER}.bdf.gz"
"http://ftp.gnu.org/gnu/unifont/unifont-${_UNIFONT_VER}/unifont-${_UNIFONT_VER}.bdf.gz.sig"
+ 'grub-10_linux-detect-parabola-initramfs.patch'
'grub-add-GRUB_COLOR_variables.patch'
- '09_parabola'
'60_memtest86+'
'grub.default'
'grub-10_linux-rebrand-free-distros.patch')
@@ -53,11 +68,11 @@ md5sums=('SKIP'
'SKIP'
'728b7439ac733a7c0d56049adec364c7'
'SKIP'
+ '945527e0de8d384166a4cf23439ae9ee'
'e506ae4a9f9f7d1b765febfa84e10d48'
- '9f67330f2979a153acb32af706e0c094'
'be55eabc102f2c60b38ed35c203686d6'
'8d1dd54ae4a1b550c097e056892ce953'
- 'b23a144b7001c88734b79ed3bec491c4')
+ 'c8ac993bc9c0fe288c177a20630ccc46')
_pkgver() {
cd "${srcdir}/grub-${_pkgver}/"
@@ -68,6 +83,10 @@ prepare() {
cd "${srcdir}/grub-${_pkgver}/"
+ msg "Patch to detect of Parabola GNU/Linux-libre initramfs images by grub-mkconfig"
+ patch -Np1 -i "${srcdir}/grub-10_linux-detect-parabola-initramfs.patch"
+ echo
+
msg "Patch to enable GRUB_COLOR_* variables in grub-mkconfig"
## Based on http://lists.gnu.org/archive/html/grub-devel/2012-02/msg00021.html
patch -Np1 -i "${srcdir}/grub-add-GRUB_COLOR_variables.patch"
@@ -211,6 +230,57 @@ _build_grub-efi() {
}
+_build_grub-emu() {
+
+ msg "Copy the source for building the emu part"
+ cp -r "${srcdir}/grub-${_pkgver}/" "${srcdir}/grub-${_pkgver}-emu/"
+
+ msg "Unset all compiler FLAGS for emu build"
+ unset CFLAGS
+ unset CPPFLAGS
+ unset CXXFLAGS
+ unset LDFLAGS
+ unset MAKEFLAGS
+
+ cd "${srcdir}/grub-${_pkgver}-emu/"
+
+ msg "Run autogen.sh for emu build"
+ ./autogen.sh
+ echo
+
+ msg "Run ./configure for emu build"
+ ./configure \
+ --with-platform="emu" \
+ --target="${_EMU_ARCH}" \
+ --enable-mm-debug \
+ --enable-nls \
+ --enable-device-mapper \
+ --enable-cache-stats \
+ --enable-grub-mkfont \
+ --enable-grub-mount \
+ --enable-grub-emu-usb=no \
+ --enable-grub-emu-sdl=no \
+ --disable-grub-emu-pci \
+ --prefix="/usr" \
+ --bindir="/usr/bin" \
+ --sbindir="/usr/bin" \
+ --mandir="/usr/share/man" \
+ --infodir="/usr/share/info" \
+ --datarootdir="/usr/share" \
+ --sysconfdir="/etc" \
+ --program-prefix="" \
+ --with-bootdir="/boot" \
+ --with-grubdir="grub" \
+ --disable-silent-rules \
+ --disable-werror
+ echo
+
+ msg "Run make for emu build"
+ make
+ echo
+
+}
+
build() {
cd "${srcdir}/grub-${_pkgver}/"
@@ -223,6 +293,18 @@ build() {
_build_grub-efi
echo
+ if [[ "${CARCH}" == "x86_64" ]] && [[ "${_IA32_EFI_IN_ARCH_X64}" == "1" ]]; then
+ msg "Build grub i386 efi stuff"
+ _EFI_ARCH="i386" _build_grub-efi
+ echo
+ fi
+
+ if [[ "${_GRUB_EMU_BUILD}" == "1" ]]; then
+ msg "Build grub emu stuff"
+ _build_grub-emu
+ echo
+ fi
+
}
_package_grub-common_and_bios() {
@@ -237,9 +319,6 @@ _package_grub-common_and_bios() {
rm -f "${pkgdir}/usr/lib/grub/i386-pc"/*.module || true
rm -f "${pkgdir}/usr/lib/grub/i386-pc"/*.image || true
rm -f "${pkgdir}/usr/lib/grub/i386-pc"/{kernel.exec,gdb_grub,gmodule.pl} || true
-
- msg "Install 09_parabola helper script for grub-mkconfig"
- install -D -m0755 "${srcdir}/09_parabola" "${pkgdir}/etc/grub.d/09_parabola"
msg "Install extra /etc/grub.d/ files"
install -D -m0755 "${srcdir}/60_memtest86+" "${pkgdir}/etc/grub.d/60_memtest86+"
@@ -265,11 +344,40 @@ _package_grub-efi() {
}
+_package_grub-emu() {
+
+ cd "${srcdir}/grub-${_pkgver}-emu/"
+
+ msg "Run make install for emu build"
+ make DESTDIR="${pkgdir}/" bashcompletiondir="/usr/share/bash-completion/completions" install
+ echo
+
+ msg "Remove gdb debugging related files for emu build"
+ rm -f "${pkgdir}/usr/lib/grub/${_EMU_ARCH}-emu"/*.module || true
+ rm -f "${pkgdir}/usr/lib/grub/${_EMU_ARCH}-emu"/*.image || true
+ rm -f "${pkgdir}/usr/lib/grub/${_EMU_ARCH}-emu"/{kernel.exec,gdb_grub,gmodule.pl} || true
+
+}
+
package() {
+ cd "${srcdir}/grub-${_pkgver}/"
+
msg "Package grub ${_EFI_ARCH} efi stuff"
_package_grub-efi
+ if [[ "${CARCH}" == "x86_64" ]] && [[ "${_IA32_EFI_IN_ARCH_X64}" == "1" ]]; then
+ msg "Package grub i386 efi stuff"
+ _EFI_ARCH="i386" _package_grub-efi
+ echo
+ fi
+
+ if [[ "${_GRUB_EMU_BUILD}" == "1" ]]; then
+ msg "Package grub emu stuff"
+ _package_grub-emu
+ echo
+ fi
+
msg "Package grub bios stuff"
_package_grub-common_and_bios
diff --git a/libre/grub/grub-10_linux-rebrand-free-distros.patch b/libre/grub/grub-10_linux-rebrand-free-distros.patch
index c9285e699..7edb22a1f 100644
--- a/libre/grub/grub-10_linux-rebrand-free-distros.patch
+++ b/libre/grub/grub-10_linux-rebrand-free-distros.patch
@@ -1,27 +1,19 @@
-diff -Nur grub.orig/util/grub.d/10_linux.in grub/util/grub.d/10_linux.in
---- grub.orig/util/grub.d/10_linux.in 2014-01-11 06:07:40.750886565 -0200
-+++ grub/util/grub.d/10_linux.in 2014-01-11 06:14:19.032955542 -0200
-@@ -30,8 +30,25 @@
-
+diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
+index 00d1931..23de7ce 100644
+--- a/util/grub.d/10_linux.in
++++ b/util/grub.d/10_linux.in
+@@ -31,7 +31,17 @@ CLASS="--class gnu-linux --class gnu --class os"
if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
OS=GNU/Linux
--else
+ else
- OS="${GRUB_DISTRIBUTOR} GNU/Linux"
-+ if [ "${GRUB_DISTRIBUTOR}" = "Parabola" ] ; then
-+ OS="${GRUB_DISTRIBUTOR} GNU/Linux-libre"
-+ elif [ "${GRUB_DISTRIBUTOR}" = "parabola" ] ; then
++ if echo ${GRUB_DISTRIBUTOR} | grep -qi Parabola ; then
+ OS="${GRUB_DISTRIBUTOR} GNU/Linux-libre"
-+ elif [ "${GRUB_DISTRIBUTOR}" = "Blag" ] ; then
-+ OS="${GRUB_DISTRIBUTOR} Linux and GNU"
-+ elif [ "${GRUB_DISTRIBUTOR}" = "blag" ] ; then
++ elif echo ${GRUB_DISTRIBUTOR} | grep -qi Blag ; then
+ OS="${GRUB_DISTRIBUTOR} Linux and GNU"
-+ elif [ "${GRUB_DISTRIBUTOR}" = "Musix" ] ; then
++ elif echo ${GRUB_DISTRIBUTOR} | grep -qi Musix ; then
+ OS="${GRUB_DISTRIBUTOR} GNU+Linux"
-+ elif [ "${GRUB_DISTRIBUTOR}" = "musix" ] ; then
-+ OS="${GRUB_DISTRIBUTOR} GNU+Linux"
-+ elif [ "${GRUB_DISTRIBUTOR}" = "Dragora" ] ; then
-+ OS="${GRUB_DISTRIBUTOR} GNU/Linux-libre"
-+ elif [ "${GRUB_DISTRIBUTOR}" = "dragora" ] ; then
++ elif echo ${GRUB_DISTRIBUTOR} | grep -qi Dragora ; then
+ OS="${GRUB_DISTRIBUTOR} GNU/Linux-libre"
+ else
+ OS="${GRUB_DISTRIBUTOR} GNU/Linux"