grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: status update for grub 2 developments?


From: Bean
Subject: Re: status update for grub 2 developments?
Date: Sun, 24 Jun 2007 12:22:18 +0800
User-agent: Mutt/1.5.13 (2006-08-11)

Some bugs I found on scripting.

1. token parser

echo aa"bb"
aabb
(correct)

echo aa"bb"cc
aabb
(cc is lost)

echo aa$prefix
aa (hd0,1)/boot/grub
(should be one token)

echo $prefix/grub.cfg
(hd0,1)/boot/grub /grub.cfg
(should be one token)

The problem here is that when a variable is mixed with text, the token breaks.
I think this is also the reason why set doesn't work with variable.

set AA=1
set BB=$AA

will expand to

set AA=1
set BB= 1

Thereforce the value of BB is empty instead of 1.

2. function

There are a lot of problem with function.

I put this in grub.cfg:

function aa {
  set AA=gfxterm
  insmod $AA
}

And grub goes into an infinite loop:
syntax error
Incorrect command
syntax error
Incorrect command
...

But if I rewrite the function as
function aa {
  set AA=gfxterm
  insmod ${AA}
}

It display the menu properly.

Howerver, when I go to the grub console, and enter aa, it says:

error: unknown command `aa'

and lsmod shows no gfxterm module.

If I use aa before the first menuentry, the menu is not even displayed !

I put anothe function in grub.cfg:
function bb {
  ls (hd0,1)/
}

enter console mode, enter bb:
error: unknown command `ls'

After this, ls command will fail.

Howerver, if I use ls before bb, it says:
error: unknow device

Later use of the ls command works.

Note: ls is not bundled in core.img.

Another function:
function cc {
  set AA=1
  echo ${AA}
}

This is similar to the bb example. If I use echo before cc, it says:
1
error: unknown command `cc'

If I use cc directly, it says:
error: unknow command `echo'

And later use of echo will fail.

-- 
Bean <address@hidden>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]