This applies under Linux only:

When commands change a disk without flushing, `grub' doesn't see the
contents when starting up.

KR
-- 
Klaus Reichl @ HOME     email: [EMAIL PROTECTED] 

Here the patch:
diff -ru --exclude-from=exclude.grub grub-99-11-06/ChangeLog grub/ChangeLog
--- grub-99-11-06/ChangeLog     Sat Nov  6 17:11:37 1999
+++ grub/ChangeLog      Sat Nov  6 21:34:41 1999
@@ -1,3 +1,44 @@
+1999-11-06  Klaus Reichl  <[EMAIL PROTECTED]>
+
+       * grub/asmstub.c (get_diskinfo) [__linux__]: After opening the
+       drive, flush the cache, other progs may have left over something
+       in the cache. 
+
diff -ru --exclude-from=exclude.grub grub-99-11-06/grub/asmstub.c grub/grub/asmstub.c
--- grub-99-11-06/grub/asmstub.c        Sat Nov  6 17:11:42 1999
+++ grub/grub/asmstub.c Sat Nov  6 21:35:58 1999
@@ -83,6 +83,7 @@
 unsigned long boot_drive = 0;
 char version_string[] = VERSION;
 char config_file[128] = "/boot/grub/menu.lst"; /* FIXME: arbitrary */
+char root_device[128];
 
 /* Emulation requirements. */
 char *grub_scratch_mem = 0;
@@ -915,6 +916,12 @@
              return -1;
            }
        }
+
+#ifdef __linux__
+      /* In Linux, invalidate the buffer cache, so that left overs 
+        from other program in the cache are flushed and seen by us */
+       ioctl (disks[drive].flags, BLKFLSBUF, 0);
+#endif
 
       /* Attempt to read the first sector.  */
       if (read (disks[drive].flags, buf, 512) != 512)

Reply via email to