From 21f82f82c8a0bb9908707aef10150a5e7166284e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 17 Dec 2013 16:56:45 +0100 Subject: [PATCH 1/1] fix all... --- PKGBUILD | 12 +++++-- archlinux_grub_mkconfig_fixes.patch | 2 +- fix_install.patch | 65 +++++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 fix_install.patch diff --git a/PKGBUILD b/PKGBUILD index 900c51b..2941e11 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -13,7 +13,7 @@ _GRUB_GIT_COMMIT="5ae5c54c7e5cb048cdd78a53181cee0da698a953" pkgname="grub" pkgdesc="GNU GRand Unified Bootloader (2)" pkgver=2.00.1282.g5ae5c54 -pkgrel=1 +pkgrel=2 epoch="1" url="https://www.gnu.org/software/grub/" arch=('x86_64' 'i686') @@ -40,6 +40,7 @@ optdepends=('freetype2: For grub-mkfont usage' # source=("http://ftp.gnu.org/gnu/grub/grub-${pkgver}.tar.xz" source=("grub-${_pkgver}::git+git://git.sv.gnu.org/grub.git#commit=${_GRUB_GIT_COMMIT}" + 'fix_install.patch' 'http://unifoundry.com/unifont-5.1.20080820.bdf.gz' 'archlinux_grub_mkconfig_fixes.patch' '60_memtest86+' @@ -47,8 +48,9 @@ source=("grub-${_pkgver}::git+git://git.sv.gnu.org/grub.git#commit=${_GRUB_GIT_C 'grub.cfg') md5sums=('SKIP' + '7fa7ab1cd6970f6b65973ad0219f4546' '6b8263ceccef33bd633aa019d74b7943' - 'b9cbff4a67e463722a113c66d57c4042' + 'ee3023893ad23d99b83a9a339b7f0b99' 'be55eabc102f2c60b38ed35c203686d6' 'a03ffd56324520393bf574cefccb893d' 'c8b9511586d57d6f2524ae7898397a46' @@ -68,6 +70,12 @@ pkgver() { prepare() { cd "${srcdir}/grub-${_pkgver}/" + + msg "Patch to fix partition module names" + patch -Np1 -i "${srcdir}/fix_install.patch" + + msg "fix freetype2" + sed -i 's|freetype/ftsynth.h|freetype2/ftsynth.h|' util/grub-mkfont.c util/grub-gen-asciih.c util/grub-gen-widthspec.c msg "Patch to enable grub-mkconfig detect Arch kernels and initramfs" patch -Np1 -i "${srcdir}/archlinux_grub_mkconfig_fixes.patch" diff --git a/archlinux_grub_mkconfig_fixes.patch b/archlinux_grub_mkconfig_fixes.patch index c87a428..e28a939 100644 --- a/archlinux_grub_mkconfig_fixes.patch +++ b/archlinux_grub_mkconfig_fixes.patch @@ -100,7 +100,7 @@ index e27d6f7..0a255f5 100644 fi + if test -e "/etc/arch-release" ; then -+ is_first_entry="false" ++ is_top_level=false + + linux_entry "${OS}" "${version}" true \ + "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" diff --git a/fix_install.patch b/fix_install.patch new file mode 100644 index 0000000..f4b5c6f --- /dev/null +++ b/fix_install.patch @@ -0,0 +1,65 @@ +diff --git a/util/grub-install.c b/util/grub-install.c +index db5e0c3..4cc557e 100644 +--- a/util/grub-install.c ++++ b/util/grub-install.c +@@ -323,6 +323,21 @@ probe_raid_level (grub_disk_t disk) + } + + static void ++push_partmap_module (const char *map) ++{ ++ char buf[50]; ++ ++ if (strcmp (map, "openbsd") == 0 || strcmp (map, "netbsd") == 0) ++ { ++ grub_install_push_module ("part_bsd"); ++ return; ++ } ++ ++ snprintf (buf, sizeof (buf), "part_%s", map); ++ grub_install_push_module (buf); ++} ++ ++static void + probe_mods (grub_disk_t disk) + { + grub_partition_t part; +@@ -333,21 +348,11 @@ probe_mods (grub_disk_t disk) + grub_util_info ("no partition map found for %s", disk->name); + + for (part = disk->partition; part; part = part->parent) +- { +- char buf[50]; +- if (strcmp (part->partmap->name, "openbsd") == 0 +- || strcmp (part->partmap->name, "netbsd") == 0) +- { +- grub_install_push_module ("part_bsd"); +- continue; +- } +- snprintf (buf, sizeof (buf), "part_%s", part->partmap->name); +- grub_install_push_module (buf); +- } ++ push_partmap_module (part->partmap->name); + + if (disk->dev->id == GRUB_DISK_DEVICE_DISKFILTER_ID) + { +- grub_diskfilter_get_partmap (disk, grub_install_push_module); ++ grub_diskfilter_get_partmap (disk, push_partmap_module); + have_abstractions = 1; + } + +@@ -1098,7 +1103,13 @@ main (int argc, char *argv[]) + { + if (install_device[0] == '(' + && install_device[grub_strlen (install_device) - 1] == ')') +- install_drive = xstrdup (install_device); ++ { ++ ++ size_t len = grub_strlen (install_device) - 2; ++ install_drive = xmalloc (len + 1); ++ memcpy (install_drive, install_device + 1, len); ++ install_drive[len] = '\0'; ++ } + else + { + grub_util_pull_device (install_device); -- 1.8.5.1