grub2 renamed in grub

bug fix #198
This commit is contained in:
AlmAck 2014-09-05 13:23:29 +02:00
parent 4bce427f5a
commit a87bb0f2d2
12 changed files with 438 additions and 490 deletions

287
grub/PKGBUILD Normal file
View File

@ -0,0 +1,287 @@
#
# Core Packages for Chakra, part of chakraos.org
#
# Maintainer: AlmAck
## "1" to enable IA32-EFI build in Arch x86_64, "0" to disable
_IA32_EFI_IN_ARCH_X64="1"
_pkgver="2.02"
_GRUB_GIT_TAG="grub-2.02-beta2"
_UNIFONT_VER="6.3.20131217"
_EFI_ARCH="x86_64"
pkgname="grub"
pkgdesc="GNU GRand Unified Bootloader (2)"
pkgver=2.02.beta2
pkgrel=1
url="https://www.gnu.org/software/grub/"
arch=('x86_64')
license=('GPL3')
backup=('boot/grub/grub.cfg' 'etc/default/grub' 'etc/grub.d/40_custom')
install="${pkgname}.install"
options=('!makeflags')
conflicts=('grub2-common' 'grub2-bios' 'grub2-efi64' 'grub2-efi86' "grub2-efi-${_EFI_ARCH}")
replaces=('grub2-common' 'grub2-bios' 'grub2-efi64' 'grub2-efi86' "grub2-efi-${_EFI_ARCH}")
provides=('grub2-common' 'grub2-bios' 'grub2-efi64' 'grub2-efi86' "grub2-efi-${_EFI_ARCH}")
makedepends=('git' 'rsync' 'xz' 'freetype2' 'ttf-dejavu' 'python3' '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')
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-archlinux-initramfs.patch'
'grub-add-GRUB_COLOR_variables.patch'
'grub.default'
'update-grub')
md5sums=('SKIP'
'SKIP'
'728b7439ac733a7c0d56049adec364c7'
'SKIP'
'945527e0de8d384166a4cf23439ae9ee'
'e506ae4a9f9f7d1b765febfa84e10d48'
'31e4c7414cef3db3fb26c40ac8da97f2'
'9910bdfd42fa7d3e21e6961bfcc977f9')
_pkgver() {
cd "${srcdir}/grub-${_pkgver}/"
echo "$(git describe --tags)" | sed -e 's|grub.||g' -e 's|-|\.|g'
}
prepare() {
cd "${srcdir}/grub-${_pkgver}/"
msg "Patch to detect of Chakra Linux initramfs images by grub-mkconfig (same as Arch)"
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-${_pkgver}/configure.ac"
msg "Fix mkinitcpio 'rw' FS#36275"
sed 's| ro | rw |g' -i "${srcdir}/grub-${_pkgver}/util/grub.d/10_linux.in"
msg "Fix OS naming FS#33393"
sed 's|GNU/Linux|Linux|' -i "${srcdir}/grub-${_pkgver}/util/grub.d/10_linux.in"
# msg "autogen.sh requires python (2/3). since bzr is in makedepends
sed 's|python |python3 |g' -i "${srcdir}/grub-${_pkgver}/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-${_pkgver}/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-${_pkgver}/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-${_pkgver}" "${srcdir}/grub-${_pkgver}-bios"
cd "${srcdir}/grub-${_pkgver}-bios/"
msg "Add the grub-extra sources for bios build"
install -d "${srcdir}/grub-${_pkgver}-bios/grub-extras"
cp -r "${srcdir}/grub-extras/915resolution" "${srcdir}/grub-${_pkgver}-bios/grub-extras/915resolution"
export GRUB_CONTRIB="${srcdir}/grub-${_pkgver}-bios/grub-extras/"
msg "Unset all compiler FLAGS for bios build"
unset CFLAGS
unset CPPFLAGS
unset CXXFLAGS
unset LDFLAGS
unset MAKEFLAGS
cd "${srcdir}/grub-${_pkgver}-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/sbin" \
--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-${_pkgver}" "${srcdir}/grub-${_pkgver}-efi-${_EFI_ARCH}"
cd "${srcdir}/grub-${_pkgver}-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-${_pkgver}-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/sbin" \
--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() {
cd "${srcdir}/grub-${_pkgver}/"
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" ]] && [[ "${_IA32_EFI_IN_ARCH_X64}" == "1" ]]; then
msg "Build grub i386 efi stuff"
_EFI_ARCH="i386" _build_grub-efi
echo
fi
}
_package_grub-common_and_bios() {
cd "${srcdir}/grub-${_pkgver}-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 /etc/default/grub (used by grub-mkconfig)"
install -D -m0644 "${srcdir}/grub.default" "${pkgdir}/etc/default/grub"
msg "Install update-grub (Chakra helper script)"
install -D -m755 "${srcdir}/update-grub" "${pkgdir}/usr/sbin/update-grub"
}
_package_grub-efi() {
cd "${srcdir}/grub-${_pkgver}-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() {
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
msg "Package grub bios stuff"
_package_grub-common_and_bios
}

View File

@ -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

View File

@ -0,0 +1,11 @@
--- util/grub.d/10_linux.in.old 2013-07-28 08:55:47.825946239 +0200
+++ util/grub.d/10_linux.in 2013-07-28 08:56:14.082201512 +0200
@@ -138,7 +138,7 @@
message="$(gettext_printf "Loading Linux %s ..." "${version}")"
sed "s/^/$submenu_indentation/" << EOF
echo '$(echo "$message" | grub_quote)'
- linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
+ linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} rw ${args}
EOF
if test -n "${initrd}" ; then
# TRANSLATORS: ramdisk isn't identifier. Should be translated.

