Hi,

here's a simple patch which adds a `true' and a `false' command.
`true' is actually needed by the compatibility code generated by
grub-mkconfig for the terminal.

--
Felix Zielcke
2009-05-27  Felix Zielcke  <fziel...@z-51.de>

	* commands/minicmd.c (grub_mini_cmd_true): New function.
	(grub_mini_cmd_false): Likewise.
	(cmd_true, cmd_false): New static variables.
	(GRUB_MOD_INIT(minicmd)): Register commands true and false.
	(GRUB_MOD_FINI(minicmd)): Unregister commands true and false.

Index: commands/minicmd.c
===================================================================
--- commands/minicmd.c	(revision 2237)
+++ commands/minicmd.c	(working copy)
@@ -336,8 +336,27 @@ grub_mini_cmd_exit (struct grub_command 
   return 0;
 }
 
+/* true */
+static grub_err_t
+grub_mini_cmd_true (struct grub_command *cmd __attribute__ ((unused)),
+		    int argc __attribute__ ((unused)),
+		    char *argv[] __attribute__ ((unused)))
+{
+  return 0;
+}
+
+/* false */
+static grub_err_t
+grub_mini_cmd_false (struct grub_command *cmd __attribute__ ((unused)),
+		    int argc __attribute__ ((unused)),
+		    char *argv[] __attribute__ ((unused)))
+{
+  return 1;
+}
+
 static grub_command_t cmd_cat, cmd_help, cmd_root;
 static grub_command_t cmd_dump, cmd_rmmod, cmd_lsmod, cmd_exit;
+static grub_command_t cmd_true, cmd_false;
 
 GRUB_MOD_INIT(minicmd)
 {
@@ -362,6 +381,12 @@ GRUB_MOD_INIT(minicmd)
   cmd_exit =
     grub_register_command ("exit", grub_mini_cmd_exit,
 			   0, "exit from GRUB");
+  cmd_true =
+    grub_register_command ("true", grub_mini_cmd_true,
+			   0, "do nothing, successfully");
+  cmd_false =
+    grub_register_command ("false", grub_mini_cmd_true,
+			   0, "do nothing, unsuccessfully");
 }
 
 GRUB_MOD_FINI(minicmd)
@@ -373,4 +398,6 @@ GRUB_MOD_FINI(minicmd)
   grub_unregister_command (cmd_rmmod);
   grub_unregister_command (cmd_lsmod);
   grub_unregister_command (cmd_exit);
+  grub_unregister_command (cmd_true);
+  grub_unregister_command (cmd_false);
 }
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to