All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] add true and false commands
@ 2009-05-27 12:16 Felix Zielcke
  2009-05-30 15:14 ` Vladimir 'phcoder' Serbinenko
  0 siblings, 1 reply; 14+ messages in thread
From: Felix Zielcke @ 2009-05-27 12:16 UTC (permalink / raw)
  To: The development of GRUB 2

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

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

[-- Attachment #2: true_false.patch --]
[-- Type: text/x-patch, Size: 1815 bytes --]

2009-05-27  Felix Zielcke  <fzielcke@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);
 }

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

* Re: [PATCH] add true and false commands
  2009-05-27 12:16 [PATCH] add true and false commands Felix Zielcke
@ 2009-05-30 15:14 ` Vladimir 'phcoder' Serbinenko
  2009-06-01 14:18   ` Felix Zielcke
  0 siblings, 1 reply; 14+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2009-05-30 15:14 UTC (permalink / raw)
  To: The development of GRUB 2

On Wed, May 27, 2009 at 2:16 PM, Felix Zielcke <fzielcke@z-51.de> wrote:
> 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.
As far as I understand they are useful only in normal mode. Perhaps
putting them into normal.mod or sh.mod would make more sense?
>
> --
> Felix Zielcke
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
>



-- 
Regards
Vladimir 'phcoder' Serbinenko



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

* Re: [PATCH] add true and false commands
  2009-05-30 15:14 ` Vladimir 'phcoder' Serbinenko
@ 2009-06-01 14:18   ` Felix Zielcke
  2009-06-01 14:24     ` Vladimir 'phcoder' Serbinenko
  0 siblings, 1 reply; 14+ messages in thread
From: Felix Zielcke @ 2009-06-01 14:18 UTC (permalink / raw)
  To: The development of GRUB 2

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

Am Samstag, den 30.05.2009, 17:14 +0200 schrieb Vladimir 'phcoder'
Serbinenko:
> On Wed, May 27, 2009 at 2:16 PM, Felix Zielcke <fzielcke@z-51.de> wrote:
> > 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.
> As far as I understand they are useful only in normal mode. Perhaps
> putting them into normal.mod or sh.mod would make more sense?

Ok here's a new patch which places them into normal.mod.
Does a `false' command actually make sense in grub?
-- 
Felix Zielcke

[-- Attachment #2: true_false.patch.2 --]
[-- Type: text/plain, Size: 1723 bytes --]

2009-06-01  Felix Zielcke  <fzielcke@z-51.de>

	* normal/main.c (grub_cmd_true): New function.
	(grub_mini_cmd_false): Likewise.
	(cmd_true): New static variable.
	(cmd_false): Likewise.
	(GRUB_MOD_INIT(minicmd)): Register commands true and false.
	(GRUB_MOD_FINI(minicmd)): Unregister commands true and false.

diff --git a/normal/main.c b/normal/main.c
index 9c5a827..c08f3b9 100644
--- a/normal/main.c
+++ b/normal/main.c
@@ -536,6 +536,26 @@ grub_env_write_pager (struct grub_env_var *var __attribute__ ((unused)),
   return grub_strdup (val);
 }
 
+/* true */
+static grub_err_t
+grub_cmd_true (struct grub_command *cmd __attribute__ ((unused)),
+		    int argc __attribute__ ((unused)),
+		    char *argv[] __attribute__ ((unused)))
+{
+  return 0;
+}
+
+/* false */
+static grub_err_t
+grub_cmd_false (struct grub_command *cmd __attribute__ ((unused)),
+		    int argc __attribute__ ((unused)),
+		    char *argv[] __attribute__ ((unused)))
+{
+  return 1;
+}
+
+static grub_command_t cmd_true, cmd_false;
+
 GRUB_MOD_INIT(normal)
 {
   /* Normal mode shouldn't be unloaded.  */
@@ -561,6 +581,13 @@ GRUB_MOD_INIT(normal)
   /* Preserve hooks after context changes.  */
   grub_env_export ("color_normal");
   grub_env_export ("color_highlight");
+
+  cmd_true =
+    grub_register_command ("true", grub_cmd_true,
+			   0, "do nothing, successfully");
+  cmd_false =
+    grub_register_command ("false", grub_cmd_true,
+			   0, "do nothing, unsuccessfully");
 }
 
 GRUB_MOD_FINI(normal)
@@ -570,4 +597,6 @@ GRUB_MOD_FINI(normal)
   grub_register_variable_hook ("pager", 0, 0);
   grub_fs_autoload_hook = 0;
   free_handler_list ();
+  grub_unregister_command (cmd_true);
+  grub_unregister_command (cmd_false);
 }

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

* Re: [PATCH] add true and false commands
  2009-06-01 14:18   ` Felix Zielcke
