[Top][All Lists]

[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 19:17:48 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0

18.09.2015 18:38, Steven Shiau пишет:
On 2015年09月18日 20:16, Andrei Borzenkov wrote:
On Fri, Sep 18, 2015 at 12:47 PM, Steven Shiau <address@hidden> wrote:

If there is someway to make this if/elif/else/fi work in embedded config,

I do not think it is likely to happen. It will increase size of core
and we attempt to keep it as small as possible. Given that easy
solution (grub-mkstandalone) already exists, there is no compelling
reason to do it either.

 From my understanding, it seems the image created by "grub-mkstandalone"
can not load the grub config file from tftp server?  Because I tried to
assign the config file on tftp server (as in my previous post), but it
can not read the config file from tftp server.
Am I right?

It can read, just that it is configured with $root and $prefix pointing to internal memory, so it does not do it by default. But you still have $cmdpath that points to original boot location and you still have $net_default_server, $net_default_mac etc which should point to TFTP server it had been booted from. So you should be able to write custom grub.cfg making use of them.

Of course you need to preload net and driver modules, just like netboot image does, to compute them.

If so, then "grub-mkstandalone" won't work for my purpose,
because the grub config file for uEFI network booting might be changed
for each client (like grub.cfg-01:$net_default_mac) on the server so
that the client machine's booting mechanism can be changed to what the
system administrator wants. It's not handy to create the standalone boot
image every time with grub-mkstandalone because there might be more than
2 clients, and we need to have different booting mechanism for each client.
So, from your previous post
(, it
occurred to me that if I make my way like this:
1. Make the content of /tmp/grub-efi/grub-header.cfg as:
set prefix=(tftp)/grub-efi.cfg
echo 'Network status: '

echo "Use config file: $prefix/grub.cfg-01:$net_default_mac"
configfile $prefix/grub.cfg-01:$net_default_mac

echo "Use config file: $prefix/grub.cfg"
configfile $prefix/grub.cfg

echo "Could not find config file $prefix/grub.cfg-$net_default_mac or
sleep 15

2. The command to create the image:
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 no error at all, and it also works.  Looks pretty cool?
Do you think this preconfig file will work for the future grub 2.x?

Yes, I do not really expect it to break. May be just become more verbose with errors about missing files.

Thank you very much.


reply via email to

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