All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] grub-probefs --root-device
@ 2006-09-22 16:33 Robert Millan
  2006-09-22 21:12 ` Robert Millan
  2006-09-23  3:20 ` Yoshinori K. Okuji
  0 siblings, 2 replies; 16+ messages in thread
From: Robert Millan @ 2006-09-22 16:33 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 626 bytes --]


This would be very useful to get rid of ugly kludges in Debian, such as this
one:
  http://svn.debian.org/wsvn/pkg-grub/grub2/trunk/debian/update-grub?op=file&rev=0&sc=0
  (look for convert() here)

Fortunately grub-probefs is already doing what we need, we just need a way to
tell it to print the information.

2006-09-22  Robert Millan  <rmh@aybabtu.com>

	* util/i386/pc/grub-probefs.c: Add -r|--root-device option (print
	guessed root device and exit).

-- 
Robert Millan

My spam trap is honeypot@aybabtu.com.  Note: this address is only intended for
spam harvesters.  Writing to it will get you added to my black list.

[-- Attachment #2: print_root.diff --]
[-- Type: text/plain, Size: 1644 bytes --]

2006-09-22  Robert Millan  <rmh@aybabtu.com>

	* util/i386/pc/grub-probefs.c: Add -r|--root-device option (print
	guessed root device and exit).

Index: util/i386/pc/grub-probefs.c
===================================================================
RCS file: /sources/grub/grub2/util/i386/pc/grub-probefs.c,v
retrieving revision 1.3
diff -u -r1.3 grub-probefs.c
--- util/i386/pc/grub-probefs.c	23 Apr 2006 13:37:36 -0000	1.3
+++ util/i386/pc/grub-probefs.c	22 Sep 2006 16:05:08 -0000
@@ -47,6 +47,8 @@
 
 #define DEFAULT_DEVICE_MAP	DEFAULT_DIRECTORY "/device.map"
 
+int print_root = 0;
+
 void
 grub_putchar (int c)
 {
@@ -84,6 +86,12 @@
       return;
     }
 
+  if (print_root)
+    {
+      printf ("(%s)\n", device_name);
+      return;
+    }
+
   grub_util_info ("opening %s", device_name);
   dev = grub_device_open (device_name);
   if (! dev)
@@ -121,6 +129,7 @@
 Probe a filesystem module for a given path.\n\
 \n\
   -m, --device-map=FILE     use FILE as the device map [default=%s]\n\
+  -r, --root-device         print guessed root device and exit\n\
   -h, --help                display this message and exit\n\
   -V, --version             print version information and exit\n\
   -v, --verbose             print verbose messages\n\
@@ -143,7 +152,7 @@
   /* Check for options.  */
   while (1)
     {
-      int c = getopt_long (argc, argv, "m:hVv", options, 0);
+      int c = getopt_long (argc, argv, "m:rhVv", options, 0);
       
       if (c == -1)
 	break;
@@ -157,6 +166,10 @@
 	    dev_map = xstrdup (optarg);
 	    break;
 
+	  case 'r':
+	    print_root=1;
+	    break;
+
 	  case 'h':
 	    usage (0);
 	    break;

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2006-10-14 19:11 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-22 16:33 [PATCH] grub-probefs --root-device Robert Millan
2006-09-22 21:12 ` Robert Millan
2006-09-23  3:20 ` Yoshinori K. Okuji
2006-09-23  7:26   ` Robert Millan
2006-09-23  8:37     ` Robert Millan
2006-09-25 10:09       ` Robert Millan
2006-09-26  2:42         ` grub 2 on debian amd64 Colin Lamarre
2006-09-26  2:53           ` Hollis Blanchard
2006-09-26 16:32           ` Robert Millan
2006-09-26 17:29     ` [PATCH] grub-probefs --root-device Vesa Jääskeläinen
2006-09-28 14:39       ` Robert Millan
2006-10-01 19:27         ` Robert Millan
2006-10-14 10:06           ` ping (Re: [PATCH] grub-probefs --root-device) Robert Millan
2006-10-14 10:10             ` Yoshinori K. Okuji
2006-10-14 19:04               ` Robert Millan
2006-10-14 19:11                 ` Robert Millan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.