help-grub
[Top][All Lists]
Advanced

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

Re: little problem with grub2.cfg and if cmd


From: Jordan Uggla
Subject: Re: little problem with grub2.cfg and if cmd
Date: Sat, 18 May 2013 02:04:21 +0000

In the future please don't send html email to help-grub (or almost any
other technical mailing list).

On Fri, May 17, 2013 at 10:38 PM, Dany Flores <address@hidden> wrote:
> Hi All
>
>    This is the problem that I have, using grub 2.0 I have some problem with
> the if command, this is part of my grub.cfg
>
>   set CQTEST=3
>   if [ ${CQTESS} = 3 ]; then
>           set GRUB_DEFAULT=2
>   else
>           set GRUB_DEFAULT=0
>   fi

While you are changing the wrong variable ($GRUB_DEFAULT is the
variable used in /etc/default/grub, in the grub.cfg the variable is
simply $default), I don't see how the code above, as plain text, would
give the error message you received (at least not with grub upstream
grub 2.00). The fact that in your original email different lines had
different font sizes for no reason that I could tell makes me
suspicious that you may be using a word processor like Open Office to
edit your grub.cfg, if that's the case you should not do that. Using a
word processor (as opposed to a text editor) to edit configuration
files can lead to odd errors, among other things important things like
quotation marks (" ") are often replaced with smart quotes and if
you're really unlucky you may even get formatting garbage in your
configuration file. Always use text editors for editing configuration
files.

>
>    Is very simple, but when boot the server, show me an error, error: can't
> find command `['.
>
>   I need to do something or load another module or if not possible to do
> something like my example
>

Modules are automatically loaded as needed (except when running Fedora
and possibly other distros modified grub in a secure boot environment,
in which case insmod is disabled entirely) so you should not need to
load modules explicitly for any command. If you are not editing your
grub.cfg with a word processor please include the complete grub.cfg
you're having issues with as well as the output of "grub-install
--version" in a reply.

-- 
Jordan Uggla (Jordan_U on irc.freenode.net)



reply via email to

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