help-grub
[Top][All Lists]
Advanced

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

Re: Using grub, is it possible to use "if, while" during booting (before


From: Andrey Borzenkov
Subject: Re: Using grub, is it possible to use "if, while" during booting (before loading normal.mod)?
Date: Tue, 13 Aug 2013 21:42:08 +0400

В Tue, 13 Aug 2013 09:38:19 -0700
Binh Minh <address@hidden> пишет:

> I included the normal and configfile modules in grub-mkimage and still
> system does not recognize "if"

Yes, documentation apparently is wrong here. Embedded config is parsed
before normal.mod is loaded so it supports only what is available in
rescue mode.  



> On Aug 13, 2013 9:15 AM, "Andrey Borzenkov" <address@hidden> wrote:
> 
> > В Tue, 13 Aug 2013 07:33:28 -0700
> > Binh Minh <address@hidden> пишет:
> >
> > > It is a security feature requires my implementation to ask for the user's
> > > input and compare the input before we process information in grub.cfg.
> >  It
> > > is proprietary so I can't discuss more than that.  If I include modules
> > > echo, sleep, read during grub-mkimage, I was able to have those commands
> > in
> > > myconfig.cfg, and this works before normal.mod is loaded.  But how come
> > > "if" statement is unknown?  The grub documentation on this web site
> > >
> > http://www.gnu.org/software/grub/manual/html_node/Embedded-configuration.htmlhas
> > > an example showing using "if" statement is possible.  What kind of
> > > built-in script parser is used when processing the "config file" that was
> > > linked into core.img?
> > >
> >
> > normal.mod. Quoting documentation:
> >
> > To do this, include the `configfile' and `normal' modules in the core
> > image,
> >
> > >
> > > On Tue, Aug 13, 2013 at 2:39 AM, Andrey Borzenkov <address@hidden
> > >wrote:
> > >
> > > > On Tue, Aug 13, 2013 at 9:10 AM, Binh Minh <address@hidden>
> > > > wrote:
> > > > > I am trying to read in a user's input, compare the user's input to
> > X.  If
> > > > > the user's input matches X, proceed to load normal.mod; otherwise
> > loop
> > > > back
> > > > > to get user's input.
> > > > >
> > > > >
> > > >
> > > > And why you cannot do it after normal.mod is loaded?
> > > >
> > > > > On Mon, Aug 12, 2013 at 7:39 PM, Andrey Borzenkov <
> > address@hidden>
> > > > > wrote:
> > > > >>
> > > > >> В Mon, 12 Aug 2013 13:39:24 -0700
> > > > >> Binh Minh <address@hidden> пишет:
> > > > >>
> > > > >> > My computer has grub installed. During booting before normal.mod
> > is
> > > > >> > loaded,
> > > > >> > I need to be able to run if and while commands in my config file
> > which
> > > > >> > has
> > > > >> > been linked into core.img (using grub-mkimage -c myconfig.confg).
> > In
> > > > >> > myconfig.config, I have an if statement and I kept getting
> > "unknown
> > > > >> > command
> > > > >> > if" during booting.  I saw an example in
> > > > >> >
> > > > >> >
> > > >
> > http://www.gnu.org/software/grub/manual/html_node/Embedded-configuration.htmland
> > > > >> > looks like I just need to include search, test, and normal
> > modules.
> > > > >> > Am
> > > > >> > I missing something?  Thanks
> > > > >>
> > > > >> It is not possible. Those commands are provide by normal.mod. The
> > only
> > > > >> purpose of core.img is normally to load normal.mod.
> > > > >>
> > > > >> What are you trying to do?
> > > > >
> > > > >
> > > >
> >
> >




reply via email to

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