From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1M9I3x-0005eL-Uv for mharc-grub-devel@gnu.org; Wed, 27 May 2009 08:16:53 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M9I3u-0005bA-Vk for grub-devel@gnu.org; Wed, 27 May 2009 08:16:51 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M9I3q-0005XU-SY for grub-devel@gnu.org; Wed, 27 May 2009 08:16:50 -0400 Received: from [199.232.76.173] (port=42812 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M9I3q-0005XO-N0 for grub-devel@gnu.org; Wed, 27 May 2009 08:16:46 -0400 Received: from moutng.kundenserver.de ([212.227.126.171]:52017) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M9I3q-0004HT-56 for grub-devel@gnu.org; Wed, 27 May 2009 08:16:46 -0400 Received: from [85.180.0.85] (e180000085.adsl.alicedsl.de [85.180.0.85]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0MKv5w-1M9I3o0jUc-0001N7; Wed, 27 May 2009 14:16:44 +0200 From: Felix Zielcke To: The development of GRUB 2 Content-Type: multipart/mixed; boundary="=-FhWZxgu0vpvxXnTcmPhK" Date: Wed, 27 May 2009 14:16:43 +0200 Message-Id: <1243426603.3425.2.camel@fz.local> Mime-Version: 1.0 X-Mailer: Evolution 2.26.2 X-Provags-ID: V01U2FsdGVkX1/6ObB/EyKW++ZZmuZuYmXNXEDB7YEX/Ky8oPq b4M6AZf4/8ofDuZEMaLrOZSaQNey86O0zP0B6WU4YvFLMYeyXZ NMy6/p68+fFst24Y3r8Eg== X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [PATCH] add true and false commands X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 May 2009 12:16:51 -0000 --=-FhWZxgu0vpvxXnTcmPhK Content-Type: text/plain Content-Transfer-Encoding: 7bit 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 --=-FhWZxgu0vpvxXnTcmPhK Content-Disposition: attachment; filename="true_false.patch" Content-Type: text/x-patch; name="true_false.patch"; charset="UTF-8" Content-Transfer-Encoding: 7bit 2009-05-27 Felix Zielcke * 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); } --=-FhWZxgu0vpvxXnTcmPhK--