summaryrefslogtreecommitdiff
path: root/libre
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@lavabit.com>2013-08-06 17:32:49 -0300
committerAndré Fabian Silva Delgado <emulatorman@lavabit.com>2013-08-06 17:32:49 -0300
commitfef4d5b1dc3c282916e79ae6680f3fc5bbea772b (patch)
tree83af926232bd0e8b59ff441e78b82c42e8170163 /libre
parentd8e7ab63409ee94ed006b2b0079864a1602f6db2 (diff)
grub-2.00.5086-1: updating version, fix https://bugs.archlinux.org/task/36349
Diffstat (limited to 'libre')
-rw-r--r--libre/grub/PKGBUILD9
-rw-r--r--libre/grub/archlinux_grub_mkconfig_fixes.patch143
-rw-r--r--libre/grub/grub-2.00.5086-fix-lvm-parsing.patch54
3 files changed, 203 insertions, 3 deletions
diff --git a/libre/grub/PKGBUILD b/libre/grub/PKGBUILD
index 2221fb7fe..1db67d42d 100644
--- a/libre/grub/PKGBUILD
+++ b/libre/grub/PKGBUILD
@@ -3,7 +3,7 @@
# Contributor: Keshav Padram (the.ridikulus.rat) (aatt) (gemmaeiil) (ddoott) (ccoomm)>
# Maintainer (Parabola): André Silva <emulatorman@lavabit.com>
-_GRUB_BZR_REV="5043"
+_GRUB_BZR_REV="5086"
## grub-extras lua and gpxe fail to build with grub bzr rev 5043
@@ -13,7 +13,7 @@ _GRUB_BZR_REV="5043"
pkgname=grub
pkgdesc="GNU GRand Unified Bootloader (2), (Parabola rebranded)"
pkgver=2.00.${_GRUB_BZR_REV}
-pkgrel=3
+pkgrel=1
url="https://www.gnu.org/software/grub/"
arch=('x86_64' 'i686')
license=('GPL3')
@@ -41,12 +41,14 @@ source=("grub-${pkgver}::bzr+bzr://bzr.savannah.gnu.org/grub/trunk/grub/#revisio
'parabola_grub_mkconfig_fixes.patch'
'60_memtest86+'
'grub.default'
- 'grub-2.00-mkinitcpio-0.15.patch')
+ 'grub-2.00-mkinitcpio-0.15.patch'
+ 'grub-2.00.5086-fix-lvm-parsing.patch')
md5sums=('SKIP'
'b3068b52b6f1dcd2850b5c7585bb185f'
'be55eabc102f2c60b38ed35c203686d6'
'52d374e0194e3f2e39ff7c92ecd58a6c'
'd25d2dcf8ba708dcf768fcaea799f59c'
+ '7a0ce6aa4a23fa12e1f79ab03fe63f88'
'SKIP'
'SKIP')
@@ -177,6 +179,7 @@ prepare() {
## fix 10_linux
patch -Np0 -i "${srcdir}/grub-2.00-mkinitcpio-0.15.patch"
+ patch -Np1 -i "${srcdir}/grub-2.00.5086-fix-lvm-parsing.patch"
## fix unifont.bdf location so that grub-mkfont can create *.pf2 files
sed 's|/usr/share/fonts/unifont|/usr/share/fonts/unifont /usr/share/fonts/misc|g' -i "${srcdir}/grub-${pkgver}/configure.ac"
diff --git a/libre/grub/archlinux_grub_mkconfig_fixes.patch b/libre/grub/archlinux_grub_mkconfig_fixes.patch
new file mode 100644
index 000000000..acbb9a7a8
--- /dev/null
+++ b/libre/grub/archlinux_grub_mkconfig_fixes.patch
@@ -0,0 +1,143 @@
+diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
+index 8decc1d..170047f 100644
+--- a/util/grub-mkconfig.in
++++ b/util/grub-mkconfig.in
+@@ -212,6 +212,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 2c4bb0a..c7120d2 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/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
+index 0724e16..a8119bd 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 | grub_add_tab
+ 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 '$(echo "$message" | grub_quote)'
+ linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
+@@ -190,7 +193,22 @@ 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" \
+@@ -198,7 +216,8 @@ while [ "x$list" != "x" ] ; do
+ "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}" \
++ "${initrd_arch}.img" ; do
+ if test -e "${dirname}/${i}" ; then
+ initrd="$i"
+ break
+@@ -226,6 +245,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}"
+@@ -239,8 +274,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}"
+@@ -252,8 +290,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/grub/grub-2.00.5086-fix-lvm-parsing.patch b/libre/grub/grub-2.00.5086-fix-lvm-parsing.patch
new file mode 100644
index 000000000..9a2eb3ff7
--- /dev/null
+++ b/libre/grub/grub-2.00.5086-fix-lvm-parsing.patch
@@ -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;