View File

@ -0,0 +1,54 @@
There is no explicit option to turn off alignment; it is implicitly
disabled if one of --separator or --nameprefixes option is used.
--separator was added in 2007, --nameprefixes - in 2009. So let's use
--separator to extend range of versions we are compatible with. Note that
one or another must be used, current parsing is broken otherwise.
Signed-off-by: Andrey Borzenkov <address@hidden>
---
util/getroot.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/util/getroot.c b/util/getroot.c
index 2ad8a55..3afcf96 100644
--- a/util/getroot.c
+++ b/util/getroot.c
@@ -1322,7 +1322,7 @@ grub_util_get_dev_abstraction (const char *os_dev)
static void
pull_lvm_by_command (const char *os_dev)
{
- char *argv[6];
+ char *argv[8];
int fd;
pid_t pid;
FILE *mdadm;
@@ -1351,12 +1351,17 @@ pull_lvm_by_command (const char *os_dev)
/* execvp has inconvenient types, hence the casts. None of these
strings will actually be modified. */
+ /* by default PV name is left aligned in 10 character field, meaning that
+ we do not know where name ends. Using dummy --separator disables
+ alignment. We have a single field, so separator itself is not output */
argv[0] = (char *) "vgs";
argv[1] = (char *) "--options";
argv[2] = (char *) "pv_name";
argv[3] = (char *) "--noheadings";
- argv[4] = vgname;
- argv[5] = NULL;
+ argv[4] = (char *) "--separator";
+ argv[5] = (char *) ":";
+ argv[6] = vgname;
+ argv[7] = NULL;
pid = exec_pipe (argv, &fd);
free (vgname);
@@ -1376,6 +1381,7 @@ pull_lvm_by_command (const char *os_dev)
while (getline (&buf, &len, mdadm) > 0)
{
char *ptr;
+ /* LVM adds two spaces as standard prefix */
for (ptr = buf; ptr < buf + 2 && *ptr == ' '; ptr++);
if (*ptr == '\0')
continue;

View File

@ -0,0 +1,32 @@
diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
index 3390ba9..c416489 100644
--- a/util/grub-mkconfig.in
+++ b/util/grub-mkconfig.in
@@ -218,6 +218,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 d2e7252..8259f45 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

View File

@ -1,27 +0,0 @@
#! /bin/sh -e
########################################################
# This script generates a memtest86+ entry on grub.cfg #
# if memtest is installed on the system. #
########################################################
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
. ${libdir}/grub/grub-mkconfig_lib
MEMTEST86_IMAGE="/boot/memtest86+/memtest.bin"
CLASS="--class memtest86 --class gnu --class tool"
if [ -e $MEMTEST86_IMAGE ] && is_path_readable_by_grub $MEMTEST86_IMAGE; then
# image exists, create menu entry
echo "Found memtest86+ image: $MEMTEST86_IMAGE" >&2
cat << EOF
menuentry "Memory test (memtest86+)" $CLASS {
EOF
prepare_grub_to_access_device `${grub_probe} --target=device $MEMTEST86_IMAGE` | sed -e "s/^/ /"
cat << EOF
linux16 (\$root)`make_system_path_relative_to_its_root $MEMTEST86_IMAGE`
}
EOF
fi

View File

@ -1,253 +0,0 @@
#
# Core Packages for Chakra, part of chakra-project.org
#
# Maintainer: Daniele Cocca <jmc@chakra-project.org>
pkgname=('grub2-common' 'grub2-bios' 'grub2-efi32')
pkgbase=grub2
if [ "${CARCH}" == 'x86_64' ]; then
pkgname+=('grub2-efi64')
fi
pkgver=2.00
pkgrel=5
arch=('x86_64')
url="http://www.gnu.org/software/grub/"
license=('GPL3')
makedepends=('xz' 'bdf-unifont' 'ttf-dejavu' 'python' 'autogen'
'texinfo' 'help2man' 'gettext' 'device-mapper' 'fuse'
'bzr')
source=("ftp://ftp.gnu.org/gnu/grub/grub-${pkgver}.tar.xz"
'chakra_grub2_fixes.patch'
'grub.default'
'update-grub')
md5sums=('a1043102fbc7bcedbf53e7ee3d17ab91'
'bc191bc9e298380c1d5995c0faafa75a'
'3ad276456daa36cf2a1de678827043f3'
'31e4c7414cef3db3fb26c40ac8da97f2'
'9910bdfd42fa7d3e21e6961bfcc977f9')
# Options common to all packages
_common_options=('--prefix=/usr'
'--sysconfdir=/etc'
'--program-prefix='
"--host=${CARCH}-unknown-linux-gnu"
'--disable-werror'
'--enable-mm-debug'
'--enable-nls'
'--enable-device-mapper'
'--enable-cache-stats'
'--enable-grub-mkfont'
'--enable-grub-mount')
if [ "${CARCH}" == 'x86_64' ]; then
_native_arch='x86_64'
else
_native_arch='i386'
fi
# External sources
_grub_extras='http://bzr.savannah.gnu.org/r/grub-extras'
# Build code
_build_dir() {
[ $# -lt 1 ] && return false
mkdir -p "${1}" && cd "${1}"
}
_build_prepare() {
msg2 "Fixing font paths in ./configure..."
sed -e 's,\(/usr/share/fonts/unifont\),\1 /usr/share/fonts/misc,g' \
-i "${srcdir}/grub-${pkgver}/configure"
sed -e 's,\(/usr/share/fonts/dejavu\),\1 /usr/share/fonts/TTF,g' \
-i "${srcdir}/grub-${pkgver}/configure"
msg2 "Done replacing."
msg2 "Applying patches..."
cd "${srcdir}/grub-${pkgver}"
patch -Np1 -i "${srcdir}/chakra_grub2_fixes.patch" || return 1
patch -Np0 -i "${srcdir}/quote-strings-in-grub.cfg.patch" || return 1
msg2 "Done patching."
msg2 "Cloning the grub-extras repositories..."
export GRUB_CONTRIB="${srcdir}/grub-${_pkgver}/grub-extras/"
_build_dir "grub-extras"
for branch in "lua" "zfs" "gpxe" "ntldr-img" "915resolution"; do
if ! bzr revno "${branch}" &>/dev/null; then
bzr branch "${_grub_extras}/${branch}" || return 1
else
bzr update "${branch}" || return 1
fi
done
msg2 "Done cloning."
}
_build_grub2-bios() {
cd "${srcdir}"
_build_dir "build-grub2-bios"
"${srcdir}/grub-${pkgver}/configure" \
"${_common_options[@]}" \
--with-platform="pc" \
--target="${_native_arch}" \
|| return 1
make
}
_build_grub2-efi32() {
cd "${srcdir}"
_build_dir "build-grub2-efi32"
"${srcdir}/grub-${pkgver}/configure" \
"${_common_options[@]}" \
--with-platform="efi" \
--disable-efiemu \
--target="i386" \
|| return 1
make
}
_build_grub2-efi64() {
cd "${srcdir}"
_build_dir "build-grub2-efi64"
"${srcdir}/grub-${pkgver}/configure" \
"${_common_options[@]}" \
--with-platform="efi" \
--disable-efiemu \
--target="x86_64" \
|| return 1
make
}
build() {
_build_prepare || return 1
_build_grub2-bios || return 1
_build_grub2-efi32 || return 1
if [ "${CARCH}" == 'x86_64' ]; then
_build_grub2-efi64 || return 1
fi
}
package_grub2-common() {
pkgdesc="GNU GRUB is a Multiboot boot loader. (Common files and utilities.)"
depends=('xz' 'freetype2' 'gettext' 'device-mapper' 'fuse' 'os-prober')
conflicts=('grub')
install="grub2.install"
backup=('etc/default/grub' 'etc/grub.d/40_custom')
optdepends=('libisoburn: provides xorriso for generating grub rescue iso using grub-mkrescue'
'os-prober: to detect other operating systems when generating grub.cfg in BIOS systems'
'mtools: for grub-mkrescue FAT FS support')
options=('strip' 'purge' 'docs' 'zipman' '!emptydirs')
# install it
cd "${srcdir}/build-grub2-bios"
make install \
bashcompletiondir=/usr/share/bash-completion/completions \
DESTDIR="${pkgdir}"
# install Chakra files
install -D -m755 "${srcdir}/update-grub" "${pkgdir}/usr/sbin/update-grub"
install -D -m644 "${srcdir}/grub.default" "${pkgdir}/etc/default/grub"
# remove the architecture-dependant binaries from the package
rm -rf "${pkgdir}/usr/lib/grub/i386-pc"
}
package_grub2-bios() {
pkgdesc="GNU GRUB is a Multiboot boot loader. (BIOS support binaries.)"
depends=("grub2-common=${pkgver}")
options=('!strip' '!emptydirs')
local _bindir="${pkgdir}/usr/lib/grub/i386-pc"
local _tmpdir="/tmp/_grub2-bios_bindir"
# install it
cd "${srcdir}/build-grub2-bios"
make install \
bashcompletiondir=/usr/share/bash-completion/completions \
DESTDIR="${pkgdir}"
# save our binaries from the destruction!
mv "${_bindir}" "${_tmpdir}" || return 1
# remove the rest (which is provided by grub2-common)
rm -rf "${pkgdir}"/* || return 1
# restore the binaries directory
install -d -m755 "${pkgdir}/usr/lib/grub"
mv "${_tmpdir}" "${_bindir}" || return 1
# remove gdb debugging related files
rm -f "${_bindir}"/*.module
rm -f "${_bindir}"/*.image
rm -f "${_bindir}"/{kernel.exec,gdb_grub,gmodule.pl}
}
package_grub2-efi32() {
pkgdesc="GNU GRUB is a Multiboot boot loader. (EFI32 support binaries.)"
depends=("grub2-common=${pkgver}" 'dosfstools' 'efibootmgr')
conflicts=('grub2-efi-x32')
replaces=('grub2-efi-x32')
options=('!strip' '!emptydirs')
local _bindir="${pkgdir}/usr/lib/grub/i386-efi"
local _tmpdir="/tmp/_grub2-efi32_bindir"
# install it
cd "${srcdir}/build-grub2-efi32"
make install \
bashcompletiondir=/usr/share/bash-completion/completions \
DESTDIR="${pkgdir}"
# save our binaries from the destruction!
mv "${_bindir}" "${_tmpdir}" || return 1
# remove the rest (which is provided by grub2-common)
rm -rf "${pkgdir}"/* || return 1
# restore the binaries directory
install -d -m755 "${pkgdir}/usr/lib/grub"
mv "${_tmpdir}" "${_bindir}" || return 1
# remove gdb debugging related files
rm -f "${_bindir}"/*.module
rm -f "${_bindir}"/*.image
rm -f "${_bindir}"/{kernel.exec,gdb_grub,gmodule.pl}
}
package_grub2-efi64() {
pkgdesc="GNU GRUB is a Multiboot boot loader (EFI64 support binaries.)"
depends=("grub2-common=${pkgver}" 'dosfstools' 'efibootmgr')
conflicts=('grub2-efi-x64')
replaces=('grub2-efi-x64')
options=('!strip' '!emptydirs')
local _bindir="${pkgdir}/usr/lib/grub/x86_64-efi"
local _tmpdir="/tmp/_grub2-efi64_bindir"
# install it
cd "${srcdir}/build-grub2-efi64"
make install \
bashcompletiondir=/usr/share/bash-completion/completions \
DESTDIR="${pkgdir}"
# save our binaries from the destruction!
mv "${_bindir}" "${_tmpdir}" || return 1
# remove the rest (which is provided by grub2-common)
rm -rf "${pkgdir}"/* || return 1
# restore the binaries directory
install -d -m755 "${pkgdir}/usr/lib/grub"
mv "${_tmpdir}" "${_bindir}" || return 1
# remove gdb debugging related files
rm -f "${_bindir}"/*.module
rm -f "${_bindir}"/*.image
rm -f "${_bindir}"/{kernel.exec,gdb_grub,gmodule.pl}
}
# vim:set ts=2 sw=2 et:

View File

@ -1,107 +0,0 @@
diff -Naur a/util/grub-mkconfig.in b/util/grub-mkconfig.in
--- a/util/grub-mkconfig.in 2012-07-15 04:23:47.048814588 +0200
+++ b/util/grub-mkconfig.in 2012-07-15 04:28:57.870930879 +0200
@@ -35,6 +35,7 @@
pkgdatadir="${datadir}/@PACKAGE@"
fi
grub_cfg=""
+resume_hook=1
grub_mkconfig_dir="${sysconfdir}"/grub.d
self=`basename $0`
@@ -57,6 +58,7 @@
print_option_help "-o, --output=$(gettext FILE)" "$(gettext "output generated config to FILE [default=stdout]")"
print_option_help "-h, --help" "$(gettext "print this message and exit")"
print_option_help "-v, --version" "$(gettext "print the version information and exit")"
+ print_option_help "-s, --skip-resume" "$(gettext "disable resume hook setup")"
echo
gettext "Report bugs to <bug-grub@gnu.org>."; echo
}
@@ -90,6 +92,9 @@
--output=*)
grub_cfg=`echo "$option" | sed 's/--output=//'`
;;
+ -s | --skip-resume)
+ resume_hook=0
+ ;;
-*)
gettext_printf "Unrecognized option \`%s'\n" "$option" 1>&2
usage
@@ -216,7 +221,9 @@
GRUB_INIT_TUNE \
GRUB_SAVEDEFAULT \
GRUB_ENABLE_CRYPTODISK \
- GRUB_BADRAM
+ GRUB_BADRAM \
+ GRUB_COLOR_NORMAL \
+ GRUB_COLOR_HIGHLIGHT
if test "x${grub_cfg}" != "x"; then
rm -f "${grub_cfg}.new"
@@ -253,6 +260,19 @@
esac
done
+if [ "${resume_hook}" == 1 ]; then
+ echo "Setup resume hook" >&2
+ SWAP="$(swapon -a | cat /proc/swaps | grep /dev | cut -d ' ' -f 1)"
+ if [ -z "${SWAP}" ]; then
+ echo "No swap partition found. Create one to enable hibernation..." >&2
+ else
+ echo "Adding swap partition ${SWAP}" >&2
+ SWAPUUID="$(blkid "${SWAP}" -s UUID -o value)"
+ sed -e "s~root=/dev/~resume=/dev/disk/by-uuid/${SWAPUUID} root=/dev/~g" \
+ -i "${grub_cfg}.new"
+ fi
+fi
+
if test "x${grub_cfg}" != "x" ; then
if ! ${grub_script_check} ${grub_cfg}.new; then
# TRANSLATORS: %s is replaced by filename
diff -Naur a/util/grub.d/00_header.in b/util/grub.d/00_header.in
--- a/util/grub.d/00_header.in 2012-07-15 04:23:47.048814588 +0200
+++ b/util/grub.d/00_header.in 2012-07-15 04:24:03.873603848 +0200
@@ -115,6 +115,14 @@
EOF
+if [ -n "$GRUB_COLOR_NORMAL" ] && [ -n "$GRUB_COLOR_HIGHLIGHT" ] ; 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 -Naur a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
--- a/util/grub.d/10_linux.in 2012-07-15 04:23:47.048814588 +0200
+++ b/util/grub.d/10_linux.in 2012-07-15 04:24:03.874603867 +0200
@@ -31,8 +31,8 @@
if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
OS=GNU/Linux
else
- OS="${GRUB_DISTRIBUTOR} GNU/Linux"
- CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1) ${CLASS}"
+ OS="${GRUB_DISTRIBUTOR} Linux"
+ CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | tr -d ' ') ${CLASS}"
fi
# loop-AES arranges things so that /dev/loop/X can be our root device, but
@@ -195,10 +195,13 @@
"initrd-${version}" "initramfs-${version}.img" \
"initrd.img-${alt_version}" "initrd-${alt_version}.img" \
"initrd-${alt_version}" "initramfs-${alt_version}.img" \
+ "initramfs-linux-${version}" "initramfs-linux-${version}.img" \
+ "initramfs-linux-${alt_version}" "initramfs-linux-${alt_version}.img" \
"initramfs-genkernel-${version}" \
"initramfs-genkernel-${alt_version}" \
"initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \
- "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}"; do
+ "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}" \
+ "${basename/vmlinuz/kernel}.img"; do
if test -e "${dirname}/${i}" ; then
initrd="$i"
break

View File

@ -1,103 +0,0 @@
#!/bin/sh
## For actual repos
# bzr branch bzr://bzr.savannah.gnu.org/grub-extras/lua lua
# bzr branch bzr://bzr.savannah.gnu.org/grub-extras/gpxe gpxe
# bzr branch bzr://bzr.savannah.gnu.org/grub-extras/ntldr-img ntldr-img
# bzr branch bzr://bzr.savannah.gnu.org/grub-extras/915resolution 915resolution
## 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
## grub-extras zfs is integrated into grub2 bzr main repo and is no longer needed separately.
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/
main_snapshot() {
cd ${grub2_bzr_dir}/
echo
revnum=$(bzr revno ${grub2_bzr_dir})
bzr export --root=grub2 --format=tar ${output_dir}/grub2_r${revnum}.tar
echo
cd ${output_dir}/
xz -9 ${output_dir}/grub2_r${revnum}.tar
echo
}
exp_snapshot() {
cd ${grub2_bzr_exp_dir}/
echo
revnum=$(bzr revno ${grub2_bzr_exp_dir})
bzr export --root=grub2_exp --format=tar ${output_dir}/grub2_exp_r${revnum}.tar
echo
cd ${output_dir}/
xz -9 ${output_dir}/grub2_exp_r${revnum}.tar
echo
}
extras_snapshot() {
cd ${grub2_extras_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
echo
cd ${output_dir}/
echo
xz -9 ${output_dir}/grub2_extras_${grub2_extras_name}_r${revnum}.tar
echo
}
echo
set -x -e
# main_snapshot
# exp_snapshot
grub2_extras_name="lua"
extras_snapshot
grub2_extras_name="gpxe"
extras_snapshot
grub2_extras_name="ntldr-img"
extras_snapshot
grub2_extras_name="915resolution"
extras_snapshot
set +x +e
echo
unset wd
unset output_dir
unset grub2_bzr_dir
unset grub2_extras_dir
unset grub2_extras_name