All of lore.kernel.org
 help / color / mirror / Atom feed
* how to add a new command
@ 2007-06-12 11:56 adrian15
  2007-06-12 14:15 ` Robert Millan
  2007-06-12 14:24 ` Alex Roman
  0 siblings, 2 replies; 6+ messages in thread
From: adrian15 @ 2007-06-12 11:56 UTC (permalink / raw)
  To: The development of GRUB 2

	Once I write a new command like map.c or pause.c how am I supposed to
add it to the standard grub?
	Should I write the makefiles manually?! or should I use some of the .sh
files at the grub2 source code root folder?


adrian15




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

* Re: how to add a new command
  2007-06-12 14:15 ` Robert Millan
@ 2007-06-12 14:07   ` adrian15
  0 siblings, 0 replies; 6+ messages in thread
From: adrian15 @ 2007-06-12 14:07 UTC (permalink / raw)
  To: The development of GRUB 2

Robert Millan escribió:
> Look at how other commands are hooked in.  rgrep(1) is your friend :-)

I already did that and it seemed to me to complicated to add a simple 
command compared to grub legacy.

That's why I asked, I'll try with Alex Roman suggestion.

adrian15



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

* Re: how to add a new command
  2007-06-12 11:56 how to add a new command adrian15
@ 2007-06-12 14:15 ` Robert Millan
  2007-06-12 14:07   ` adrian15
  2007-06-12 14:24 ` Alex Roman
  1 sibling, 1 reply; 6+ messages in thread
From: Robert Millan @ 2007-06-12 14:15 UTC (permalink / raw)
  To: The development of GRUB 2

On Tue, Jun 12, 2007 at 01:56:52PM +0200, adrian15 wrote:
> 	Once I write a new command like map.c or pause.c how am I supposed to
> add it to the standard grub?
> 	Should I write the makefiles manually?! or should I use some of the 
> 	.sh
> files at the grub2 source code root folder?

Look at how other commands are hooked in.  rgrep(1) is your friend :-)

-- 
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.



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

* Re: how to add a new command
  2007-06-12 11:56 how to add a new command adrian15
  2007-06-12 14:15 ` Robert Millan
@ 2007-06-12 14:24 ` Alex Roman
  2007-06-15 12:47   ` adrian15
  2007-06-15 12:48   ` adrian15
  1 sibling, 2 replies; 6+ messages in thread
From: Alex Roman @ 2007-06-12 14:24 UTC (permalink / raw)
  To: The development of GRUB 2

On 12/06/07, adrian15 <adrian15@raulete.net> wrote:
>         Once I write a new command like map.c or pause.c how am I supposed to
> add it to the standard grub?
>         Should I write the makefiles manually?! or should I use some of the .sh
> files at the grub2 source code root folder?

I've been editing the .rmk files in conf/ which should cause the .mk
files to get updated (at least that's my understanding of it, so far).

Make sure the command is placed in the right Makefile... I had the
problem where I was including the command in both grub-emu and
grub/i386-pc and grub-emu didn't link due to undefined symbols
(because those didn't exist in grub-emu).


Cheers!

-- 
Alex Roman <alex.roman@gmail.com>



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

* Re: how to add a new command
  2007-06-12 14:24 ` Alex Roman
@ 2007-06-15 12:47   ` adrian15
  2007-06-15 12:48   ` adrian15
  1 sibling, 0 replies; 6+ messages in thread
From: adrian15 @ 2007-06-15 12:47 UTC (permalink / raw)
  To: The development of GRUB 2

