[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

rpms/grub/FC-4 grub-0.95-recheck-bad.patch, NONE, 1.1 grub.spec, 1.27, 1.28



Author: pjones

Update of /cvs/dist/rpms/grub/FC-4
In directory cvs.devel.redhat.com:/tmp/cvs-serv22806

Modified Files:
	grub.spec 
Added Files:
	grub-0.95-recheck-bad.patch 
Log Message:
grub-install --recheck fixes.


grub-0.95-recheck-bad.patch:
 docs/grub-install.8  |    2 ++
 docs/grub.info       |    4 ++--
 docs/grub.texi       |    5 +++--
 util/grub-install.in |   17 +++++++++++++++--
 4 files changed, 22 insertions(+), 6 deletions(-)

--- NEW FILE grub-0.95-recheck-bad.patch ---
--- grub-0.95/docs/grub.texi.recheck-bad	2005-07-25 17:55:57.000000000 -0400
+++ grub-0.95/docs/grub.texi	2005-07-25 17:58:00.000000000 -0400
@@ -3417,8 +3417,9 @@
 
 @item --recheck
 Recheck the device map, even if @file{/boot/grub/device.map} already
-exists. You should use this option whenever you add/remove a disk
-into/from your computer.
+exists.
+
+This option is unreliable and its use is strongly discouraged.
 @end table
 
 
--- grub-0.95/util/grub-install.in.recheck-bad	2005-07-25 17:58:19.000000000 -0400
+++ grub-0.95/util/grub-install.in	2005-07-25 18:05:14.000000000 -0400
@@ -68,6 +68,8 @@
   --force-lba             force GRUB to use LBA mode even for a buggy
                           BIOS
   --recheck               probe a device map even if it already exists
+                          This flag is unreliable and its use is
+                          strongly discouraged.
 
 INSTALL_DEVICE can be a GRUB device name or a system device filename.
 
@@ -328,7 +330,7 @@
 
 # If --recheck is specified, remove the device map, if present.
 if test $recheck = yes; then
-    rm -f $device_map
+    mv $device_map ${device_map}.backup
 fi
 
 # Create the device map file if it is not present.
@@ -357,7 +359,18 @@
 tmp=`sed -n '/^([fh]d[0-9]*)/s/\(^(.*)\).*/\1/p' $device_map \
     | sort | uniq -d | sed -n 1p`
 if test -n "$tmp"; then
-    echo "The drive $tmp is defined multiple times in the device map $device_map" 1>&2
+    echo "The drive $tmp is defined multiple times in the new device map," 1>&2
+    echo "reverting to backed up copy." 1>&2
+    mv ${device_map}.backup $device_map
+    exit 1
+fi
+
+# Make sure device.map has at least one hd device
+grep -q "^(hd[0-9])" $device_map
+if [ "x$?" == "x0" ]; then
+    echo "No suitable drive was found in the generated device map, " 1>&2
+    echo "reverting to backed up copy." 1>&2
+    mv ${device_map}.backup $device_map
     exit 1
 fi
 
--- grub-0.95/docs/grub-install.8.recheck-bad	2004-06-13 13:44:59.000000000 -0400
+++ grub-0.95/docs/grub-install.8	2005-07-25 18:15:02.000000000 -0400
@@ -30,6 +30,8 @@
 .TP
 \fB\-\-recheck\fR
 probe a device map even if it already exists
+
+This option is unreliable and its use is strongly discouraged.
 .PP
 INSTALL_DEVICE can be a GRUB device name or a system device filename.
 .SH "REPORTING BUGS"
--- grub-0.95/docs/grub.info.recheck-bad	2004-05-11 08:22:54.000000000 -0400
+++ grub-0.95/docs/grub.info	2005-07-25 18:16:09.000000000 -0400
@@ -3373,9 +3373,9 @@
 
 `--recheck'
      Recheck the device map, even if `/boot/grub/device.map' already
-     exists. You should use this option whenever you add/remove a disk
-     into/from your computer.
+     exists.
 
+     This option is unreliable and its use is strongly discouraged.
 
 File: grub.info,  Node: Invoking grub-md5-crypt,  Next: Invoking grub-terminfo,  Prev: Invoking grub-install,  Up: Top
 


Index: grub.spec
===================================================================
RCS file: /cvs/dist/rpms/grub/FC-4/grub.spec,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- grub.spec	20 May 2005 03:33:32 -0000	1.27
+++ grub.spec	25 Jul 2005 22:25:38 -0000	1.28
@@ -1,6 +1,6 @@
 Name: grub
 Version: 0.95
-Release: 13
+Release: 14
 Summary: GRUB - the Grand Unified Boot Loader.
 Group: System Environment/Base
 License: GPL
@@ -84,6 +84,9 @@
 # Make non-MBR installs work again on non-raid1.
 Patch1108: grub-0.95-nonmbr.patch
 
+# Make "grub-install --recheck" look like the menace it is.
+Patch1109: grub-0.95-recheck-bad.patch
+
 ExclusiveArch: i386 x86_64
 BuildRequires: binutils >= 2.9.1.0.23, ncurses-devel, texinfo
 BuildRequires: automake
@@ -147,6 +150,8 @@
 
 %patch1108 -p1 -b .nonmbr
 
+%patch1109 -p1 -b .recheck-bad
+
 %build
 autoreconf --install --force
 GCCVERS=$(gcc --version | head -1 | cut -d\  -f3 | cut -d. -f1)
@@ -198,6 +203,10 @@
 %{_datadir}/grub
 
 %changelog
+* Mon Jul 25 2005 Peter Jones <pjones redhat com> 0.95-14
+- Make "grub-install --recheck" warn the user about how bad it is,
+  and keep a backup file, which it reverts to upon detecting some errors.
+
 * Thu May 19 2005 Peter Jones <pjones redhat com> 0.95-13
 - Make the spec work with gcc3 and gcc4, so people can test on existing
   installations.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]