From 03edba0cf600c515a6e8c1eb5965437aa426ef1a Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Mon, 17 Jun 2013 10:41:50 +0000 Subject: [PATCH] fix #33692 and #30770 --- 20_memtest86+ | 29 ----------------------------- 60_memtest86+ | 32 ++++++++++++++++++++++++++++++++ PKGBUILD | 28 ++++++++++++++-------------- 3 files changed, 46 insertions(+), 43 deletions(-) delete mode 100644 20_memtest86+ create mode 100644 60_memtest86+ diff --git a/20_memtest86+ b/20_memtest86+ deleted file mode 100644 index 1d3096f..0000000 --- a/20_memtest86+ +++ /dev/null @@ -1,29 +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}" - -datarootdir="/usr/share" -datadir="${datarootdir}" - -. "${datadir}/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 diff --git a/60_memtest86+ b/60_memtest86+ new file mode 100644 index 0000000..064922e --- /dev/null +++ b/60_memtest86+ @@ -0,0 +1,32 @@ +#!/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}" + +. "${datadir}/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 + _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 [ "${grub_platform}" == "pc" ]; 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 diff --git a/PKGBUILD b/PKGBUILD index 24e7b77..148c505 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -8,7 +8,7 @@ _grub_915_ver=9 pkgname=('grub-common' 'grub-bios' 'grub-efi-i386') pkgbase=grub pkgver=2.00 -pkgrel=3 +pkgrel=4 url="https://www.gnu.org/software/grub/" arch=('i686' 'x86_64') license=('GPL3') @@ -22,10 +22,21 @@ source=("http://ftp.gnu.org/gnu/grub/grub-${pkgver}.tar.xz" 'archlinux_grub_mkconfig_fixes.patch' 'grub.default' 'grub.cfg' - '20_memtest86+' + '60_memtest86+' 'grub_bzr_export.sh' '0069-Backport-gnulib-fixes-for-C11.-Fixes-Savannah-bug-37.patch' 'grub-2.00-fix-docs.patch') +md5sums=('a1043102fbc7bcedbf53e7ee3d17ab91' + '704ea9f250b6137f05fa0197fd07053a' + '77f7d5f8ce395663cd7fff4d37099957' + 'a80e2b1d3bab778c3b6117d5a698992f' + '3b3dae993939b4e323f19365dd830e12' + 'a03ffd56324520393bf574cefccb893d' + 'f184b060fe22eca662ad455c69241496' + 'ae9f1bc1a579ddc88b9b2e8b46f7e1d5' + 'f343ed2340ebc86c427873641bb72419' + 'ab751d1d8cd3fd47e5ee24d71ecc31ed' + '342dd18472a24e5fd252458b24f39a29') noextract=("grub2_extras_lua_r${_grub_lua_ver}.tar.xz" "grub2_extras_ntldr-img_r${_grub_ntldr_ver}.tar.xz" @@ -198,7 +209,7 @@ package_grub-common() { echo ## install extra /etc/grub.d/ files - install -D -m0755 "${srcdir}/20_memtest86+" "${pkgdir}/etc/grub.d/20_memtest86+" + install -D -m0755 "${srcdir}/60_memtest86+" "${pkgdir}/etc/grub.d/60_memtest86+" ## install /etc/default/grub (used by grub-mkconfig) install -D -m0644 "${srcdir}/grub.default" "${pkgdir}/etc/default/grub" @@ -256,14 +267,3 @@ package_grub-efi-i386() { rm -f "${pkgdir}/usr/lib/grub/i386-efi"/{kernel.exec,gdb_grub,gmodule.pl} || true } -md5sums=('a1043102fbc7bcedbf53e7ee3d17ab91' - '704ea9f250b6137f05fa0197fd07053a' - '77f7d5f8ce395663cd7fff4d37099957' - 'a80e2b1d3bab778c3b6117d5a698992f' - '3b3dae993939b4e323f19365dd830e12' - 'a03ffd56324520393bf574cefccb893d' - 'f184b060fe22eca662ad455c69241496' - '9b6358d3de5c4bb95a041ab7c44a21ec' - 'f343ed2340ebc86c427873641bb72419' - 'ab751d1d8cd3fd47e5ee24d71ecc31ed' - '342dd18472a24e5fd252458b24f39a29')