@ 2009-06-01 14:24     ` Vladimir 'phcoder' Serbinenko
  2009-06-03 15:45       ` Felix Zielcke
  0 siblings, 1 reply; 14+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2009-06-01 14:24 UTC (permalink / raw)
  To: The development of GRUB 2

On Mon, Jun 1, 2009 at 4:18 PM, Felix Zielcke <fzielcke@z-51.de> wrote:
> Am Samstag, den 30.05.2009, 17:14 +0200 schrieb Vladimir 'phcoder'
> Serbinenko:
>> On Wed, May 27, 2009 at 2:16 PM, Felix Zielcke <fzielcke@z-51.de> wrote:
>> > 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.
>> As far as I understand they are useful only in normal mode. Perhaps
>> putting them into normal.mod or sh.mod would make more sense?
>
> Ok here's a new patch which places them into normal.mod.
> Does a `false' command actually make sense in grub?
It does since we make bash-similar scripting. However convention for
creating false is:
  return grub_error (GRUB_ERR_TEST_FAILURE, "false");
and not
  return 1;
> --
> Felix Zielcke
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
>



-- 
Regards
Vladimir 'phcoder' Serbinenko



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

* Re: [PATCH] add true and false commands
  2009-06-01 14:24     ` Vladimir 'phcoder' Serbinenko
@ 2009-06-03 15:45       ` Felix Zielcke
  2009-06-04  8:21         ` Marco Gerards
  0 siblings, 1 reply; 14+ messages in thread
From: Felix Zielcke @ 2009-06-03 15:45 UTC (permalink / raw)
  To: The development of GRUB 2

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

Am Montag, den 01.06.2009, 16:24 +0200 schrieb Vladimir 'phcoder'
Serbinenko:
> However convention for
> creating false is:
>   return grub_error (GRUB_ERR_TEST_FAILURE, "false");
> and not
>   return 1;

Ok changed it. If everyone is fine with placing this in normal/main.c, I
commit it.
-- 
Felix Zielcke

[-- Attachment #2: true_false.patch.3 --]
[-- Type: text/plain, Size: 1758 bytes --]

2009-06-03  Felix Zielcke  <fzielcke@z-51.de>

	* normal/main.c (grub_cmd_true): New function.
	(grub_cmd_false): Likewise.
	(cmd_true): New static variable.
	(cmd_false): Likewise.
	(GRUB_MOD_INIT(normal)): Register commands true and false.
	(GRUB_MOD_FINI(normal)): Unregister commands true and false.

diff --git a/normal/main.c b/normal/main.c
index 9c5a827..ac657d7 100644
--- a/normal/main.c
+++ b/normal/main.c
@@ -536,6 +536,26 @@ grub_env_write_pager (struct grub_env_var *var __attribute__ ((unused)),
   return grub_strdup (val);
 }
 
+/* true */
+static grub_err_t
+grub_cmd_true (struct grub_command *cmd __attribute__ ((unused)),
+		    int argc __attribute__ ((unused)),
+		    char *argv[] __attribute__ ((unused)))
+{
+  return 0;
+}
+
+/* false */
+static grub_err_t
+grub_cmd_false (struct grub_command *cmd __attribute__ ((unused)),
+		    int argc __attribute__ ((unused)),
+		    char *argv[] __attribute__ ((unused)))
+{
+  return grub_error (GRUB_ERR_TEST_FAILURE, "false");
+}
+
+static grub_command_t cmd_true, cmd_false;
+
 GRUB_MOD_INIT(normal)
 {
   /* Normal mode shouldn't be unloaded.  */
@@ -561,6 +581,13 @@ GRUB_MOD_INIT(normal)
   /* Preserve hooks after context changes.  */
   grub_env_export ("color_normal");
   grub_env_export ("color_highlight");
+
+  cmd_true =
+    grub_register_command ("true", grub_cmd_true,
+			   0, "do nothing, successfully");
+  cmd_false =
+    grub_register_command ("false", grub_cmd_true,
+			   0, "do nothing, unsuccessfully");
 }
 
 GRUB_MOD_FINI(normal)
@@ -570,4 +597,6 @@ GRUB_MOD_FINI(normal)
   grub_register_variable_hook ("pager", 0, 0);
   grub_fs_autoload_hook = 0;
   free_handler_list ();
+  grub_unregister_command (cmd_true);
+  grub_unregister_command (cmd_false);
 }

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

