Use Fix-tests-of-zeroed-partition patch by Mark Hamzy

This commit is contained in:
Dan Horák 2012-03-27 21:03:12 +02:00
parent 50b9a85a41
commit e91c7753ae
2 changed files with 30 additions and 1 deletions

View File

@ -0,0 +1,25 @@
From c8f67c2ee40815c075f1d6e5b3d6b504fbe204f5 Mon Sep 17 00:00:00 2001
From: Fedora Ninjas <pjones@fedoraproject.org>
Date: Sun, 25 Mar 2012 09:22:34 -0500
Subject: [PATCH] Fix tests of zeroed partition
---
util/grub-install.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/util/grub-install.in b/util/grub-install.in
index 9c1d133..e8638af 100644
--- a/util/grub-install.in
+++ b/util/grub-install.in
@@ -750,7 +750,7 @@ elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "i386-ieee1275" ]
exit 1
fi
- if [ "$(file -s "${install_device}" -b | awk '{ print $1 }')" = ELF ] || [ $(cmp /dev/zero "${install_device}" &>/dev/null) ]; then
+ if [ "$(file -s "${install_device}" -b | awk '{ print $1 }')" != ELF ] && ( cmp -s -n $(blockdev --getsize64 ${install_device}) /dev/zero "${install_device}" &>/dev/null ); then
# Change boot device to the harddisk root
boot_device="$ofpath"
dd if="${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform/core.${imgext}" of="${install_device}" status=noxfer || {
--
1.7.7.2

View File

@ -22,7 +22,7 @@
Name: grub2
Epoch: 1
Version: 1.99
Release: 19%{?dist}
Release: 19%{?dist}.1
Summary: Bootloader with support for Linux, Multiboot and more
Group: System Environment/Base
@ -38,6 +38,7 @@ Patch1: grub-1.99-grub_test_assert_printf.patch
Patch2: grub-1.99-just-say-linux.patch
Patch3: grub2-handle-initramfs-on-xen.patch
Patch9: grub-1.99-gcc-4.7.0.patch
Patch10: grub-1.99-Fix-tests-of-zeroed-partition.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -383,6 +384,9 @@ fi
%attr(0755,root,root)/%{_datarootdir}/grub/
%changelog
* Sun Mar 25 2012 Dan Horák <dan[at]danny.cz> - 1.99-19.1
- Use Fix-tests-of-zeroed-partition patch by Mark Hamzy
* Thu Mar 15 2012 Peter Jones <pjones@redhat.com> - 1.99-19
- Use --with-grubdir= on configure to make it behave like -17 did.