help-grub
[Top][All Lists]
Advanced

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

Re: Unknown command 'else'?


From: Andrei Borzenkov
Subject: Re: Unknown command 'else'?
Date: Fri, 18 Sep 2015 10:02:49 +0300

On Fri, Sep 18, 2015 at 9:44 AM, Steven Shiau <address@hidden> wrote:
>
> On 2015年09月18日 14:29, Andrei Borzenkov wrote:
>> Yes, looks like it. It needs some adjustment. Care to open bug report
>> on savannah.gnu.org?
> OK, I will.
>>
>>> > It mentions that when echo, search_label, and test modules to be
>>> > included in the core image, the above embedded config should work.
>>> > Actually the running result for the above if condition works, just the
>>> > error message looks weird.
>> What do you mean "works"? It shows last error, so you simply do not
>> see errors about preceding "if" or "configfile" commands. Actually, I
>> have somewhere patch to make it more verbose at this point ...
> Thanks. When I mentioned "works", it means, if I remove
> /tftpboot/nbi_img/grub.cfg-01:00:0c:29:1d:9a:d1
> from tftp server while keeping /tftpboot/nbi_img/grub.cfg, it actually
> will load
> /tftpboot/nbi_img/grub.cfg

"if" is not external command - it must be recognized and processed by
script parser and at this point rescue script parser is still active.
OTOH "configfile" is more or less standard external command. So first
"if" results in error, then "configfile" succeeds. configfile
implicitly loads and calls normal.mod so it appears to work. Although
not exactly as envisioned :)

> Then, if both
> /tftpboot/nbi_img/grub.cfg-01:00:0c:29:1d:9a:d1
> and
> /tftpboot/nbi_img/grub.cfg
> are removed, then it does show the error message:
> Could not find config file
> /tftpboot/nbi_img/grub.cfg-01:00:0c:29:1d:9a:d1 or
> /tftpboot/nbi_img/grub.cfg!
> then
> sleep for 10 secs.
> As you saw the attached file in my 1st post in this thread:
> http://lists.gnu.org/archive/html/help-grub/2015-09/pngxbX870kyfT.png
> Weird?
>

No, not really. Rather lack of documentation ...

>>
>> As I just suggested in another thread - create standalone image using
>> grub-mkstandalone. It puts full grub in memory disk and you can add
>> grub.cfg on top of it. This grub.cfg runs after normal.mod is loaded
>> from memory disk so full functionality is available.
>
> Cool. I am new to this list so I will search to see how to make this
> with grub-mkstandalone.

Anyway it was quite interesting use case, something to keep in mind.



reply via email to

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