* Re: [PATCH] add true and false commands
  2009-06-03 15:45       ` Felix Zielcke
@ 2009-06-04  8:21         ` Marco Gerards
  2009-06-05  8:47           ` Felix Zielcke
  0 siblings, 1 reply; 14+ messages in thread
From: Marco Gerards @ 2009-06-04  8:21 UTC (permalink / raw)
  To: The development of GRUB 2

Felix Zielcke <fzielcke@z-51.de> writes:

> Am Montag, den 01.06.2009, 16:24 +0200 schrieb Vladimir 'phcoder'
> Serbinenko:
>> However convention for
>> creating false is:
>>   return grub_error (GRUB_ERR_TEST_FAILURE, "false");
>> and not
>>   return 1;
>
> Ok changed it. If everyone is fine with placing this in normal/main.c, I
> commit it.

Unless it is essential to do so, please do not place it in
normal/main.c.

--
Marco




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

* Re: [PATCH] add true and false commands
  2009-06-04  8:21         ` Marco Gerards
@ 2009-06-05  8:47           ` Felix Zielcke
  2009-06-05 10:00             ` Marco Gerards
  0 siblings, 1 reply; 14+ messages in thread
From: Felix Zielcke @ 2009-06-05  8:47 UTC (permalink / raw)
  To: The development of GRUB 2

Am Donnerstag, den 04.06.2009, 10:21 +0200 schrieb Marco Gerards:
> Felix Zielcke <fzielcke@z-51.de> writes:
> 
> > Am Montag, den 01.06.2009, 16:24 +0200 schrieb Vladimir 'phcoder'
> > Serbinenko:
> >> However convention for
> >> creating false is:
> >>   return grub_error (GRUB_ERR_TEST_FAILURE, "false");
> >> and not
> >>   return 1;
> >
> > Ok changed it. If everyone is fine with placing this in normal/main.c, I
> > commit it.
> 
> Unless it is essential to do so, please do not place it in
> normal/main.c.
> 

would normal/misc.c be okay or maybe a new file normal/true.c?
I just don't think it's worth to create a new module for these 2 very
little commands.
-- 
Felix Zielcke




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

* Re: [PATCH] add true and false commands
  2009-06-05  8:47           ` Felix Zielcke
@ 2009-06-05 10:00             ` Marco Gerards
  2009-06-05 10:32               ` Felix Zielcke
  0 siblings, 1 reply; 14+ messages in thread
From: Marco Gerards @ 2009-06-05 10:00 UTC (permalink / raw)
  To: The development of GRUB 2

Felix Zielcke <fzielcke@z-51.de> writes:

> Am Donnerstag, den 04.06.2009, 10:21 +0200 schrieb Marco Gerards:
>> Felix Zielcke <fzielcke@z-51.de> writes:
>> 
>> > Am Montag, den 01.06.2009, 16:24 +0200 schrieb Vladimir 'phcoder'
>> > Serbinenko:
>> >> However convention for
>> >> creating false is:
>> >>   return grub_error (GRUB_ERR_TEST_FAILURE, "false");
>> >> and not
>> >>   return 1;
>> >
>> > Ok changed it. If everyone is fine with placing this in normal/main.c, I
>> > commit it.
>> 
>> Unless it is essential to do so, please do not place it in
>> normal/main.c.
>
> would normal/misc.c be okay or maybe a new file normal/true.c?
> I just don't think it's worth to create a new module for these 2 very
> little commands.

The problem is with too many little commands, the size of normal.mod
grows.  Although the commands are *very* small and I do not strongly
object to inclusion in normal.mod, if noone else has any objection.

--
Marco




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

* Re: [PATCH] add true and false commands
  2009-06-05 10:00             ` Marco Gerards
@ 2009-06-05 10:32               ` Felix Zielcke
  2009-06-05 12:26                 ` Marco Gerards
  0 siblings, 1 reply; 14+ messages in thread