Alex Roman escribió:
> On 12/06/07, adrian15 <adrian15@raulete.net> wrote:
>>         Once I write a new command like map.c or pause.c how am I 
>> supposed to
>> add it to the standard grub?
>>         Should I write the makefiles manually?! or should I use some 
>> of the .sh
>> files at the grub2 source code root folder?
> 
> I've been editing the .rmk files in conf/ which should cause the .mk
> files to get updated (at least that's my understanding of it, so far).
> 
> Make sure the command is placed in the right Makefile... I had the
> problem where I was including the command in both grub-emu and
> grub/i386-pc and grub-emu didn't link due to undefined symbols
> (because those didn't exist in grub-emu).
> 
> 
> Cheers!
> 

I've finally edit conf/i386-pc.rmk, copy-pasted the play.c code and
find/replace with map.c.


Then I run make:
make prompts this:


adrian@adrianpc:~/Desktop/gnu/grub2/grub2_2007_05_31_map$ make
if test "x" = x; then \
           touch conf/i386-pc.mk; \
         else \
            ./genmk.rb < conf/i386-pc.rmk > conf/i386-pc.mk; \
         fi
make: No se hace nada para `all'.

If you check: i386-pc.mk then there is no reference to:
"/map.c"

If I delete i386-pc.mk and run make again:

adrian@adrianpc:~/Desktop/gnu/grub2/grub2_2007_05_31_map$ make
Makefile:111: conf/i386-pc.mk: No existe el fichero o el directorio
if test "x" = x; then \
           touch conf/i386-pc.mk; \
         else \
            ./genmk.rb < conf/i386-pc.rmk > conf/i386-pc.mk; \
         fi
make: No se hace nada para `all'.

and a empty i386-pc.mk file is created.


I check genmk.rb and it is not an executable file.







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

* Re: how to add a new command
  2007-06-12 14:24 ` Alex Roman
  2007-06-15 12:47   ` adrian15
@ 2007-06-15 12:48   ` adrian15
  1 sibling, 0 replies; 6+ messages in thread
From: adrian15 @ 2007-06-15 12:48 UTC (permalink / raw)
  To: The development of GRUB 2

Alex Roman escribió:
> On 12/06/07, adrian15 <adrian15@raulete.net> wrote:
>>         Once I write a new command like map.c or pause.c how am I 
>> supposed to
>> add it to the standard grub?
>>         Should I write the makefiles manually?! or should I use some 
>> of the .sh
>> files at the grub2 source code root folder?
> 
> I've been editing the .rmk files in conf/ which should cause the .mk
> files to get updated (at least that's my understanding of it, so far).
> 
> Make sure the command is placed in the right Makefile... I had the
> problem where I was including the command in both grub-emu and
> grub/i386-pc and grub-emu didn't link due to undefined symbols
> (because those didn't exist in grub-emu).
> 
> 
> Cheers!
> 

I've finally edit conf/i386-pc.rmk, copy-pasted the play.c code and
find/replace with map.c.


Then I run make:
make prompts this:


adrian@adrianpc:~/Desktop/gnu/grub2/grub2_2007_05_31_map$ make
if test "x" = x; then \
           touch conf/i386-pc.mk; \
         else \
            ./genmk.rb < conf/i386-pc.rmk > conf/i386-pc.mk; \
         fi
make: No se hace nada para `all'.

If you check: i386-pc.mk then there is no reference to:
"/map.c"

If I delete i386-pc.mk and run make again:

adrian@adrianpc:~/Desktop/gnu/grub2/grub2_2007_05_31_map$ make
Makefile:111: conf/i386-pc.mk: No existe el fichero o el directorio
if test "x" = x; then \
           touch conf/i386-pc.mk; \
         else \
            ./genmk.rb < conf/i386-pc.rmk > conf/i386-pc.mk; \
         fi
make: No se hace nada para `all'.

and a empty i386-pc.mk file is created.


I check genmk.rb and it is not an executable file.

I give it execution permission.
I delete the empty i386-pc.mk file and run make again:


Makefile:111: conf/i386-pc.mk: No existe el fichero o el directorio
if test "x" = x; then \
           touch conf/i386-pc.mk; \
         else \
            ./genmk.rb < conf/i386-pc.rmk > conf/i386-pc.mk; \
         fi
make: No se hace nada para `all'.

Now if I run manually:

ruby genmk.rb < conf/i386-pc.rmk > conf/i386-pc.mk

Then conf/i386-pc.mk has the map.c string and then make reads the map.c
file at last.

I think the problem is in the Makefile here:

	if test "x$(RUBY)" = x; then \
	  touch $@; \
	else \
	  $(RUBY) $(srcdir)/genmk.rb < $< > $@; \
	fi


and if you check above the definitions you get:

RUBY =

Let me do some checks...

Running:

make distclean
./configure

generates another Makefile which does contain:

RUBY = /usr/bin/ruby

and why's that?

Because meanwhile I was compiling I've done a symbolic link from
/usr/bin/ruby to /usr/bin/ruby1.9

I mean... I've installed ruby1.9 as you requested but your grub2 isn't
unable to use it.

Now it seems that everything goes fine.

Should not be adviced in the INSTALL or README file that you have to put 
a symlink from /usr/bin/ruby to /usr/bin/ruby1.9 ??

adrian15



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

end of thread, other threads:[~2007-06-15 13:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-12 11:56 how to add a new command adrian15
2007-06-12 14:15 ` Robert Millan
2007-06-12 14:07   ` adrian15
2007-06-12 14:24 ` Alex Roman
2007-06-15 12:47   ` adrian15
2007-06-15 12:48   ` adrian15

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.