rpms/grub/devel grub-0.97-nx-multiinstall.patch, NONE, 1.1 grub.spec, 1.36, 1.37

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Thu Mar 9 16:02:16 UTC 2006


Author: pjones

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

Modified Files:
	grub.spec 
Added Files:
	grub-0.97-nx-multiinstall.patch 
Log Message:
- add fix to allow "install" to be run multiple times concurrently within
  one session.


grub-0.97-nx-multiinstall.patch:
 builtins.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

--- NEW FILE grub-0.97-nx-multiinstall.patch ---
2006-03-09  Alexandre Oliva  <oliva at gnu.org>

	* lib/builtins.c (install_blocklist_helper): Move static
	last_lenght...
	(install_func_context): ... here.
	(install_func): Reset it.

Index: grub-0.97/stage2/builtins.c
===================================================================
--- grub-0.97.orig/stage2/builtins.c	2006-03-09 10:26:41.000000000 -0300
+++ grub-0.97/stage2/builtins.c	2006-03-09 11:36:18.000000000 -0300
@@ -1926,11 +1926,13 @@ static struct {
 	int saved_sector;
 	int installaddr;
 	int installlist;
+	int last_length;
 	char *stage2_first_buffer;
 } install_func_context = {
 	.saved_sector = 0,
 	.installaddr = 0,
 	.installlist = 0,
+	.last_length = SECTOR_SIZE,
 	.stage2_first_buffer = NULL,
 };
 
@@ -1960,19 +1962,19 @@ install_blocklist_helper (int sector, in
   int *installlist = &install_func_context.installlist;
   char **stage2_first_buffer = &install_func_context.stage2_first_buffer;
   /* Was the last sector full? */
-  static int last_length = SECTOR_SIZE;
+  int *last_length = &install_func_context.last_length;
 
   if (debug)
     printf("[%d]", sector);
 
-  if (offset != 0 || last_length != SECTOR_SIZE)
+  if (offset != 0 || *last_length != SECTOR_SIZE)
     {
       /* We found a non-sector-aligned data block. */
       errnum = ERR_UNALIGNED;
       return;
     }
 
-  last_length = length;
+  *last_length = length;
 
   if (*((unsigned long *) (*installlist - 4))
       + *((unsigned short *) *installlist) != sector
@@ -2027,7 +2029,11 @@ install_func (char *arg, int flags)
   int is_open = 0;
   /* If LBA is forced?  */
   int is_force_lba = 0;
+  int *last_length = &install_func_context.last_length;
   
+  /* Reset state.  */
+  *last_length = SECTOR_SIZE;
+
   *stage2_first_buffer = old_sect + SECTOR_SIZE;
 #ifdef GRUB_UTIL
   /* If the Stage 2 is in a partition mounted by an OS, this will store


Index: grub.spec
===================================================================
RCS file: /cvs/dist/rpms/grub/devel/grub.spec,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- grub.spec	14 Feb 2006 00:06:39 -0000	1.36
+++ grub.spec	9 Mar 2006 16:02:10 -0000	1.37
@@ -69,34 +69,34 @@
 
 # Mark the simulation stack executable
 Patch1104: grub-0.97-nxstack.patch
+Patch1105: grub-0.97-nx-multiinstall.patch
 
 # always use a full path for mdadm.
-Patch1105: grub-0.97-mdadm-path.patch
-
+Patch1110: grub-0.97-mdadm-path.patch
 # always install into the mbr if we're on a raid1 /boot.
-Patch1106: grub-0.95-md-mbr.patch
+Patch1111: grub-0.95-md-mbr.patch
 
 # gcc4 fixes.
-Patch1107: grub-0.97-gcc4.patch
+Patch1115: grub-0.97-gcc4.patch
 
 # Make non-MBR installs work again on non-raid1.
-Patch1108: grub-0.95-nonmbr.patch
+Patch1120: grub-0.95-nonmbr.patch
 
 # Make "grub-install --recheck" look like the menace it is.
-Patch1109: grub-0.95-recheck-bad.patch
+Patch1130: grub-0.95-recheck-bad.patch
 
 # Fix missing prototypes, since grub nicely sets -Wmissing-prototypes and
 # then tries to build conftests without them.
-Patch1110: grub-0.97-prototypes.patch
+Patch1135: grub-0.97-prototypes.patch
 
 # put /usr/lib/grub back in /usr/share/grub like it was before, so other
 # scripts don't screw up.
-Patch1111: grub-0.97-datadir.patch
+Patch1140: grub-0.97-datadir.patch
 
 # install correctly on dmraid devices
-Patch1112: grub-0.97-dmraid.patch
-Patch1113: grub-0.97-dmraid-recheck-bad.patch
-Patch1114: grub-0.97-dmraid-partition-names.patch
+Patch1145: grub-0.97-dmraid.patch
+Patch1146: grub-0.97-dmraid-recheck-bad.patch
+Patch1147: grub-0.97-dmraid-partition-names.patch
 
 ExclusiveArch: i386 x86_64
 BuildRequires: binutils >= 2.9.1.0.23, ncurses-devel, texinfo
@@ -152,23 +152,24 @@
 %patch1103 -p1 -b .splash-error-term
 
 %patch1104 -p1 -b .nxstack
+%patch1105 -p1 -b .nx-multiinstall
 
-%patch1105 -p1 -b .mdadm-path
-%patch1106 -p1 -b .md-mbr
+%patch1110 -p1 -b .mdadm-path
+%patch1111 -p1 -b .md-mbr
 
-%patch1107 -p1 -b .gcc4
+%patch1115 -p1 -b .gcc4
 
-%patch1108 -p1 -b .nonmbr
+%patch1120 -p1 -b .nonmbr
 
-%patch1109 -p1 -b .recheck-bad
+%patch1130 -p1 -b .recheck-bad
 
-%patch1110 -p1 -b .prototypes
+%patch1135 -p1 -b .prototypes
 
-%patch1111 -p1 -b .datadir
+%patch1140 -p1 -b .datadir
 
-%patch1112 -p1 -b .dmraid
-%patch1113 -p1 -b .dmraid-recheck-bad
-%patch1114 -p1 -b .dmraid-partition-names
+%patch1145 -p1 -b .dmraid
+%patch1146 -p1 -b .dmraid-recheck-bad
+%patch1147 -p1 -b .dmraid-partition-names
 
 %build
 autoreconf --install --force
@@ -222,6 +223,10 @@
 %{_datadir}/grub
 
 %changelog
+* Mon Mar  9 2006 Peter Jones <pjones at redhat.com> - 0.97-4
+- Fix running "install" multiple times on the same fs in the same invocation
+  of grub.  (bz #158426 , patch from lxo at redhat.com)
+
 * Mon Feb 13 2006 Peter Jones <pjones at redhat.com> - 0.97-3
 - fix partition names on dmraid
 




More information about the fedora-cvs-commits mailing list