From: Felix Zielcke @ 2009-06-05 10:32 UTC (permalink / raw)
  To: The development of GRUB 2

Am Freitag, den 05.06.2009, 12:00 +0200 schrieb Marco Gerards:
> Felix Zielcke <fzielcke@z-51.de> writes:
> 
> > Am Donnerstag, den 04.06.2009, 10:21 +0200 schrieb Marco Gerards:
> >> Felix Zielcke <fzielcke@z-51.de> writes:
> >> 
> >> > Am Montag, den 01.06.2009, 16:24 +0200 schrieb Vladimir 'phcoder'
> >> > Serbinenko:
> >> >> However convention for
> >> >> creating false is:
> >> >>   return grub_error (GRUB_ERR_TEST_FAILURE, "false");
> >> >> and not
> >> >>   return 1;
> >> >
> >> > Ok changed it. If everyone is fine with placing this in normal/main.c, I
> >> > commit it.
> >> 
> >> Unless it is essential to do so, please do not place it in
> >> normal/main.c.
> >
> > would normal/misc.c be okay or maybe a new file normal/true.c?
> > I just don't think it's worth to create a new module for these 2 very
> > little commands.
> 
> The problem is with too many little commands, the size of normal.mod
> grows.  Although the commands are *very* small and I do not strongly
> object to inclusion in normal.mod, if noone else has any objection.

The binary size of normal.mod would grow about 264 bytes whereas in
minicmd.mod it would be just 260 bytes.
But I already forgot that Bean wants to get rid of normal.mod.

So what should I do now?
Placing it in normal.mod or minicmd.mod where it's included in rescue
mode or placing it into a true.mod where the size increase would be
bigger?

-- 
Felix Zielcke




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

* Re: [PATCH] add true and false commands
  2009-06-05 10:32               ` Felix Zielcke
@ 2009-06-05 12:26                 ` Marco Gerards
  2009-06-05 13:04                   ` Felix Zielcke
  0 siblings, 1 reply; 14+ messages in thread
From: Marco Gerards @ 2009-06-05 12:26 UTC (permalink / raw)
  To: The development of GRUB 2

Felix Zielcke <fzielcke@z-51.de> writes:

> Am Freitag, den 05.06.2009, 12:00 +0200 schrieb Marco Gerards:
>> Felix Zielcke <fzielcke@z-51.de> writes:
>> 
>> > Am Donnerstag, den 04.06.2009, 10:21 +0200 schrieb Marco Gerards:
>> >> Felix Zielcke <fzielcke@z-51.de> writes:
>> >> 
>> >> > Am Montag, den 01.06.2009, 16:24 +0200 schrieb Vladimir 'phcoder'
>> >> > Serbinenko:
>> >> >> However convention for
>> >> >> creating false is:
>> >> >>   return grub_error (GRUB_ERR_TEST_FAILURE, "false");
>> >> >> and not
>> >> >>   return 1;
>> >> >
>> >> > Ok changed it. If everyone is fine with placing this in normal/main.c, I
>> >> > commit it.
>> >> 
>> >> Unless it is essential to do so, please do not place it in
>> >> normal/main.c.
>> >
>> > would normal/misc.c be okay or maybe a new file normal/true.c?
>> > I just don't think it's worth to create a new module for these 2 very
>> > little commands.
>> 
>> The problem is with too many little commands, the size of normal.mod
>> grows.  Although the commands are *very* small and I do not strongly
>> object to inclusion in normal.mod, if noone else has any objection.
>
> The binary size of normal.mod would grow about 264 bytes whereas in
> minicmd.mod it would be just 260 bytes.
> But I already forgot that Bean wants to get rid of normal.mod.
>
> So what should I do now?
> Placing it in normal.mod or minicmd.mod where it's included in rescue
> mode or placing it into a true.mod where the size increase would be
> bigger?

minicmd.mod is not a very descriptive name.  Better call is
truefalse.mod or something like that.

--
Marco




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

* Re: [PATCH] add true and false commands
  2009-06-05 12:26                 ` Marco Gerards
