summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeshav Amburay2015-06-08 20:06:04 -0400
committerKeshav Amburay2015-06-08 20:06:04 -0400
commit37703ae85d9773fdc3f3d8ddcb773ad71c59e09c (patch)
tree2c41cba4ce6e7726a747b35094902126bcc55ed9
downloadaur-37703ae85d9773fdc3f3d8ddcb773ad71c59e09c.tar.gz
Initial commit
-rw-r--r--.SRCINFO70
-rw-r--r--.gitignore7
-rw-r--r--60_memtest86+42
-rw-r--r--PKGBUILD386
-rw-r--r--grub-10_linux-detect-archlinux-initramfs.patch54
-rw-r--r--grub-add-GRUB_COLOR_variables.patch32
-rw-r--r--grub.cfg139
-rw-r--r--grub.default50
-rw-r--r--grub.install33
9 files changed, 813 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..f25a9ba51097
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,70 @@
+pkgbase = grub-git
+ pkgdesc = GNU GRand Unified Bootloader (2) - GIT Version
+ pkgver = 2.02.beta2.428.g697ecef
+ pkgrel = 1
+ url = https://www.gnu.org/software/grub/
+ install = grub.install
+ arch = x86_64
+ arch = i686
+ license = GPL3
+ makedepends = git
+ makedepends = rsync
+ makedepends = xz
+ makedepends = freetype2
+ makedepends = ttf-dejavu
+ makedepends = python
+ makedepends = autogen
+ makedepends = texinfo
+ makedepends = help2man
+ makedepends = gettext
+ makedepends = device-mapper
+ makedepends = fuse
+ depends = sh
+ depends = xz
+ depends = gettext
+ depends = device-mapper
+ optdepends = freetype2: For grub-mkfont usage
+ optdepends = fuse: For grub-mount usage
+ optdepends = dosfstools: For grub-mkrescue FAT FS and EFI support
+ optdepends = efibootmgr: For grub-install EFI support
+ optdepends = libisoburn: Provides xorriso for generating grub rescue iso using grub-mkrescue
+ optdepends = os-prober: To detect other OSes when generating grub.cfg in BIOS systems
+ optdepends = mtools: For grub-mkrescue FAT FS support
+ provides = grub=2.02.beta2.428.g697ecef
+ provides = grub-common=2.02.beta2.428.g697ecef
+ provides = grub-bios=2.02.beta2.428.g697ecef
+ provides = grub-efi-=2.02.beta2.428.g697ecef
+ provides = grub-emu=2.02.beta2.428.g697ecef
+ provides = grub-bzr=2.02.beta2.428.g697ecef
+ conflicts = grub
+ conflicts = grub-common
+ conflicts = grub-bios
+ conflicts = grub-efi-
+ conflicts = grub-emu
+ conflicts = grub-bzr
+ conflicts = grub-legacy
+ options = !makeflags
+ backup = boot/grub/grub.cfg
+ backup = etc/default/grub
+ backup = etc/grub.d/40_custom
+ source = grub::git+git://git.sv.gnu.org/grub.git#branch=master
+ source = grub-extras::git+git://git.sv.gnu.org/grub-extras.git#branch=master
+ source = http://ftp.gnu.org/gnu/unifont/unifont-6.3.20131217/unifont-6.3.20131217.bdf.gz
+ source = http://ftp.gnu.org/gnu/unifont/unifont-6.3.20131217/unifont-6.3.20131217.bdf.gz.sig
+ source = grub-10_linux-detect-archlinux-initramfs.patch
+ source = grub-add-GRUB_COLOR_variables.patch
+ source = 60_memtest86+
+ source = grub.default
+ source = grub.cfg
+ sha1sums = SKIP
+ sha1sums = SKIP
+ sha1sums = 30797ba7a86fc32213b9ae994c9fa45f37d01170
+ sha1sums = SKIP
+ sha1sums = 7ffd63c38d74f969f72e38fea3500345c5b968b2
+ sha1sums = c03d2ea83aa6a44dc383fbf67c29c20469e57f1b
+ sha1sums = 10e30eb68fb95c86301112ac95c5b7515413152a
+ sha1sums = 55cf103b60f405bd37d44dd24357dedfff0214ee
+ sha1sums = 5b7fcb0718a23035c039eb2fda9e088bb13ae611
+
+pkgname = grub-git
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..1992d1789124
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,7 @@
+src/
+pkg/
+*.pkg.tar*
+*.tar.xz
+*.tar.gz
+*.sig
+*.log*
diff --git a/60_memtest86+ b/60_memtest86+
new file mode 100644
index 000000000000..7f63e0e045c6
--- /dev/null
+++ b/60_memtest86+
@@ -0,0 +1,42 @@
+#!/usr/bin/env bash
+########################################################
+# This script generates a memtest86+ entry on grub.cfg #
+# if memtest is installed on the system. #
+########################################################
+
+prefix="/usr"
+exec_prefix="${prefix}"
+datarootdir="/usr/share"
+datadir="${datarootdir}"
+sysconfdir="/etc"
+
+. "${datadir}/grub/grub-mkconfig_lib"
+
+. "${sysconfdir}/default/grub"
+
+MEMTEST86_IMAGE="/boot/memtest86+/memtest.bin"
+CLASS="--class memtest86 --class gnu --class tool"
+
+[[ -z "${GRUB_PLATFORM}" ]] && GRUB_PLATFORM="x86"
+
+check="--is-${GRUB_PLATFORM}-linux"
+
+# MEMTEST86_IMAGE="$(if grub_file_is_not_garbage "${MEMTEST86_IMAGE}" && "${grub_file}" ${check} "${MEMTEST86_IMAGE}" ; then echo -n "${MEMTEST86_IMAGE} " ; fi)"
+
+if [[ "${GRUB_PLATFORM}" == "x86" ]]; then
+ if [[ -e "${MEMTEST86_IMAGE}" ]] && is_path_readable_by_grub "${MEMTEST86_IMAGE}" ; then
+ ## image exists, create menu entry
+ echo "Found memtest86+ image: ${MEMTEST86_IMAGE}" >&2
+ _GRUB_MEMTEST_HINTS_STRING="$(${grub_probe} --target=hints_string ${MEMTEST86_IMAGE})"
+ _GRUB_MEMTEST_FS_UUID="$(${grub_probe} --target=fs_uuid ${MEMTEST86_IMAGE})"
+ _GRUB_MEMTEST_REL_PATH="$(make_system_path_relative_to_its_root ${MEMTEST86_IMAGE})"
+ cat << EOF
+if [ x\$grub_platform = xpc ]; then
+ menuentry "Memory Tester (memtest86+)" ${CLASS} {
+ search --fs-uuid --no-floppy --set=root ${_GRUB_MEMTEST_HINTS_STRING} ${_GRUB_MEMTEST_FS_UUID}
+ linux16 ${_GRUB_MEMTEST_REL_PATH} ${GRUB_CMDLINE_MEMTEST86}
+ }
+fi
+EOF
+ fi
+fi
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..4cd9372be360
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,386 @@
+# Maintainer : Keshav Amburay <(the ddoott ridikulus ddoott rat) (aatt) (gemmaeiil) (ddoott) (ccoomm)>
+# Contributor: Zack Buhman
+# Contributor: Tobias Powalowski <tpowa@archlinux.org>
+# Contributor: Ronald van Haren <ronald.archlinux.org>
+
+## "1" to enable IA32-EFI build in Arch x86_64, "0" to disable
+_GRUB_IA32_EFI_ARCH_X64="1"
+
+## "1" to enable EMU build, "0" to disable
+_GRUB_EMU_BUILD="0"
+
+_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"
+pkgname="${_pkgname}-git"
+
+pkgdesc="GNU GRand Unified Bootloader (2) - GIT Version"
+pkgver=2.02.beta2.428.g697ecef
+pkgrel=1
+url="https://www.gnu.org/software/grub/"
+arch=('x86_64' 'i686')
+license=('GPL3')
+backup=('boot/grub/grub.cfg' 'etc/default/grub' 'etc/grub.d/40_custom')
+install="${_pkgname}.install"
+options=('!makeflags')
+
+conflicts=('grub' 'grub-common' 'grub-bios' "grub-efi-${_EFI_ARCH}" 'grub-emu' 'grub-bzr' 'grub-legacy')
+provides=("grub=${pkgver}" "grub-common=${pkgver}" "grub-bios=${pkgver}" "grub-efi-${_EFI_ARCH}=${pkgver}" "grub-emu=${pkgver}" "grub-bzr=${pkgver}")
+
+makedepends=('git' 'rsync' 'xz' 'freetype2' 'ttf-dejavu' 'python' 'autogen'
+ 'texinfo' 'help2man' 'gettext' 'device-mapper' 'fuse')
+depends=('sh' 'xz' 'gettext' 'device-mapper')
+optdepends=('freetype2: For grub-mkfont usage'
+ 'fuse: For grub-mount usage'
+ 'dosfstools: For grub-mkrescue FAT FS and EFI support'
+ 'efibootmgr: For grub-install EFI support'
+ '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')
+
+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::git+git://git.sv.gnu.org/grub.git#branch=master"
+ "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-archlinux-initramfs.patch'
+ 'grub-add-GRUB_COLOR_variables.patch'
+ '60_memtest86+'
+ 'grub.default'
+ 'grub.cfg')
+
+sha1sums=('SKIP'
+ 'SKIP'
+ '30797ba7a86fc32213b9ae994c9fa45f37d01170'
+ 'SKIP'
+ '7ffd63c38d74f969f72e38fea3500345c5b968b2'
+ 'c03d2ea83aa6a44dc383fbf67c29c20469e57f1b'
+ '10e30eb68fb95c86301112ac95c5b7515413152a'
+ '55cf103b60f405bd37d44dd24357dedfff0214ee'
+ '5b7fcb0718a23035c039eb2fda9e088bb13ae611')
+
+validpgpkeys=('95D2E9AB8740D8046387FD151A09227B1F435A33') ## Paul Hardy - for unifont
+
+pkgver() {
+ cd "${srcdir}/grub/"
+ echo "$(git describe --tags)" | sed -e 's|grub.||g' -e 's|-|\.|g'
+}
+
+prepare() {
+
+ cd "${srcdir}/grub/"
+
+ msg "Patch to detect of Arch Linux initramfs images by grub-mkconfig"
+ patch -Np1 -i "${srcdir}/grub-10_linux-detect-archlinux-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"
+ echo
+
+ msg "Fix DejaVuSans.ttf location so that grub-mkfont can create *.pf2 files for starfield theme"
+ sed 's|/usr/share/fonts/dejavu|/usr/share/fonts/dejavu /usr/share/fonts/TTF|g' -i "${srcdir}/grub/configure.ac"
+
+ msg "Fix mkinitcpio 'rw' FS#36275"
+ sed 's| ro | rw |g' -i "${srcdir}/grub/util/grub.d/10_linux.in"
+
+ msg "Fix OS naming FS#33393"
+ sed 's|GNU/Linux|Linux|' -i "${srcdir}/grub/util/grub.d/10_linux.in"
+
+ # msg "Requires python2"
+ # sed 's|python |python2 |g' -i "${srcdir}/grub/autogen.sh"
+
+ msg "Pull in latest language files"
+ ./linguas.sh
+ echo
+
+ msg "Remove not working langs which need LC_ALL=C.UTF-8"
+ sed -e 's#en@cyrillic en@greek##g' -i "${srcdir}/grub/po/LINGUAS"
+
+ msg "Avoid problem with unifont during compile of grub, http://savannah.gnu.org/bugs/?40330 and https://bugs.archlinux.org/task/37847"
+ cp "${srcdir}/unifont-${_UNIFONT_VER}.bdf" "${srcdir}/grub/unifont.bdf"
+
+}
+
+_build_grub-common_and_bios() {
+
+ msg "Set ARCH dependent variables for bios build"
+ if [[ "${CARCH}" == 'x86_64' ]]; then
+ _EFIEMU="--enable-efiemu"
+ else
+ _EFIEMU="--disable-efiemu"
+ fi
+
+ msg "Copy the source for building the bios part"
+ cp -r "${srcdir}/grub" "${srcdir}/grub-bios"
+ cd "${srcdir}/grub-bios/"
+
+ msg "Add the grub-extra sources for bios build"
+ install -d "${srcdir}/grub-bios/grub-extras"
+ # cp -r "${srcdir}/grub-extras/915resolution" "${srcdir}/grub-bios/grub-extras/915resolution"
+ export GRUB_CONTRIB="${srcdir}/grub-bios/grub-extras/"
+
+ msg "Unset all compiler FLAGS for bios build"
+ unset CFLAGS
+ unset CPPFLAGS
+ unset CXXFLAGS
+ unset LDFLAGS
+ unset MAKEFLAGS
+
+ cd "${srcdir}/grub-bios/"
+
+ msg "Run autogen.sh for bios build"
+ ./autogen.sh
+ echo
+
+ msg "Run ./configure for bios build"
+ ./configure \
+ --with-platform="pc" \
+ --target="i386" \
+ "${_EFIEMU}" \
+ --enable-mm-debug \
+ --enable-nls \
+ --enable-device-mapper \
+ --enable-cache-stats \
+ --enable-boot-time \
+ --enable-grub-mkfont \
+ --enable-grub-mount \
+ --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 bios build"
+ make
+ echo
+}
+
+_build_grub-efi() {
+
+ msg "Copy the source for building the ${_EFI_ARCH} efi part"
+ cp -r "${srcdir}/grub" "${srcdir}/grub-efi-${_EFI_ARCH}"
+ cd "${srcdir}/grub-efi-${_EFI_ARCH}/"
+
+ msg "Unset all compiler FLAGS for ${_EFI_ARCH} efi build"
+ unset CFLAGS
+ unset CPPFLAGS
+ unset CXXFLAGS
+ unset LDFLAGS
+ unset MAKEFLAGS
+
+ cd "${srcdir}/grub-efi-${_EFI_ARCH}/"
+
+ msg "Run autogen.sh for ${_EFI_ARCH} efi build"
+ ./autogen.sh
+ echo
+
+ msg "Run ./configure for ${_EFI_ARCH} efi build"
+ ./configure \
+ --with-platform="efi" \
+ --target="${_EFI_ARCH}" \
+ --disable-efiemu \
+ --enable-mm-debug \
+ --enable-nls \
+ --enable-device-mapper \
+ --enable-cache-stats \
+ --enable-boot-time \
+ --enable-grub-mkfont \
+ --enable-grub-mount \
+ --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 ${_EFI_ARCH} efi build"
+ make
+ echo
+
+}
+
+_build_grub-emu() {
+
+ msg "Copy the source for building the emu part"
+ cp -r "${srcdir}/grub" "${srcdir}/grub-emu"
+ cd "${srcdir}/grub-emu/"
+
+ msg "Unset all compiler FLAGS for emu build"
+ unset CFLAGS
+ unset CPPFLAGS
+ unset CXXFLAGS
+ unset LDFLAGS
+ unset MAKEFLAGS
+
+ cd "${srcdir}/grub-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/"
+
+ msg "Build grub bios stuff"
+ _build_grub-common_and_bios
+ echo
+
+ msg "Build grub ${_EFI_ARCH} efi stuff"
+ _build_grub-efi
+ echo
+
+ if [[ "${CARCH}" == "x86_64" ]] && [[ "${_GRUB_IA32_EFI_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() {
+
+ cd "${srcdir}/grub-bios/"
+
+ msg "Run make install for bios build"
+ make DESTDIR="${pkgdir}/" bashcompletiondir="/usr/share/bash-completion/completions" install
+ echo
+
+ msg "Remove gdb debugging related files for bios build"
+ 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 extra /etc/grub.d/ files"
+ install -D -m0755 "${srcdir}/60_memtest86+" "${pkgdir}/etc/grub.d/60_memtest86+"
+
+ msg "Install /etc/default/grub (used by grub-mkconfig)"
+ install -D -m0644 "${srcdir}/grub.default" "${pkgdir}/etc/default/grub"
+
+ msg "Install grub.cfg for backup array"
+ install -D -m0644 "${srcdir}/grub.cfg" "${pkgdir}/boot/grub/grub.cfg"
+
+}
+
+_package_grub-efi() {
+
+ cd "${srcdir}/grub-efi-${_EFI_ARCH}/"
+
+ msg "Run make install for ${_EFI_ARCH} efi build"
+ make DESTDIR="${pkgdir}/" bashcompletiondir="/usr/share/bash-completion/completions" install
+ echo
+
+ msg "Remove gdb debugging related files for ${_EFI_ARCH} efi build"
+ rm -f "${pkgdir}/usr/lib/grub/${_EFI_ARCH}-efi"/*.module || true
+ rm -f "${pkgdir}/usr/lib/grub/${_EFI_ARCH}-efi"/*.image || true
+ rm -f "${pkgdir}/usr/lib/grub/${_EFI_ARCH}-efi"/{kernel.exec,gdb_grub,gmodule.pl} || true
+
+}
+
+_package_grub-emu() {
+
+ cd "${srcdir}/grub-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/"
+
+ if [[ "${_GRUB_EMU_BUILD}" == "1" ]]; then
+ msg "Package grub emu stuff"
+ _package_grub-emu
+ echo
+ fi
+
+ msg "Package grub ${_EFI_ARCH} efi stuff"
+ _package_grub-efi
+ echo
+
+ if [[ "${CARCH}" == "x86_64" ]] && [[ "${_GRUB_IA32_EFI_ARCH_X64}" == "1" ]]; then
+ msg "Package grub i386 efi stuff"
+ _EFI_ARCH="i386" _package_grub-efi
+ echo
+ fi
+
+ msg "Package grub bios stuff"
+ _package_grub-common_and_bios
+ echo
+
+}
diff --git a/grub-10_linux-detect-archlinux-initramfs.patch b/grub-10_linux-detect-archlinux-initramfs.patch
new file mode 100644
index 000000000000..18d9d520c484
--- /dev/null
+++ b/grub-10_linux-detect-archlinux-initramfs.patch
@@ -0,0 +1,54 @@
+From b470ffd22e43acc7c11231180187a720efd88de1 Mon Sep 17 00:00:00 2001
+From: Keshav Amburay <the.ridikulus.rat@gmail.com>
+Date: Sat, 5 Apr 2014 20:40:51 -0400
+Subject: [PATCH] 10_linux: Detect Arch Linux main and fallback initramfs
+ images
+
+---
+ util/grub.d/10_linux.in | 16 +++++++++++++++-
+ 1 file changed, 15 insertions(+), 1 deletion(-)
+
+diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
+index 00d1931..7d4086b 100644
+--- a/util/grub.d/10_linux.in
++++ b/util/grub.d/10_linux.in
+@@ -81,6 +81,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
+@@ -180,7 +182,7 @@ while [ "x$list" != "x" ] ; do
+ basename=`basename $linux`
+ dirname=`dirname $linux`
+ rel_dirname=`make_system_path_relative_to_its_root $dirname`
+- version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
++ version=`echo $basename | sed -e "s,vmlinuz-,,g"`
+ alt_version=`echo $version | sed -e "s,\.old$,,g"`
+ linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
+
+@@ -236,6 +238,18 @@ while [ "x$list" != "x" ] ; do
+
+ linux_entry "${OS}" "${version}" advanced \
+ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
++
++ if test -e "${dirname}/initramfs-${version}-fallback.img" ; then
++ initrd="initramfs-${version}-fallback.img"
++
++ if test -n "${initrd}" ; then
++ gettext_printf "Found fallback initramfs image: %s\n" "${dirname}/${initrd}" >&2
++ fi
++
++ linux_entry "${OS}" "${version}" fallback \
++ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
++ fi
++
+ if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
+ linux_entry "${OS}" "${version}" recovery \
+ "single ${GRUB_CMDLINE_LINUX}"
+--
+1.9.1
+
diff --git a/grub-add-GRUB_COLOR_variables.patch b/grub-add-GRUB_COLOR_variables.patch
new file mode 100644
index 000000000000..fdfbd8591e38
--- /dev/null
+++ b/grub-add-GRUB_COLOR_variables.patch
@@ -0,0 +1,32 @@
+diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
+index ca040dd..b7090ed 100644
+--- a/util/grub-mkconfig.in
++++ b/util/grub-mkconfig.in
+@@ -219,6 +219,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 ce2ec81..315fb8d 100644
+--- a/util/grub.d/00_header.in
++++ b/util/grub.d/00_header.in
+@@ -125,6 +125,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/grub.cfg b/grub.cfg
new file mode 100644
index 000000000000..d0db5306cb60
--- /dev/null
+++ b/grub.cfg
@@ -0,0 +1,139 @@
+#
+# DO NOT EDIT THIS FILE
+#
+# It is automatically generated by grub-mkconfig using templates
+# from /etc/grub.d and settings from /etc/default/grub
+#
+
+### BEGIN /etc/grub.d/00_header ###
+insmod part_gpt
+insmod part_msdos
+if [ -s $prefix/grubenv ]; then
+ load_env
+fi
+set default="0"
+
+if [ x"${feature_menuentry_id}" = xy ]; then
+ menuentry_id_option="--id"
+else
+ menuentry_id_option=""
+fi
+
+export menuentry_id_option
+
+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
+}
+
+if [ x$feature_default_font_path = xy ] ; then
+ font=unicode
+else
+insmod part_msdos
+insmod ext2
+set root='hd0,msdos5'
+if [ x$feature_platform_search_hint = xy ]; then
+ search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 ad4103fa-d940-47ca-8506-301d8071d467
+else
+ search --no-floppy --fs-uuid --set=root ad4103fa-d940-47ca-8506-301d8071d467
+fi
+ font="/usr/share/grub/unicode.pf2"
+fi
+
+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 'Arch Linux, with Linux core repo kernel' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-core repo kernel-true-ad4103fa-d940-47ca-8506-301d8071d467' {
+ load_video
+ set gfxpayload=keep
+ insmod gzio
+ insmod part_msdos
+ insmod ext2
+ set root='hd0,msdos5'
+ if [ x$feature_platform_search_hint = xy ]; then
+ search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 ad4103fa-d940-47ca-8506-301d8071d467
+ else
+ search --no-floppy --fs-uuid --set=root ad4103fa-d940-47ca-8506-301d8071d467
+ fi
+ echo 'Loading Linux core repo kernel ...'
+ linux /boot/vmlinuz-linux root=UUID=ad4103fa-d940-47ca-8506-301d8071d467 ro quiet
+ echo 'Loading initial ramdisk ...'
+ initrd /boot/initramfs-linux.img
+}
+menuentry 'Arch Linux, with Linux core repo kernel (Fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-core repo kernel-fallback-ad4103fa-d940-47ca-8506-301d8071d467' {
+ load_video
+ set gfxpayload=keep
+ insmod gzio
+ insmod part_msdos
+ insmod ext2
+ set root='hd0,msdos5'
+ if [ x$feature_platform_search_hint = xy ]; then
+ search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 ad4103fa-d940-47ca-8506-301d8071d467
+ else
+ search --no-floppy --fs-uuid --set=root ad4103fa-d940-47ca-8506-301d8071d467
+ fi
+ echo 'Loading Linux core repo kernel ...'
+ linux /boot/vmlinuz-linux root=UUID=ad4103fa-d940-47ca-8506-301d8071d467 ro quiet
+ echo 'Loading initial ramdisk ...'
+ initrd /boot/initramfs-linux-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 ${config_directory}/custom.cfg ]; then
+ source ${config_directory}/custom.cfg
+elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
+ source $prefix/custom.cfg;
+fi
+### END /etc/grub.d/41_custom ###
diff --git a/grub.default b/grub.default
new file mode 100644
index 000000000000..8cf2824e4f4d
--- /dev/null
+++ b/grub.default
@@ -0,0 +1,50 @@
+GRUB_DEFAULT=0
+GRUB_TIMEOUT=5
+GRUB_DISTRIBUTOR="Arch"
+GRUB_CMDLINE_LINUX_DEFAULT="quiet"
+GRUB_CMDLINE_LINUX=""
+
+# Disable Sub-menu
+GRUB_DISABLE_SUBMENU=y
+
+# Preload both GPT and MBR modules so that they are not missed
+GRUB_PRELOAD_MODULES="part_gpt part_msdos"
+
+# Uncomment to enable Hidden Menu, and optionally hide the timeout count
+#GRUB_HIDDEN_TIMEOUT=5
+#GRUB_HIDDEN_TIMEOUT_QUIET=true
+
+# Uncomment to use basic console
+GRUB_TERMINAL_INPUT=console
+
+# Uncomment to disable graphical terminal
+#GRUB_TERMINAL_OUTPUT=console
+
+# The resolution used on graphical terminal
+# note that you can use only modes which your graphic card supports via VBE
+# you can see them in real GRUB with the command `vbeinfo'
+GRUB_GFXMODE=auto
+
+# Uncomment to allow the kernel use the same resolution used by grub
+GRUB_GFXPAYLOAD_LINUX=keep
+
+# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
+# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
+#GRUB_DISABLE_LINUX_UUID=true
+
+# Uncomment to disable generation of recovery mode menu entries
+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"
+
+# Uncomment one of them for the gfx desired, a image background or a gfxtheme
+#GRUB_BACKGROUND="/path/to/wallpaper"
+#GRUB_THEME="/path/to/gfxtheme"
+
+# Uncomment to get a beep at GRUB start
+#GRUB_INIT_TUNE="480 440 1"
+
+#GRUB_SAVEDEFAULT="true"
diff --git a/grub.install b/grub.install
new file mode 100644
index 000000000000..9188b357a934
--- /dev/null
+++ b/grub.install
@@ -0,0 +1,33 @@
+infodir="usr/share/info"
+filelist=('grub.info' 'grub-dev.info')
+
+post_install() {
+ if [ -f /boot/grub/grub.cfg.pacsave ]; then
+ echo "Copying /boot/grub/grub.cfg.pacsave to /boot/grub/grub.cfg"
+ install -D -m0644 /boot/grub/grub.cfg.pacsave /boot/grub/grub.cfg
+ fi
+
+ 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."
+
+ for file in ${filelist[@]}; do
+ install-info ${infodir}/${file}.gz ${infodir}/dir 2> /dev/null
+ done
+}
+
+post_upgrade() {
+ for file in ${filelist[@]}; do
+ install-info ${infodir}/${file}.gz ${infodir}/dir 2> /dev/null
+ done
+}
+
+pre_remove() {
+ for file in ${filelist[@]}; do
+ install-info --delete ${infodir}/${file} ${infodir}/dir 2> /dev/null
+ done
+}