From 947201a73d145dfe050f06975963ba66e82252c1 Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@gmail.com>
Date: Tue, 24 Apr 2012 09:32:51 +0200
Subject: [PATCH] grub: added a patch from upstream to fix an obvious error in
 open(2).

---
 srcpkgs/grub/patches/open_wronly_device.patch | 15 +++++++++++++++
 srcpkgs/grub/template                         |  1 +
 2 files changed, 16 insertions(+)
 create mode 100644 srcpkgs/grub/patches/open_wronly_device.patch

diff --git a/srcpkgs/grub/patches/open_wronly_device.patch b/srcpkgs/grub/patches/open_wronly_device.patch
new file mode 100644
index 0000000000..ea835ff7d2
--- /dev/null
+++ b/srcpkgs/grub/patches/open_wronly_device.patch
@@ -0,0 +1,15 @@
+* grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_write): Fix opening
+  mode.
+
+2012-04-18  Vladimir Serbinenko  <address@hidden>
+
+--- grub-core/kern/emu/hostdisk.c       2012-04-18 21:48:52 +0000
++++ grub-core/kern/emu/hostdisk.c       2012-04-19 18:35:06 +0000
+@@ -1081,7 +1081,7 @@
+     {
+       int fd;
+       grub_disk_addr_t max = ~0ULL;
+-      fd = open_device (disk, sector, O_RDONLY, &max);
++      fd = open_device (disk, sector, O_WRONLY, &max);
+       if (fd < 0)
+        return grub_errno;
diff --git a/srcpkgs/grub/template b/srcpkgs/grub/template
index 94fee7b0e4..45710379d9 100644
--- a/srcpkgs/grub/template
+++ b/srcpkgs/grub/template
@@ -1,6 +1,7 @@
 # Template file for 'grub'
 pkgname=grub
 version="2.00~beta4"
+revision=1
 homepage="http://www.gnu.org/software/grub/"
 distfiles="http://alpha.gnu.org/gnu/grub/grub-$version.tar.xz"
 build_style=gnu-configure