@ 2009-06-05 13:04                   ` Felix Zielcke
  2009-06-05 13:29                     ` Marco Gerards
  2009-06-08  7:32                     ` Felix Zielcke
  0 siblings, 2 replies; 14+ messages in thread
From: Felix Zielcke @ 2009-06-05 13:04 UTC (permalink / raw)
  To: The development of GRUB 2

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

Am Freitag, den 05.06.2009, 14:26 +0200 schrieb Marco Gerards:
> Felix Zielcke <fzielcke@z-51.de> writes:

> > So what should I do now?
> > Placing it in normal.mod or minicmd.mod where it's included in rescue
> > mode or placing it into a true.mod where the size increase would be
> > bigger?
> 
> minicmd.mod is not a very descriptive name.  Better call is
> truefalse.mod or something like that.

minicmd.mod already exists, see commands/minicmd.c (or my first patch).
That's where I put it in the first patch.
Anyway here's a new one which adds true.mod which gets 1264 bytes big.

Thanks Marco that you take the time for it.
-- 
Felix Zielcke

[-- Attachment #2: true_false.patch.4 --]
[-- Type: text/plain, Size: 2948 bytes --]

2009-06-05  Felix Zielcke  <fzielcke@z-51.de>

	* commands/true.c: New file.  Implement the true and false commands.
	* conf/common.rmk.c (pkglib_MODULES): Add `true.mod'.
	(true_mod_SOURCES): New variable.
	(true_mod_CFLAGS): Likewise.
	(true_mod_LDFLAGS): Likewise.

