help-grub
[Top][All Lists]
Advanced

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

Re: Unknown command 'else'?


From: Steven Shiau
Subject: Re: Unknown command 'else'?
Date: Fri, 18 Sep 2015 13:20:52 +0800
User-agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.2.0


On 2015年09月18日 12:00, Andrei Borzenkov wrote:
> 18.09.2015 06:38, Steven Shiau пишет:
>> Dear all,
>> I encountered an issue "Unknown command 'else'." when embedding a config
>> in uEFI network boot image.
> 
> embedded config is processed before normal.mod is loaded so only
> commands in rescue mode are available. bash like scripting is feature of
> normal.mod.
So the description in the grub 2 manual is not really correct, like here:
http://dev.gentoo.org/~floppym/grub.html#Embedded-configuration
?
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.
Thanks.

Steven.
> 
>> The machine is running Debian Sid, with
>> grub-pc version 2.02~beta2-28.
>> The command I use to create the image is:
>> grub-mkimage -C xz -O x86_64-efi -o /tftpboot/nbi_img/bootx64.efi
>> --prefix='(tftp)/grub-efi.cfg/' -c /tmp/grub-efi/grub-header.cfg normal
>> tftp efinet chain echo net gzio xzio linux efi_gop efi_uga png gfxterm
>> gfxterm_background gfxterm_menu serial part_gpt part_msdos boot
>> multiboot progress search reboot halt configfile test sleep
>>
>> Then content of /tmp/grub-efi/grub-header.cfg is:
>> =============================
>> set prefix=(tftp)/grub-efi.cfg
>> echo 'Network status: '
>> net_ls_cards
>> net_ls_addr
>> net_ls_routes
>>
>> if [ -e "$prefix/grub.cfg-$net_default_mac" ]; then
>>    configfile $prefix/grub.cfg-$net_default_mac
>> elif [ -e "$prefix/grub.cfg" ]; then
>>    configfile $prefix/grub.cfg
>> else
>>    echo "Could not find config file $prefix/grub.cfg-$net_default_mac or
>> $prefix/grub.cfg!"
>>    sleep 10
>> fi
>> =============================
>>
>> Attached you can find the error on the screen.
>> Where am I wrong?
>> Thanks.
>>
>> Steven.
>>
>>
>>
>> _______________________________________________
>> Help-grub mailing list
>> address@hidden
>> https://lists.gnu.org/mailman/listinfo/help-grub
>>

-- 
Steven Shiau <steven _at_ stevenshiau org>
Public Key Server PGP Key ID: 4096R/47CF935C
Fingerprint: 0240 1FEB 695D 7112 62F0  8796 11C1 12DA 47CF 935C



reply via email to

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