summaryrefslogtreecommitdiff
path: root/libre/grub2
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-03-31 00:01:07 +0000
committerroot <root@rshg054.dnsready.net>2012-03-31 00:01:07 +0000
commit977b78df305a06797773799a7295f2a5f3f013cf (patch)
treec2cad20a10da5fe8f8784db13a2d52b80d0199a3 /libre/grub2
parent263884f95012e159a0be10444ef96bbf56e70545 (diff)
Sat Mar 31 00:01:07 UTC 2012
Diffstat (limited to 'libre/grub2')
-rw-r--r--libre/grub2/20_memtest86+10
-rw-r--r--libre/grub2/PKGBUILD368
-rw-r--r--libre/grub2/archlinux_grub2_mkconfig_fixes.patch92
-rw-r--r--libre/grub2/archlinux_grub_mkconfig_fixes.patch141
-rw-r--r--libre/grub2/fix_stack_pointer_handling_16_relocator.patch13
-rw-r--r--libre/grub2/grub-mkconfig-Use_outside_GRUB_PREFIX_if_defined.patch15
-rw-r--r--libre/grub2/grub.cfg139
-rw-r--r--libre/grub2/grub.default9
-rw-r--r--libre/grub2/grub2.install6
-rw-r--r--libre/grub2/grub2_automake_1.11.2_pkglib_to_pkgdata.patch134
-rw-r--r--libre/grub2/grub2_bzr_export.sh96
-rw-r--r--libre/grub2/grub_extras_lua_args_fix.patch13
12 files changed, 777 insertions, 259 deletions
diff --git a/libre/grub2/20_memtest86+ b/libre/grub2/20_memtest86+
index 41ca11f02..1d3096f6b 100644
--- a/libre/grub2/20_memtest86+
+++ b/libre/grub2/20_memtest86+
@@ -4,11 +4,13 @@
# if memtest is installed on the system. #
########################################################
-prefix=/usr
-exec_prefix=${prefix}
-libdir=${exec_prefix}/lib
+prefix="/usr"
+exec_prefix="${prefix}"
-. ${libdir}/grub/grub-mkconfig_lib
+datarootdir="/usr/share"
+datadir="${datarootdir}"
+
+. "${datadir}/grub/grub-mkconfig_lib"
MEMTEST86_IMAGE="/boot/memtest86+/memtest.bin"
CLASS="--class memtest86 --class gnu --class tool"
diff --git a/libre/grub2/PKGBUILD b/libre/grub2/PKGBUILD
index 9f445eb1d..d84f8a62c 100644
--- a/libre/grub2/PKGBUILD
+++ b/libre/grub2/PKGBUILD
@@ -1,206 +1,254 @@
# Maintainer: Ronald van Haren <ronald.archlinux.org>
-# Contributor: Keshav P R <skodabenz at rocketmail dot com>
+# Contributor: Keshav P R <(the.ridikulus.rat) (aatt) (gemmaeiil) (ddoott) (ccoomm)>
+# Maintainer (Parabola): André Silva <andre.paulista@adinet.com.uy>
-# The src pkg includes grub2_bzr_export.sh to create newer grub-extras snapshots. Modify the paths in it accordingly.
+_grub_bzr_rev="4169"
+_pkgver="2.00~beta2"
-# _grub2_rev=3238
-
-_grub2_lua_ver=20
-_grub2_gpxe_ver=12
-_grub2_ntldr_ver=17
-_grub2_915_ver=7
+_grub_lua_ver=24
+_grub_gpxe_ver=12
+_grub_ntldr_ver=21
+_grub_915_ver=9
pkgname=('grub2-common' 'grub2-bios' 'grub2-efi-i386')
-pkgbase="grub2"
-pkgver='1.99'
-pkgrel=4
+pkgbase=grub2
+pkgver=2.00beta2
+pkgrel=3
url="http://www.gnu.org/software/grub/"
arch=('i686' 'x86_64')
license=('GPL3')
-epoch=1
-makedepends=('bdf-unifont' 'python2' 'xz' 'autogen' 'texinfo' 'help2man' 'gettext' 'device-mapper')
-options=(strip purge docs zipman !emptydirs)
-
-# "http://alpha.gnu.org/gnu/grub/grub-${pkgver}.tar.xz"
-source=("ftp://ftp.gnu.org/gnu/grub/grub-1.99.tar.xz"
- "ftp://ftp.archlinux.org/other/grub2/grub2_extras_lua_r${_grub2_lua_ver}.tar.xz"
- "ftp://ftp.archlinux.org/other/grub2/grub2_extras_gpxe_r${_grub2_gpxe_ver}.tar.xz"
- "ftp://ftp.archlinux.org/other/grub2/grub2_extras_ntldr-img_r${_grub2_ntldr_ver}.tar.xz"
- "ftp://ftp.archlinux.org/other/grub2/grub2_extras_915resolution_r${_grub2_915_ver}.tar.xz"
- 'archlinux_grub2_mkconfig_fixes.patch'
- 'grub.default'
- 'grub.cfg'
- '20_memtest86+'
- 'grub2_bzr_export.sh'
- 'parabola-mkconfig.patch')
-
-noextract=("grub2_extras_lua_r${_grub2_lua_ver}.tar.xz"
- "grub2_extras_gpxe_r${_grub2_gpxe_ver}.tar.xz"
- "grub2_extras_ntldr-img_r${_grub2_ntldr_ver}.tar.xz"
- "grub2_extras_915resolution_r${_grub2_915_ver}.tar.xz")
-
-sha1sums=('a5ae9558f30ce7757a76aa130088b053a87e2fb6'
- '9f2dbf7a3faab24ca92266400aa513fecd3895c8'
+epoch="1"
+makedepends=('rsync' 'xz' 'bdf-unifont' 'python' 'autogen' 'texinfo'
+ 'help2man' 'gettext' 'device-mapper' 'fuse' 'dosfstools' 'efibootmgr')
+
+# source=("ftp://ftp.archlinux.org/other/grub2/grub_r${_grub_bzr_rev}.tar.xz"
+source=("http://alpha.gnu.org/gnu/grub/grub-${_pkgver}".tar.xz
+ "ftp://ftp.archlinux.org/other/grub2/grub2_extras_lua_r${_grub_lua_ver}.tar.xz"
+ "ftp://ftp.archlinux.org/other/grub2/grub2_extras_gpxe_r${_grub_gpxe_ver}.tar.xz"
+ "ftp://ftp.archlinux.org/other/grub2/grub2_extras_ntldr-img_r${_grub_ntldr_ver}.tar.xz"
+ "ftp://ftp.archlinux.org/other/grub2/grub2_extras_915resolution_r${_grub_915_ver}.tar.xz"
+ 'archlinux_grub_mkconfig_fixes.patch'
+ 'grub.default'
+ 'grub.cfg'
+ '20_memtest86+')
+
+noextract=("grub2_extras_lua_r${_grub_lua_ver}.tar.xz"
+ "grub2_extras_gpxe_r${_grub_gpxe_ver}.tar.xz"
+ "grub2_extras_ntldr-img_r${_grub_ntldr_ver}.tar.xz"
+ "grub2_extras_915resolution_r${_grub_915_ver}.tar.xz")
+
+sha1sums=('2ba583f9466fb676b0ae3d7a9a82d1299b153a98'
+ '89290031b974780c6df76893836d2477d4add895'
'b04994c005910b4bf123f034b30109d5c8d6fd86'
- 'e0c1a97770cc23226cf4535c029ef50b17f67974'
- '8bcaed545956bb33581e1b97ac96a2c3717ec793'
- 'b7e5510c7b171e9c4dbddb42bbf54ce5ee86e2de'
- 'd1252b837b13ebf817dbc45cfd4d772c7d1b621f'
- '7df0516c6c45816aa330b775f1ed6f652e4f0380'
- '82a27eca5277218cf57c6c5767e0b17a72f62229'
- 'beb31419045db70fee7401aa6448c220a491e2a3'
- '27930016362d6647282405183b9977f0a7b15c1a')
+ 'eb4b35b4c36b64f9405cbcbc538cb205171c1c0a'
+ 'd5ae2efec25616028a9d89e98b6e454f1c4c415f'
+ 'cdace8067562fab04aaacac8d99a4ea612fa0c5b'
+ '348b148d5183825f31a3d24a7ebf2d6a709f4e6a'
+ '6f0870673b9f994163326a416432aee7eacdbfc5'
+ 'ce35d7ae75cd1b5b677e894e528f96add40e77b9')
-build() {
- # set architecture dependent variables
- if [ "${CARCH}" = "x86_64" ] ; then
- _EFIEMU="--enable-efiemu"
- else
- _EFIEMU="--disable-efiemu"
- fi
- _HOST="${CARCH}"
+_build_grub2-common_and_bios() {
- build_grub2-common_and_bios
- build_grub2-efi
-}
+ ## copy the source for building the common/bios package
+ cp -r "${srcdir}/grub-${_pkgver}" "${srcdir}/grub_bios-${_pkgver}"
+ cd "${srcdir}/grub_bios-${_pkgver}"
+
+ ## Apply Archlinux specific fixes to enable grub-mkconfig detect Arch kernels and initramfs
+ patch -Np1 -i "${srcdir}/archlinux_grub_mkconfig_fixes.patch"
+ echo
+
+ ## add the grub-extra sources
+ export GRUB_CONTRIB="${srcdir}/grub_bios-${_pkgver}/grub-extras/"
+ install -d "${srcdir}/grub_bios-${_pkgver}/grub-extras"
+
+ bsdtar xf "${srcdir}/grub2_extras_lua_r${_grub_lua_ver}.tar.xz" \
+ -C "${srcdir}/grub_bios-${_pkgver}/grub-extras"
+
+ bsdtar xf "${srcdir}/grub2_extras_gpxe_r${_grub_gpxe_ver}.tar.xz" \
+ -C "${srcdir}/grub_bios-${_pkgver}/grub-extras"
+
+ bsdtar xf "${srcdir}/grub2_extras_ntldr-img_r${_grub_ntldr_ver}.tar.xz" \
+ -C "${srcdir}/grub_bios-${_pkgver}/grub-extras"
+
+ bsdtar xf "${srcdir}/grub2_extras_915resolution_r${_grub_915_ver}.tar.xz" \
+ -C "${srcdir}/grub_bios-${_pkgver}/grub-extras"
-build_grub2-common_and_bios() {
- # copy the source for building the common/bios package
- cp -r ${srcdir}/grub-${pkgver} ${srcdir}/grub2_bios-${pkgver}
-
- ## Apply Archlinux specific fixes to enable grub2-mkconfig detect Arch kernels and initramfs
- cd ${srcdir}/grub2_bios-${pkgver}
- patch -Np1 -i ${srcdir}/archlinux_grub2_mkconfig_fixes.patch
- patch -Np1 -i ${srcdir}/parabola-mkconfig.patch
-
- # add the grub-extra sources
- export GRUB_CONTRIB=${srcdir}/grub2_bios-${pkgver}/grub2-extras/
- install -d ${srcdir}/grub2_bios-${pkgver}/grub2-extras
- bsdtar xf ${srcdir}/grub2_extras_lua_r${_grub2_lua_ver}.tar.xz \
- -C ${srcdir}/grub2_bios-${pkgver}/grub2-extras
- bsdtar xf ${srcdir}/grub2_extras_gpxe_r${_grub2_gpxe_ver}.tar.xz \
- -C ${srcdir}/grub2_bios-${pkgver}/grub2-extras
- bsdtar xf ${srcdir}/grub2_extras_ntldr-img_r${_grub2_ntldr_ver}.tar.xz \
- -C ${srcdir}/grub2_bios-${pkgver}/grub2-extras
- bsdtar xf ${srcdir}/grub2_extras_915resolution_r${_grub2_915_ver}.tar.xz \
- -C ${srcdir}/grub2_bios-${pkgver}/grub2-extras
-
- ## Need to use python2
- sed -i 's|python|python2|' ${srcdir}/grub2_bios-${pkgver}/autogen.sh
-
- # start the actual build process
- cd ${srcdir}/grub2_bios-${pkgver}
+ ## Requires python2
+ # sed 's|python |python2 |g' -i "${srcdir}/grub_bios-${_pkgver}/autogen.sh"
+
+ ## start the actual build process
+ cd "${srcdir}/grub_bios-${_pkgver}"
./autogen.sh
-
+
## fix unifont.bdf location so grub-mkfont can create *.pf2 files
- sed -i 's|/usr/share/fonts/unifont|/usr/share/fonts/misc|' ${srcdir}/grub2_bios-${pkgver}/configure
-
-# mkdir ${srcdir}/grub2_bios-${pkgver}/BUILD_BIOS
-# cd ${srcdir}/grub2_bios-${pkgver}/BUILD_BIOS
-
+ sed 's|/usr/share/fonts/unifont|/usr/share/fonts/misc|g' -i "${srcdir}/grub_bios-${_pkgver}/configure"
+
+ # install -d "${srcdir}/grub_bios-${_pkgver}/BUILD_BIOS"
+ # cd "${srcdir}/grub_bios-${_pkgver}/BUILD_BIOS"
+
CFLAGS="" ./configure \
- --with-platform=pc --enable-mm-debug \
- ${_EFIEMU} --host=${CARCH}-unknown-linux-gnu \
- --enable-grub-mkfont --prefix=/usr \
- --bindir=/bin --sbindir=/sbin \
- --mandir=/usr/share/man --infodir=/usr/share/info \
- --sysconfdir=/etc --enable-nls \
- --program-transform-name=s,grub,grub,
- CFLAGS="" make
+ --with-platform="pc" \
+ --target="i386" \
+ --host="${CARCH}-unknown-linux-gnu" \
+ "${_EFIEMU}" \
+ --enable-mm-debug \
+ --enable-nls \
+ --enable-device-mapper \
+ --enable-cache-stats \
+ --enable-grub-mkfont \
+ --enable-grub-mount \
+ --prefix="/usr" \
+ --bindir="/usr/bin" \
+ --sbindir="/usr/sbin" \
+ --mandir="/usr/share/man" \
+ --infodir="/usr/share/info" \
+ --datarootdir="/usr/share" \
+ --sysconfdir="/etc" \
+ --program-prefix="" \
+ --with-bootdir="/boot" \
+ --with-grubdir="grub" \
+ --disable-werror
+
+ CFLAGS="" make
+
}
-build_grub2-efi() {
- # copy the source for building the efi package
- cp -r ${srcdir}/grub-${pkgver} ${srcdir}/grub2_efi-${pkgver}
-
- # add the grub-extra sources
- export GRUB_CONTRIB=${srcdir}/grub2_efi-${pkgver}/grub2-extras/
- install -d ${srcdir}/grub2_efi-${pkgver}/grub2-extras
- bsdtar xf ${srcdir}/grub2_extras_lua_r${_grub2_lua_ver}.tar.xz \
- -C ${srcdir}/grub2_efi-${pkgver}/grub2-extras
- bsdtar xf ${srcdir}/grub2_extras_gpxe_r${_grub2_gpxe_ver}.tar.xz \
- -C ${srcdir}/grub2_efi-${pkgver}/grub2-extras
-
- ## Need to use python2
- sed -i 's|python|python2|' ${srcdir}/grub2_efi-${pkgver}/autogen.sh
-
- # start the actual build process
- cd ${srcdir}/grub2_efi-${pkgver}
+_build_grub2-efi-i386() {
+
+ ## copy the source for building the efi package
+ cp -r "${srcdir}/grub-${_pkgver}" "${srcdir}/grub_efi-${_pkgver}"
+ cd "${srcdir}/grub_efi-${_pkgver}"
+
+ export GRUB_CONTRIB="${srcdir}/grub_efi-${_pkgver}/grub-extras/"
+ install -d "${srcdir}/grub_efi-${_pkgver}/grub-extras"
+
+ bsdtar xf "${srcdir}/grub2_extras_lua_r${_grub_lua_ver}.tar.xz" \
+ -C "${srcdir}/grub_efi-${_pkgver}/grub-extras"
+
+ bsdtar xf "${srcdir}/grub2_extras_gpxe_r${_grub_gpxe_ver}.tar.xz" \
+ -C "${srcdir}/grub_efi-${_pkgver}/grub-extras"
+
+ ## Requires python2
+ # sed 's|python |python2 |g' -i "${srcdir}/grub_efi-${_pkgver}/autogen.sh"
+
+ cd "${srcdir}/grub_efi-${_pkgver}"
./autogen.sh
CFLAGS="" ./configure \
- --with-platform=efi --target=i386 \
- --enable-mm-debug --disable-efiemu \
- --host=${CARCH}-unknown-linux-gnu \
- --prefix=/usr --bindir=/bin \
- --sbindir=/sbin --mandir=/usr/share/man \
- --infodir=/usr/share/info --sysconfdir=/etc \
- --enable-nls --program-transform-name=s,grub,grub,
- CFLAGS="" make
+ --with-platform="efi" \
+ --target="i386" \
+ --host="${CARCH}-unknown-linux-gnu" \
+ --disable-efiemu \
+ --enable-mm-debug \
+ --enable-nls \
+ --enable-device-mapper \
+ --enable-cache-stats \
+ --enable-grub-mkfont \
+ --enable-grub-mount \
+ --prefix="/usr" \
+ --bindir="/usr/bin" \
+ --sbindir="/usr/sbin" \
+ --mandir="/usr/share/man" \
+ --infodir="/usr/share/info" \
+ --datarootdir="/usr/share" \
+ --sysconfdir="/etc" \
+ --program-prefix="" \
+ --with-bootdir="/boot" \
+ --with-grubdir="grub" \
+ --disable-werror
+
+ CFLAGS="" make
+}
+
+#_get_locale_files() {
+#
+# cd "${srcdir}/grub-${_pkgver}"
+# rsync -Lrtvz translationproject.org::tp/latest/grub/ "${srcdir}/grub-${_pkgver}/po" || true
+# (cd "${srcdir}/grub-${_pkgver}/po" && ls *.po | cut -d. -f1 | xargs) > "${srcdir}/grub-${_pkgver}/po/LINGUAS"
+#}
+
+build() {
+
+ ## set architecture dependent variables
+ if [[ "${CARCH}" == 'x86_64' ]]; then
+ _EFIEMU="--enable-efiemu"
+ else
+ _EFIEMU="--disable-efiemu"
+ fi
+
+ _HOST="${CARCH}"
+
+ cd "${srcdir}/grub-${_pkgver}"
+ # _get_locale_files
+
+ _build_grub2-common_and_bios
+ _build_grub2-efi-i386
+
}
package_grub2-common() {
+
pkgdesc="The GNU GRand Unified Bootloader version 2 - Files common for all platforms"
- install="grub2.install"
- depends=('xz' 'freetype2' 'device-mapper' 'gettext' 'texinfo')
+ depends=('xz' 'freetype2' 'gettext' 'device-mapper' 'fuse' 'sh')
conflicts=('grub')
backup=('boot/grub/grub.cfg' 'etc/default/grub' 'etc/grub.d/40_custom')
- cd ${srcdir}/grub2_bios-${pkgver}
- make DESTDIR=${pkgdir} install
-
- install -Dm755 ${pkgdir}/sbin/grub-install ${pkgdir}/sbin/grub_bios-install
- install -Dm755 ${pkgdir}/sbin/grub-install ${pkgdir}/sbin/grub_efi_x86_64-install
- install -Dm755 ${pkgdir}/sbin/grub-install ${pkgdir}/sbin/grub_efi_i386-install
-
- sed -i "s|^\(target_cpu\)=.*|\1=i386|; \
- s|^\(platform\)=.*|\1=pc|" \
- ${pkgdir}/sbin/grub_bios-install
-
- sed -i "s|^\(target_cpu\)=.*|\1=x86_64|; \
- s|^\(platform\)=.*|\1=efi|" \
- ${pkgdir}/sbin/grub_efi_x86_64-install
-
- sed -i "s|^\(target_cpu\)=.*|\1=i386|; \
- s|^\(platform\)=.*|\1=efi|" \
- ${pkgdir}/sbin/grub_efi_i386-install
-
+ optdepends=('libisoburn: provides xorriso for generating grub rescue iso using grub-mkrescue'
+ 'os-prober: to detect other OSes when generating grub.cfg in BIOS systems'
+ 'mtools: for grub-mkrescue FAT FS support')
+ install="grub2.install"
+ options=('strip' 'purge' 'docs' 'zipman' '!emptydirs')
+
+ cd "${srcdir}/grub_bios-${_pkgver}"
+ make DESTDIR="${pkgdir}/" install
+
## install extra /etc/grub.d/ files
- install -Dm755 ${srcdir}/20_memtest86+ ${pkgdir}/etc/grub.d/20_memtest86+
-
+ install -D -m0755 "${srcdir}/20_memtest86+" "${pkgdir}/etc/grub.d/20_memtest86+"
+
## install /etc/default/grub (used by grub-mkconfig)
- install -Dm644 ${srcdir}/grub.default ${pkgdir}/etc/default/grub
+ install -D -m0644 "${srcdir}/grub.default" "${pkgdir}/etc/default/grub"
## install grub.cfg (needed so it doesn't get removed on upgrading because it was previously here)
- install -Dm644 ${srcdir}/grub.cfg ${pkgdir}/boot/grub/grub.cfg
+ install -D -m0644 "${srcdir}/grub.cfg" "${pkgdir}/boot/grub/grub.cfg"
# remove platform specific files
- rm -rf ${pkgdir}/usr/lib/grub/i386-pc/
+ rm -rf "${pkgdir}/usr/lib/grub/i386-pc/"
+
}
package_grub2-bios() {
- pkgdesc="The GNU GRand Unified Bootloader version 2 - Built for PC BIOS"
- depends=(grub2-common=${epoch}:${pkgver})
- replaces=('grub2' 'grub2-libre')
- provides=('grub2' 'grub2-libre')
-
- cd ${srcdir}/grub2_bios-${pkgver}
- make DESTDIR=${pkgdir} install
+
+ pkgdesc="The GNU GRand Unified Bootloader version 2 - Built for i386 PC BIOS"
+ depends=("grub2-common=${epoch}:${pkgver}")
+ options=('!strip' '!emptydirs')
+
+ cd "${srcdir}/grub_bios-${_pkgver}"
+ make DESTDIR="${pkgdir}/" install
## remove non platform-specific files
- rm -rf ${pkgdir}/{boot,bin,sbin,etc,usr/share}
- rm ${pkgdir}/usr/lib/grub/{grub-mkconfig_lib,update-grub_lib}
+ rm -rf "${pkgdir}"/{boot,etc,usr/{share,bin,sbin}}
+
+ ## remove gdb debugging related files
+ 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
+
}
package_grub2-efi-i386() {
pkgdesc="The GNU GRand Unified Bootloader version 2 - i386 UEFI version"
depends=("grub2-common=${epoch}:${pkgver}" 'dosfstools' 'efibootmgr')
- optdepends=('mtools')
-
- cd ${srcdir}/grub2_efi-${pkgver}
- make DESTDIR=${pkgdir} install
+ options=('!strip' '!emptydirs')
+
+ cd "${srcdir}/grub_efi-${_pkgver}"
+ make DESTDIR="${pkgdir}/" install
## remove non platform-specific files
- rm -rf ${pkgdir}/{boot,bin,sbin,etc,usr/share}
- rm ${pkgdir}/usr/lib/grub/{grub-mkconfig_lib,update-grub_lib}
+ rm -rf "${pkgdir}"/{boot,etc,usr/{share,bin,sbin}}
+
+ ## remove gdb debugging related files
+ rm -f "${pkgdir}/usr/lib/grub/i386-efi"/*.module || true
+ rm -f "${pkgdir}/usr/lib/grub/i386-efi"/*.image || true
+ rm -f "${pkgdir}/usr/lib/grub/i386-efi"/{kernel.exec,gdb_grub,gmodule.pl} || true
+
}
diff --git a/libre/grub2/archlinux_grub2_mkconfig_fixes.patch b/libre/grub2/archlinux_grub2_mkconfig_fixes.patch
index 11805e309..ef4b10ee6 100644
--- a/libre/grub2/archlinux_grub2_mkconfig_fixes.patch
+++ b/libre/grub2/archlinux_grub2_mkconfig_fixes.patch
@@ -1,7 +1,21 @@
-diff -Nur a/util/grub.d/00_header.in b/util/grub.d/00_header.in
---- a/util/grub.d/00_header.in 2011-04-06 13:14:27.000000000 +0200
-+++ b/util/grub.d/00_header.in 2011-08-01 15:19:57.919100452 +0200
-@@ -100,6 +100,14 @@
+diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
+index 859c2e8..c754dd7 100644
+--- a/util/grub-mkconfig.in
++++ b/util/grub-mkconfig.in
+@@ -242,6 +242,8 @@ export GRUB_DEFAULT \
+ GRUB_THEME \
+ GRUB_GFXPAYLOAD_LINUX \
+ GRUB_DISABLE_OS_PROBER \
++ GRUB_COLOR_NORMAL \
++ GRUB_COLOR_HIGHLIGHT \
+ GRUB_INIT_TUNE \
+ GRUB_SAVEDEFAULT \
+ GRUB_ENABLE_CRYPTODISK \
+diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in
+index d9bcc15..a93dcb7 100644
+--- a/util/grub.d/00_header.in
++++ b/util/grub.d/00_header.in
+@@ -100,6 +100,14 @@ cat <<EOF
EOF
@@ -16,10 +30,11 @@ diff -Nur a/util/grub.d/00_header.in b/util/grub.d/00_header.in
serial=0;
gfxterm=0;
for x in ${GRUB_TERMINAL_INPUT} ${GRUB_TERMINAL_OUTPUT}; do
-diff -Nur a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
---- a/util/grub.d/10_linux.in 2011-05-14 22:36:49.000000000 +0200
-+++ b/util/grub.d/10_linux.in 2011-08-01 15:56:53.324779083 +0200
-@@ -31,8 +31,8 @@
+diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
+index bc738f2..a6ab326 100644
+--- a/util/grub.d/10_linux.in
++++ b/util/grub.d/10_linux.in
+@@ -31,8 +31,8 @@ CLASS="--class gnu-linux --class gnu --class os"
if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
OS=GNU/Linux
else
@@ -30,7 +45,16 @@ diff -Nur a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
fi
# loop-AES arranges things so that /dev/loop/X can be our root device, but
-@@ -65,7 +65,9 @@
+@@ -48,7 +48,7 @@ if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue"
+ || uses_abstraction "${GRUB_DEVICE}" lvm; then
+ LINUX_ROOT_DEVICE=${GRUB_DEVICE}
+ else
+- LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
++ LINUX_ROOT_DEVICE="/dev/disk/by-uuid/${GRUB_DEVICE_UUID}"
+ fi
+
+ if [ "x`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true`" = xbtrfs ]; then
+@@ -65,7 +65,9 @@ linux_entry ()
version="$2"
recovery="$3"
args="$4"
@@ -41,7 +65,17 @@ diff -Nur a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
title="$(gettext_quoted "%s, with Linux %s (recovery mode)")"
else
title="$(gettext_quoted "%s, with Linux %s")"
-@@ -132,7 +134,7 @@
+@@ -113,7 +115,9 @@ EOF
+ fi
+ printf '%s\n' "${prepare_boot_cache}"
+ fi
++
+ message="$(gettext_printf "Loading Linux %s ..." ${version})"
++
+ cat << EOF
+ echo '$message'
+ linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
+@@ -132,11 +136,11 @@ EOF
case x`uname -m` in
xi?86 | xx86_64)
@@ -50,22 +84,39 @@ diff -Nur a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
done` ;;
*)
-@@ -160,7 +162,8 @@
+- list=`for i in /boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do
++ list=`for i in /boot/vmlinuz* /boot/vmlinux* /vmlinuz* /vmlinux* /boot/kernel-* ; do
+ if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
+ done` ;;
+ esac
+@@ -151,16 +155,19 @@ while [ "x$list" != "x" ] ; do
+ dirname=`dirname $linux`
+ rel_dirname=`make_system_path_relative_to_its_root $dirname`
+ version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
+- alt_version=`echo $version | sed -e "s,\.old$,,g"`
++ base_init=`echo $basename | sed -e "s,vmlinuz,initramfs,g"`
++ alt_version="${base_init}-fallback"
+ linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
+
+ initrd=
++
+ for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${version}.gz" \
+ "initrd-${version}" "initramfs-${version}.img" \
"initrd.img-${alt_version}" "initrd-${alt_version}.img" \
"initrd-${alt_version}" "initramfs-${alt_version}.img" \
"initramfs-genkernel-${version}" \
- "initramfs-genkernel-${alt_version}"; do
+ "initramfs-genkernel-${alt_version}" \
-+ "${basename/vmlinuz/kernel}.img"; do
++ "${basename/vmlinuz/initramfs}.img" "${basename/vmlinuz/kernel}.img"; do
if test -e "${dirname}/${i}" ; then
initrd="$i"
break
-@@ -190,6 +193,15 @@
+@@ -190,6 +197,16 @@ while [ "x$list" != "x" ] ; do
linux_entry "${OS}" "${version}" false \
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
+ for i in "initramfs-${version}-fallback.img" \
-+ "${basename/vmlinuz/kernel}-fallback.img"; do
++ "${basename/vmlinuz/initramfs}-fallback.img" "${basename/vmlinuz/kernel}-fallback.img"; do
+ if test -e "${dirname}/${i}"; then
+ initrd="$i"
+ linux_entry "${OS}" "${version}" true \
@@ -73,18 +124,7 @@ diff -Nur a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
+ break
+ fi
+ done
++
if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
linux_entry "${OS}" "${version}" true \
"single ${GRUB_CMDLINE_LINUX}"
-diff -Nur a/util/grub-mkconfig.in b/util/grub-mkconfig.in
---- a/util/grub-mkconfig.in 2011-04-06 17:45:53.000000000 +0200
-+++ b/util/grub-mkconfig.in 2011-08-01 15:20:49.256867648 +0200
-@@ -252,6 +252,8 @@
- GRUB_THEME \
- GRUB_GFXPAYLOAD_LINUX \
- GRUB_DISABLE_OS_PROBER \
-+ GRUB_COLOR_NORMAL \
-+ GRUB_COLOR_HIGHLIGHT \
- GRUB_INIT_TUNE \
- GRUB_SAVEDEFAULT \
- GRUB_BADRAM
diff --git a/libre/grub2/archlinux_grub_mkconfig_fixes.patch b/libre/grub2/archlinux_grub_mkconfig_fixes.patch
new file mode 100644
index 000000000..4b4cba92a
--- /dev/null
+++ b/libre/grub2/archlinux_grub_mkconfig_fixes.patch
@@ -0,0 +1,141 @@
+diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
+index df3b733..65a7fff 100644
+--- a/util/grub-mkconfig.in
++++ b/util/grub-mkconfig.in
+@@ -213,6 +213,8 @@ export GRUB_DEFAULT \
+ GRUB_THEME \
+ GRUB_GFXPAYLOAD_LINUX \
+ GRUB_DISABLE_OS_PROBER \
++ GRUB_COLOR_NORMAL \
++ GRUB_COLOR_HIGHLIGHT \
+ GRUB_INIT_TUNE \
+ GRUB_SAVEDEFAULT \
+ GRUB_ENABLE_CRYPTODISK \
+diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in
+index 765bfdc..b148558 100644
+--- a/util/grub.d/00_header.in
++++ b/util/grub.d/00_header.in
+@@ -115,6 +115,14 @@ cat <<EOF
+
+ EOF
+
++if [ x$GRUB_COLOR_NORMAL != x ] && [ x$GRUB_COLOR_HIGHLIGHT != x ] ; then
++ cat << EOF
++set menu_color_normal=$GRUB_COLOR_NORMAL
++set menu_color_highlight=$GRUB_COLOR_HIGHLIGHT
++
++EOF
++fi
++
+ serial=0;
+ gfxterm=0;
+ for x in ${GRUB_TERMINAL_INPUT} ${GRUB_TERMINAL_OUTPUT}; do
+diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
+index 8c75fab..0d4a137 100644
+--- a/util/grub.d/10_linux.in
++++ b/util/grub.d/10_linux.in
+@@ -87,6 +87,8 @@ linux_entry ()
+ case $type in
+ recovery)
+ title="$(gettext_printf "%s, with Linux %s (recovery mode)" "${os}" "${version}")" ;;
++ fallback)
++ title="$(gettext_printf "%s, with Linux %s (Fallback initramfs)" "${os}" "${version}")" ;;
+ *)
+ title="$(gettext_printf "%s, with Linux %s" "${os}" "${version}")" ;;
+ esac
+@@ -100,7 +102,7 @@ linux_entry ()
+ else
+ echo "menuentry '$(echo "$os" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
+ fi
+- if [ x$type != xrecovery ] ; then
++ if [ x$type != xrecovery ] && [ x$type != xfallback ] ; then
+ save_default_entry | sed -e "s/^/\t/"
+ fi
+
+@@ -132,7 +134,8 @@ linux_entry ()
+ fi
+ printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/"
+ fi
+- message="$(gettext_printf "Loading Linux %s ..." ${version})"
++
++ message="$(gettext_printf "Loading Linux %s ..." "${version}")"
+ sed "s/^/$submenu_indentation/" << EOF
+ echo '$message'
+ linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
+@@ -181,13 +184,29 @@ while [ "x$list" != "x" ] ; do
+ alt_version=`echo $version | sed -e "s,\.old$,,g"`
+ linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
+
++ if test -e "/etc/arch-release" ; then
++ if echo "${basename}" | grep -q 'vmlinuz-linux' ; then
++ version="`echo "${basename}" | sed -e 's,vmlinuz-linux,,g'`"
++
++ if [ "x${version}" = "x" ] ; then
++ version="core repo kernel"
++ else
++ version="`echo "${version}" | sed -e 's,-,,g'`"
++ version="${version} kernel"
++ fi
++ fi
++ fi
++
+ initrd=
++ initrd_arch="`echo "${basename}" | sed -e 's,vmlinuz,initramfs,g'`"
++
+ for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${version}.gz" \
+ "initrd-${version}" "initramfs-${version}.img" \
+ "initrd.img-${alt_version}" "initrd-${alt_version}.img" \
+ "initrd-${alt_version}" "initramfs-${alt_version}.img" \
+ "initramfs-genkernel-${version}" \
+- "initramfs-genkernel-${alt_version}"; do
++ "initramfs-genkernel-${alt_version}" \
++ "${initrd_arch}.img" ; do
+ if test -e "${dirname}/${i}" ; then
+ initrd="$i"
+ break
+@@ -215,6 +234,22 @@ while [ "x$list" != "x" ] ; do
+ linux_root_device_thisversion=${GRUB_DEVICE}
+ fi
+
++ if test -e "/etc/arch-release" ; then
++ is_first_entry="false"
++
++ linux_entry "${OS}" "${version}" true \
++ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
++
++ for i in "${initrd_arch}-fallback.img" "initramfs-${version}-fallback.img" ; do
++ if test -e "${dirname}/${i}" ; then
++ initrd="${i}"
++ linux_entry "${OS}" "${version}" fallback \
++ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
++ break
++ fi
++ done
++ fi
++
+ if [ "x$is_first_entry" = xtrue ]; then
+ linux_entry "${OS}" "${version}" simple \
+ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
+@@ -228,8 +263,11 @@ while [ "x$list" != "x" ] ; do
+ echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}" | grub_quote)' \$menuentry_id_option 'gnulinux-advanced-$boot_device_id' {"
+ fi
+
++ if ! test -e "/etc/arch-release" ; then
+ linux_entry "${OS}" "${version}" advanced \
+ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
++ fi
++
+ if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
+ linux_entry "${OS}" "${version}" recovery \
+ "single ${GRUB_CMDLINE_LINUX}"
+@@ -241,8 +279,10 @@ done
+
+ # If at least one kernel was found, then we need to
+ # add a closing '}' for the submenu command.
++if ! test -e "/etc/arch-release" ; then
+ if [ x"$is_first_entry" != xtrue ]; then
+ echo '}'
+ fi
++fi
+
+ echo "$title_correction_code"
diff --git a/libre/grub2/fix_stack_pointer_handling_16_relocator.patch b/libre/grub2/fix_stack_pointer_handling_16_relocator.patch
new file mode 100644
index 000000000..edc0ef502
--- /dev/null
+++ b/libre/grub2/fix_stack_pointer_handling_16_relocator.patch
@@ -0,0 +1,13 @@
+diff --git a/grub-core/lib/i386/relocator16.S b/grub-core/lib/i386/relocator16.S
+index c3768f4..982415d 100644
+--- a/grub-core/lib/i386/relocator16.S
++++ b/grub-core/lib/i386/relocator16.S
+@@ -130,7 +130,7 @@ VARIABLE(grub_relocator16_ss)
+ .byte 0xb8
+ VARIABLE(grub_relocator16_sp)
+ .word 0
+- movw %ax, %ss
++ movzwl %ax, %esp
+
+ /* movw imm32, %edx. */
+ .byte 0x66, 0xba
diff --git a/libre/grub2/grub-mkconfig-Use_outside_GRUB_PREFIX_if_defined.patch b/libre/grub2/grub-mkconfig-Use_outside_GRUB_PREFIX_if_defined.patch
new file mode 100644
index 000000000..e1de26859
--- /dev/null
+++ b/libre/grub2/grub-mkconfig-Use_outside_GRUB_PREFIX_if_defined.patch
@@ -0,0 +1,15 @@
+diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
+index 859c2e8..c4391dc 100644
+--- a/util/grub-mkconfig.in
++++ b/util/grub-mkconfig.in
+@@ -40,7 +40,9 @@ self=`basename $0`
+ grub_probe="${sbindir}/`echo grub-probe | sed "${transform}"`"
+ grub_script_check="${bindir}/`echo grub-script-check | sed "${transform}"`"
+
+-GRUB_PREFIX=`echo '/@bootdirname@/@grubdirname@' | sed "s,//*,/,g"`
++if test -z "${GRUB_PREFIX}"; then
++ GRUB_PREFIX=`echo '/@bootdirname@/@grubdirname@' | sed "s,//*,/,g"`
++fi
+
+ . "${datadir}/@PACKAGE@/grub-mkconfig_lib"
+
diff --git a/libre/grub2/grub.cfg b/libre/grub2/grub.cfg
index 1f0e41471..4f5a21991 100644
--- a/libre/grub2/grub.cfg
+++ b/libre/grub2/grub.cfg
@@ -1,26 +1,127 @@
-# Config file for GRUB2 - The GNU GRand Unified Bootloader
-# /boot/grub/grub.cfg
-
-# DEVICE NAME CONVERSIONS
#
-# Linux Grub
-# -------------------------
-# /dev/fd0 (fd0)
-# /dev/sda (hd0)
-# /dev/sdb2 (hd1,2)
-# /dev/sda3 (hd0,3)
+# DO NOT EDIT THIS FILE
+#
+# It is automatically generated by grub-mkconfig using templates
+# from /etc/grub.d and settings from /etc/default/grub
#
-# Timeout for menu
-set timeout=5
+### BEGIN /etc/grub.d/00_header ###
+insmod part_gpt
+insmod part_msdos
+if [ -s $prefix/grubenv ]; then
+ load_env
+fi
+set default="0"
+if [ "${prev_saved_entry}" ]; then
+ set saved_entry="${prev_saved_entry}"
+ save_env saved_entry
+ set prev_saved_entry=
+ save_env prev_saved_entry
+ set boot_once=true
+fi
+
+function savedefault {
+ if [ -z "${boot_once}" ]; then
+ saved_entry="${chosen}"
+ save_env saved_entry
+ fi
+}
+
+function load_video {
+ if [ x$feature_all_video_module = xy ]; then
+ insmod all_video
+ else
+ insmod efi_gop
+ insmod efi_uga
+ insmod ieee1275_fb
+ insmod vbe
+ insmod vga
+ insmod video_bochs
+ insmod video_cirrus
+ fi
+}
-# Set default boot entry as Entry 0
-set default=0
+if [ x$feature_default_font_path = xy ] ; then
+ font=unicode
+else
+insmod part_gpt
+insmod ext2
+set root='hd0,gpt9'
+if [ x$feature_platform_search_hint = xy ]; then
+ search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt9 --hint-efi=hd0,gpt9 --hint-baremetal=ahci0,gpt9 0cc6e472-7f98-42ff-b7f3-309b641377ad
+else
+ search --no-floppy --fs-uuid --set=root 0cc6e472-7f98-42ff-b7f3-309b641377ad
+fi
+ font="/usr/share/grub/unicode.pf2"
+fi
-# (0) Parabola GNU/Linux-libre
-menuentry "Parabola GNU/Linux-libre" {
-set root=(hd0,1)
-linux /vmlinuz26 root=/dev/sda1 ro
-initrd /kernel26.img
+if loadfont $font ; then
+ set gfxmode=auto
+ load_video
+ insmod gfxterm
+ set locale_dir=$prefix/locale
+ set lang=en_US
+ insmod gettext
+fi
+terminal_input console
+terminal_output gfxterm
+set timeout=5
+### END /etc/grub.d/00_header ###
+
+### BEGIN /etc/grub.d/10_linux ###
+menuentry 'Parabola GNU/Linux-libre, with Linux libre' --class parabolagnu/linux-libre --class gnu-linux --class gnu --class os {
+ load_video
+ set gfxpayload=keep
+ insmod gzio
+ insmod part_gpt
+ insmod ext2
+ set root='hd0,gpt3'
+ if [ x$feature_platform_search_hint = xy ]; then
+ search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3 2ccd62fe-2204-44e8-bcfd-ce33996f9852
+ else
+ search --no-floppy --fs-uuid --set=root 2ccd62fe-2204-44e8-bcfd-ce33996f9852
+ fi
+ echo 'Loading Linux libre ...'
+ linux /vmlinuz-linux-libre root=/dev/disk/by-uuid/0cc6e472-7f98-42ff-b7f3-309b641377ad ro quiet
+ echo 'Loading initial ramdisk ...'
+ initrd /initramfs-linux-libre.img
}
+menuentry 'Parabola GNU/Linux-libre, with Linux libre Fallback' --class parabolagnu/linux-libre --class gnu-linux --class gnu --class os {
+ load_video
+ set gfxpayload=keep
+ insmod gzio
+ insmod part_gpt
+ insmod ext2
+ set root='hd0,gpt3'
+ if [ x$feature_platform_search_hint = xy ]; then
+ search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3 2ccd62fe-2204-44e8-bcfd-ce33996f9852
+ else
+ search --no-floppy --fs-uuid --set=root 2ccd62fe-2204-44e8-bcfd-ce33996f9852
+ fi
+ echo 'Loading Linux libre ...'
+ linux /vmlinuz-linux-libre root=/dev/disk/by-uuid/0cc6e472-7f98-42ff-b7f3-309b641377ad ro quiet
+ echo 'Loading initial ramdisk ...'
+ initrd /initramfs-linux-libre-fallback.img
+}
+### END /etc/grub.d/10_linux ###
+
+### BEGIN /etc/grub.d/20_linux_xen ###
+### END /etc/grub.d/20_linux_xen ###
+
+### BEGIN /etc/grub.d/20_memtest86+ ###
+### END /etc/grub.d/20_memtest86+ ###
+
+### BEGIN /etc/grub.d/30_os-prober ###
+### END /etc/grub.d/30_os-prober ###
+
+### BEGIN /etc/grub.d/40_custom ###
+# This file provides an easy way to add custom menu entries. Simply type the
+# menu entries you want to add after this comment. Be careful not to change
+# the 'exec tail' line above.
+### END /etc/grub.d/40_custom ###
+### BEGIN /etc/grub.d/41_custom ###
+if [ -f $prefix/custom.cfg ]; then
+ source $prefix/custom.cfg;
+fi
+### END /etc/grub.d/41_custom ###
diff --git a/libre/grub2/grub.default b/libre/grub2/grub.default
index fecc09af6..4ab37bbfc 100644
--- a/libre/grub2/grub.default
+++ b/libre/grub2/grub.default
@@ -1,10 +1,7 @@
-# If you change this file, run 'update-grub' afterwards to update
-# /boot/grub/grub.cfg.
-
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Parabola GNU/Linux-libre"
-GRUB_CMDLINE_LINUX_DEFAULT="quiet"
+GRUB_CMDLINE_LINUX_DEFAULT="quiet add_efi_memmap"
GRUB_CMDLINE_LINUX=""
# Preload both GPT and MBR modules so that they are not missed
@@ -37,8 +34,8 @@ GRUB_DISABLE_RECOVERY=true
# Uncomment and set to the desired menu colors. Used by normal and wallpaper
# modes only. Entries specified as foreground/background.
-GRUB_COLOR_NORMAL="light-blue/black"
-GRUB_COLOR_HIGHLIGHT="light-cyan/blue"
+#GRUB_COLOR_NORMAL="light-blue/black"
+#GRUB_COLOR_HIGHLIGHT="light-cyan/blue"
# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/path/to/wallpaper"
diff --git a/libre/grub2/grub2.install b/libre/grub2/grub2.install
index 9baf14776..000533553 100644
--- a/libre/grub2/grub2.install
+++ b/libre/grub2/grub2.install
@@ -7,7 +7,11 @@ post_install() {
install -Dm644 /boot/grub/grub.cfg.pacsave /boot/grub/grub.cfg
fi
- echo -n "Generating grub.cfg.example config file... "
+ cat << 'EOM'
+Generating grub.cfg.example config file...
+This may fail on some machines running a custom kernel.
+EOM
+
grub-mkconfig -o /boot/grub/grub.cfg.example 2> /dev/null
echo "done."
diff --git a/libre/grub2/grub2_automake_1.11.2_pkglib_to_pkgdata.patch b/libre/grub2/grub2_automake_1.11.2_pkglib_to_pkgdata.patch
new file mode 100644
index 000000000..0e396b210
--- /dev/null
+++ b/libre/grub2/grub2_automake_1.11.2_pkglib_to_pkgdata.patch
@@ -0,0 +1,134 @@
+diff --git a/ChangeLog_Keshav b/ChangeLog_Keshav
+new file mode 100644
+index 0000000..0eafd65
+--- /dev/null
++++ b/ChangeLog_Keshav
+@@ -0,0 +1,12 @@
++2012-01-04 Keshav P R <the.ridikulus.rat@gmail.com>
++
++ Fixes for automake 1.11.2
++
++ * conf/Makefile.common: Change pkglib_SCRIPTS to pkgdata_SCRIPTS.
++ * conf/Makefile.common: Change pkglib_DATA to pkgdata_DATA.
++ * Makefile.am: Likewise.
++ * gentpl.py: Likewise.
++ * util/grub-mkstandalone.in: Likewise.
++ * util/grub-mknetdir.in: Likewise.
++ * util/grub-mkrescue.in: Likewise.
++ * util/grub-mkstandalone.in: Likewise.
+diff --git a/Makefile.am b/Makefile.am
+index c5f486e..395b0dd 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -101,8 +101,8 @@ CLEANFILES += widthspec.h
+ # Install config.h into platformdir
+ platform_HEADERS = config.h
+
+-pkglib_DATA += grub-mkconfig_lib
+-pkglib_DATA += update-grub_lib
++pkgdata_DATA += grub-mkconfig_lib
++pkgdata_DATA += update-grub_lib
+
+
+ if COND_i386_coreboot
+diff --git a/conf/Makefile.common b/conf/Makefile.common
+index 751188b..bbd59cc 100644
+--- a/conf/Makefile.common
++++ b/conf/Makefile.common
+@@ -137,7 +137,7 @@ KERNEL_HEADER_FILES =
+
+ man_MANS =
+ noinst_DATA =
+-pkglib_DATA =
++pkgdata_DATA =
+ bin_SCRIPTS =
+ sbin_SCRIPTS =
+ bin_PROGRAMS =
+@@ -147,7 +147,7 @@ check_SCRIPTS =
+ grubconf_DATA =
+ check_PROGRAMS =
+ noinst_SCRIPTS =
+-pkglib_SCRIPTS =
++pkgdata_SCRIPTS =
+ noinst_PROGRAMS =
+ grubconf_SCRIPTS =
+ noinst_LIBRARIES =
+diff --git a/gentpl.py b/gentpl.py
+index 3008b80..a935f4d 100644
+--- a/gentpl.py
++++ b/gentpl.py
+@@ -512,7 +512,7 @@ def script(platform):
+ r += "[+ ENDIF +]"
+
+ r += rule("[+ name +]", platform_sources(platform) + " $(top_builddir)/config.status", """
+-$(top_builddir)/config.status --file=-:$< | sed -e 's,@pkglib_DATA@,$(pkglib_DATA),g' > $@
++$(top_builddir)/config.status --file=-:$< | sed -e 's,@pkgdata_DATA@,$(pkgdata_DATA),g' > $@
+ chmod a+x [+ name +]
+ """)
+
+diff --git a/util/grub-mknetdir.in b/util/grub-mknetdir.in
+index e5a2172..7f6a36d 100644
+--- a/util/grub-mknetdir.in
++++ b/util/grub-mknetdir.in
+@@ -30,7 +30,7 @@ PACKAGE_VERSION=@PACKAGE_VERSION@
+ host_os=@host_os@
+ localedir=@datadir@/locale
+ datarootdir=@datarootdir@
+-pkglib_DATA="moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst"
++pkgdata_DATA="moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst"
+
+ self=`basename $0`
+
+@@ -183,7 +183,7 @@ process_input_dir ()
+ cp -f "$file" "$grubdir/"
+ fi
+ done
+- for file in ${pkglib_DATA}; do
++ for file in ${pkgdata_DATA}; do
+ if test -f "${input_dir}/${file}"; then
+ cp -f "${input_dir}/${file}" "$grubdir/"
+ fi
+diff --git a/util/grub-mkrescue.in b/util/grub-mkrescue.in
+index eff7708..f6b96d4 100644
+--- a/util/grub-mkrescue.in
++++ b/util/grub-mkrescue.in
+@@ -27,7 +27,7 @@ libdir=@libdir@
+ PACKAGE_NAME=@PACKAGE_NAME@
+ PACKAGE_TARNAME=@PACKAGE_TARNAME@
+ PACKAGE_VERSION=@PACKAGE_VERSION@
+-pkglib_DATA="moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst"
++pkgdata_DATA="moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst"
+
+ self=`basename $0`
+
+@@ -163,7 +163,7 @@ process_input_dir ()
+ cp -f "$file" ${iso9660_dir}/boot/grub/${platform}/
+ fi
+ done
+- for file in ${pkglib_DATA}; do
++ for file in ${pkgdata_DATA}; do
+ if test -f "${input_dir}/${file}"; then
+ cp -f "${input_dir}/${file}" ${iso9660_dir}/boot/grub/${platform}/
+ fi
+diff --git a/util/grub-mkstandalone.in b/util/grub-mkstandalone.in
+index b0dbf9b..92b7306 100644
+--- a/util/grub-mkstandalone.in
++++ b/util/grub-mkstandalone.in
+@@ -27,7 +27,7 @@ libdir=@libdir@
+ PACKAGE_NAME=@PACKAGE_NAME@
+ PACKAGE_TARNAME=@PACKAGE_TARNAME@
+ PACKAGE_VERSION=@PACKAGE_VERSION@
+-pkglib_DATA="moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst"
++pkgdata_DATA="moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst"
+
+ self=`basename $0`
+
+@@ -163,7 +163,7 @@ for file in "${source_directory}/"*.mod "${source_directory}/"efiemu32.o "${sour
+ fi
+ done
+
+-for file in ${pkglib_DATA}; do
++for file in ${pkgdata_DATA}; do
+ if test -f "${source_directory}/${file}"; then
+ cp -f "${source_directory}/${file}" "${memdisk_dir}"/boot/grub/
+ fi
diff --git a/libre/grub2/grub2_bzr_export.sh b/libre/grub2/grub2_bzr_export.sh
index 7c42d0c28..f40588f82 100644
--- a/libre/grub2/grub2_bzr_export.sh
+++ b/libre/grub2/grub2_bzr_export.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
## For actual repos
@@ -9,65 +9,67 @@
## For launchpad mirror
-# bzr branch lp:~skodabenz/grub/grub2-extras-lua lua
-# bzr branch lp:~skodabenz/grub/grub2-extras-gpxe gpxe
-# bzr branch lp:~skodabenz/grub/grub2-extras-ntldr-img ntldr-img
-# bzr branch lp:~skodabenz/grub/grub2-extras-915resolution 915resolution
+# bzr branch lp:~the-ridikulus-rat/grub/grub2-extras-lua lua
+# bzr branch lp:~the-ridikulus-rat/grub/grub2-extras-gpxe gpxe
+# bzr branch lp:~the-ridikulus-rat/grub/grub2-extras-ntldr-img ntldr-img
+# bzr branch lp:~the-ridikulus-rat/grub/grub2-extras-915resolution 915resolution
## grub-extras zfs is integrated into grub2 bzr main repo and is no longer needed separately.
-wd=${PWD}/
-output_dir=${wd}/
+_WD="${PWD}/"
+_OUTPUT_DIR="${_WD}/"
-grub2_bzr_dir=${wd}/grub2_BZR/
-grub2_bzr_exp_dir=${wd}/grub2_experimental_BZR/
-grub2_extras_dir=${wd}/grub2_extras_BZR/
+_ACTUAL_PKGVER="1.99"
-main_snapshot() {
+_GRUB2_BZR_REPO_DIR="${_WD}/grub2_BZR/"
+_GRUB2_BZR_EXP_REPO_DIR="${_WD}/grub2_experimental_BZR/"
+_GRUB2_EXTRAS_REPOS_DIR="${_WD}/grub2_extras_BZR/"
+
+_MAIN_SNAPSHOT() {
- cd ${grub2_bzr_dir}/
+ cd "${_GRUB2_BZR_REPO_DIR}/"
echo
- revnum=$(bzr revno ${grub2_bzr_dir})
- bzr export --root=grub2 --format=tar ${output_dir}/grub2_r${revnum}.tar
+ _REVNUM="$(bzr revno ${_GRUB2_BZR_REPO_DIR})"
+ bzr export --root="grub-${_ACTUAL_PKGVER}" --format="tar" "${_OUTPUT_DIR}/grub2_r${_REVNUM}.tar"
echo
- cd ${output_dir}/
+ cd "${_OUTPUT_DIR}/"
- xz -9 ${output_dir}/grub2_r${revnum}.tar
+ xz -9 "${_OUTPUT_DIR}/grub2_r${_REVNUM}.tar"
echo
}
-exp_snapshot() {
+_EXP_SNAPSHOT() {
- cd ${grub2_bzr_exp_dir}/
+ cd "${_GRUB2_BZR_EXP_REPO_DIR}/"
echo
- revnum=$(bzr revno ${grub2_bzr_exp_dir})
- bzr export --root=grub2_exp --format=tar ${output_dir}/grub2_exp_r${revnum}.tar
+ _REVNUM="$(bzr revno ${_GRUB2_BZR_EXP_REPO_DIR})"
+ bzr export --root="grub-${_ACTUAL_PKGVER}" --format="tar" "${_OUTPUT_DIR}/grub2_exp_r${_REVNUM}.tar"
echo
- cd ${output_dir}/
+ cd "${_OUTPUT_DIR}/"
- xz -9 ${output_dir}/grub2_exp_r${revnum}.tar
+ xz -9 "${_OUTPUT_DIR}/grub2_exp_r${_REVNUM}.tar"
echo
}
-extras_snapshot() {
+_EXTRAS_SNAPSHOT() {
- cd ${grub2_extras_dir}/${grub2_extras_name}/
+ cd "${_GRUB2_EXTRAS_REPOS_DIR}/${_GRUB2_EXTRAS_NAME}/"
echo
- revnum=$(bzr revno ${grub2_extras_dir}/${grub2_extras_name})
- bzr export --root=${grub2_extras_name} --format=tar ${output_dir}/grub2_extras_${grub2_extras_name}_r${revnum}.tar
+ _REVNUM="$(bzr revno ${_GRUB2_EXTRAS_REPOS_DIR}/${_GRUB2_EXTRAS_NAME})"
+ bzr export --root="${_GRUB2_EXTRAS_NAME}" --format=tar "${_OUTPUT_DIR}/grub2_extras_${_GRUB2_EXTRAS_NAME}_r${_REVNUM}.tar"
echo
- cd ${output_dir}/
+ cd "${_OUTPUT_DIR}/"
echo
- xz -9 ${output_dir}/grub2_extras_${grub2_extras_name}_r${revnum}.tar
+ xz -9 "${_OUTPUT_DIR}/grub2_extras_${_GRUB2_EXTRAS_NAME}_r${_REVNUM}.tar"
echo
}
@@ -76,28 +78,36 @@ echo
set -x -e
-# main_snapshot
+echo
-# exp_snapshot
+_MAIN_SNAPSHOT
-grub2_extras_name="lua"
-extras_snapshot
+echo
-grub2_extras_name="gpxe"
-extras_snapshot
+# _EXP_SNAPSHOT
+
+echo
-grub2_extras_name="ntldr-img"
-extras_snapshot
+_GRUB2_EXTRAS_NAME="lua"
+_EXTRAS_SNAPSHOT
-grub2_extras_name="915resolution"
-extras_snapshot
+_GRUB2_EXTRAS_NAME="gpxe"
+_EXTRAS_SNAPSHOT
+
+_GRUB2_EXTRAS_NAME="ntldr-img"
+_EXTRAS_SNAPSHOT
+
+_GRUB2_EXTRAS_NAME="915resolution"
+_EXTRAS_SNAPSHOT
+
+echo
set +x +e
echo
-unset wd
-unset output_dir
-unset grub2_bzr_dir
-unset grub2_extras_dir
-unset grub2_extras_name
+unset _WD
+unset _OUTPUT_DIR
+unset _GRUB2_BZR_REPO_DIR
+unset _GRUB2_EXTRAS_REPOS_DIR
+unset _GRUB2_EXTRAS_NAME
diff --git a/libre/grub2/grub_extras_lua_args_fix.patch b/libre/grub2/grub_extras_lua_args_fix.patch
new file mode 100644
index 000000000..5cb317ce3
--- /dev/null
+++ b/libre/grub2/grub_extras_lua_args_fix.patch
@@ -0,0 +1,13 @@
+diff --git a/grub-extras/lua/grub_lib.c b/grub-extras/lua/grub_lib.c
+index 9014320..055d620 100644
+--- a/grub-extras/lua/grub_lib.c
++++ b/grub-extras/lua/grub_lib.c
+@@ -466,7 +466,7 @@ grub_lua_add_menu (lua_State *state)
+ if (! p)
+ return push_result (state);
+
+- grub_normal_add_menu_entry (n, args, NULL, NULL, NULL, NULL, p, 0);
++ grub_normal_add_menu_entry (n, args, NULL, NULL, NULL, NULL, NULL, p, 0);
+ }
+ else
+ {