All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bean <bean123@126.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: status update for grub 2 developments?
Date: Sun, 24 Jun 2007 12:22:18 +0800	[thread overview]
Message-ID: <20070624042218.GA8436@ws3.vdp.com> (raw)
In-Reply-To: <87645eohbj.fsf@xs4all.nl>

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 <bean123@126.com>




  reply	other threads:[~2007-06-24  4:22 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-17 12:47 status update for grub 2 developments? Vesa Jääskeläinen
2007-06-17 13:34 ` Robert Millan
2007-06-18  2:52 ` Ashok kumar
2007-06-18 10:22 ` adrian15
2007-06-18 13:32   ` Robert Millan
2007-06-18 15:40     ` Vesa Jääskeläinen
2007-06-19 12:13       ` adrian15
2007-06-19 15:13         ` Vesa Jääskeläinen
2007-06-19 12:08     ` adrian15
2007-06-23 12:57 ` Marco Gerards
2007-06-23 14:31   ` Bean
2007-06-23 14:50     ` Marco Gerards
2007-06-24  4:22       ` Bean [this message]
2007-06-24 11:47         ` Bean
2007-07-22 12:42           ` Marco Gerards
2007-06-23 14:52     ` Marco Gerards
2007-06-23 15:59       ` Bean
2007-06-23 16:10         ` Marco Gerards
2007-06-23 16:23           ` Bean
2007-06-23 16:38             ` Marco Gerards
2007-06-23 20:19               ` Yoshinori K. Okuji
2007-07-01 17:49     ` adrian15
2007-06-25 18:41       ` Bean
2007-06-26  4:13   ` Ashok kumar
2007-07-22 14:31     ` Marco Gerards

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070624042218.GA8436@ws3.vdp.com \
    --to=bean123@126.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.