diff --git a/commands/true.c b/commands/true.c
index e69de29..16ca315 100644
--- a/commands/true.c
+++ b/commands/true.c
@@ -0,0 +1,56 @@
+/* true.c - true and false commands.  */
+/*
+ *  GRUB  --  GRand Unified Bootloader
+ *  Copyright (C) 2009  Free Software Foundation, Inc.
+ *
+ *  GRUB is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  GRUB is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <grub/dl.h>
+#include <grub/command.h>
+
+static grub_err_t
+grub_cmd_true (struct grub_command *cmd __attribute__ ((unused)),
+	       int argc __attribute__ ((unused)),
+	       char *argv[] __attribute__ ((unused)))
+{
+  return 0;
+}
+
+static grub_err_t
+grub_cmd_false (struct grub_command *cmd __attribute__ ((unused)),
+		int argc __attribute__ ((unused)),
+		char *argv[] __attribute__ ((unused)))
+{
+  return grub_error (GRUB_ERR_TEST_FAILURE, "false");
+}
+
+static grub_command_t cmd_true, cmd_false;
+
+\f
+GRUB_MOD_INIT(true)
+{
+  cmd_true =
+    grub_register_command ("true", grub_cmd_true,
+			   0, "do nothing, successfully");
+  cmd_false =
+    grub_register_command ("false", grub_cmd_false,
+			   0, "do nothing, unsuccessfully");
+}
+
+GRUB_MOD_FINI(true)
+{
+  grub_unregister_command (cmd_true);
+  grub_unregister_command (cmd_false);
+}
diff --git a/conf/common.rmk b/conf/common.rmk
index ca18c53..48565bf 100644
--- a/conf/common.rmk
+++ b/conf/common.rmk
@@ -344,7 +344,7 @@ pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod	\
 	terminfo.mod test.mod blocklist.mod hexdump.mod		\
 	read.mod sleep.mod loadenv.mod crc.mod parttool.mod	\
 	pcpart.mod memrw.mod boot.mod normal.mod sh.mod lua.mod	\
-	gptsync.mod
+	gptsync.mod true.mod
 
 # For gptsync.mod.
 gptsync_mod_SOURCES = commands/gptsync.c
@@ -476,6 +476,11 @@ memrw_mod_SOURCES = commands/memrw.c
 memrw_mod_CFLAGS = $(COMMON_CFLAGS)
 memrw_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
+# For true.mod
+true_mod_SOURCES = commands/true.c
+true_mod_CFLAGS = $(COMMON_CFLAGS)
+true_mod_LDFLAGS = $(COMMON_LDFLAGS)
+
 # For normal.mod.
 normal_mod_SOURCES = normal/main.c normal/cmdline.c normal/dyncmd.c \
 	normal/autofs.c normal/handler.c \

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

* Re: [PATCH] add true and false commands
  2009-06-05 13:04                   ` Felix Zielcke
@ 2009-06-05 13:29                     ` Marco Gerards
  2009-06-05 15:56                       ` Felix Zielcke
  2009-06-08  7:32                     ` Felix Zielcke
  1 sibling, 1 reply; 14+ messages in thread
From: Marco Gerards @ 2009-06-05 13:29 UTC (permalink / raw)
  To: The development of GRUB 2

Felix Zielcke <fzielcke@z-51.de> writes:

> Am Freitag, den 05.06.2009, 14:26 +0200 schrieb Marco Gerards:
>> Felix Zielcke <fzielcke@z-51.de> writes:
>
>> > So what should I do now?
>> > Placing it in normal.mod or minicmd.mod where it's included in rescue
>> > mode or placing it into a true.mod where the size increase would be
>> > bigger?
>> 
>> minicmd.mod is not a very descriptive name.  Better call is
>> truefalse.mod or something like that.
>
> minicmd.mod already exists, see commands/minicmd.c (or my first patch).
> That's where I put it in the first patch.
> Anyway here's a new one which adds true.mod which gets 1264 bytes big.

Oh, I didn't know minicmd.mod.  Is it useful to have one instead of
a few separate modules?  Space of these smaller modules is not really
a concern to me.

--
Marco




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

* Re: [PATCH] add true and false commands
  2009-06-05 13:29                     ` Marco Gerards
@ 2009-06-05 15:56                       ` Felix Zielcke
  0 siblings, 0 replies; 14+ messages in thread
From: Felix Zielcke @ 2009-06-05 15:56 UTC (permalink / raw)
  To: The development of GRUB 2

Am Freitag, den 05.06.2009, 15:29 +0200 schrieb Marco Gerards:
> Oh, I didn't know minicmd.mod.  Is it useful to have one instead of
> a few separate modules?  Space of these smaller modules is not really
> a concern to me.

Bean split the commands out from kernel.
So especially help and lsmod are in rescue mode only avaible if
minicmd.mod gets embed into core.img, where size does matter.

That's why Vladimir suggest normal.mod or sh.mod. But sh.mod just
contains the parser/lexer so I don't think that's a solution.
I'm now now that sure what to do but I think I just make it now a
seperate true.mod like in the last patch.
-- 
Felix Zielcke




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

* Re: [PATCH] add true and false commands
  2009-06-05 13:04                   ` Felix Zielcke
  2009-06-05 13:29                     ` Marco Gerards
@ 2009-06-08  7:32                     ` Felix Zielcke
  1 sibling, 0 replies; 14+ messages in thread
From: Felix Zielcke @ 2009-06-08  7:32 UTC (permalink / raw)
  To: The development of GRUB 2

Am Freitag, den 05.06.2009, 15:04 +0200 schrieb Felix Zielcke:
> Am Freitag, den 05.06.2009, 14:26 +0200 schrieb Marco Gerards:
> > Felix Zielcke <fzielcke@z-51.de> writes:
> 
> > > So what should I do now?
> > > Placing it in normal.mod or minicmd.mod where it's included in rescue
> > > mode or placing it into a true.mod where the size increase would be
> > > bigger?
> > 
> > minicmd.mod is not a very descriptive name.  Better call is
> > truefalse.mod or something like that.
> 
> minicmd.mod already exists, see commands/minicmd.c (or my first patch).
> That's where I put it in the first patch.
> Anyway here's a new one which adds true.mod which gets 1264 bytes big.
> 
> Thanks Marco that you take the time for it.

Commited that one.
-- 
Felix Zielcke




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

end of thread, other threads:[~2009-06-08  7:32 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-27 12:16 [PATCH] add true and false commands Felix Zielcke
2009-05-30 15:14 ` Vladimir 'phcoder' Serbinenko
2009-06-01 14:18   ` Felix Zielcke
2009-06-01 14:24     ` Vladimir 'phcoder' Serbinenko
2009-06-03 15:45       ` Felix Zielcke
2009-06-04  8:21         ` Marco Gerards
2009-06-05  8:47           ` Felix Zielcke
2009-06-05 10:00             ` Marco Gerards
2009-06-05 10:32               ` Felix Zielcke
2009-06-05 12:26                 ` Marco Gerards
2009-06-05 13:04                   ` Felix Zielcke
2009-06-05 13:29                     ` Marco Gerards
2009-06-05 15:56                       ` Felix Zielcke
2009-06-08  7:32                     ` Felix Zielcke

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.