grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] LUA script engine for grub2


From: phcoder
Subject: Re: [PATCH] LUA script engine for grub2
Date: Tue, 07 Apr 2009 17:18:52 +0200
User-agent: Thunderbird 2.0.0.21 (X11/20090318)

Is it all from scratch? Wau. Very nice job. Unfortunately I don't know any lua but I'll test this as time permits
Bean wrote:
Hi,

This patch integrate the LUA script engine to grub2. Before applying
this patch, you should apply the split module patch split_3.diff
first.

BTW, I forget to add Makefile.in the previous split_3.diff, so that
handler.lst will not be generated, I include it in this one.

To try the LUA engine, you can enter command line, and use:

parser.lua

Inside lua, you can use grub.run to execute grub commands, such as:

grub.run("ls", "-l")

To switch back to sh, you can run this command:

grub.run("parser.sh")

Here is a small lua program to solve the hanoi tower:

function hanoi(n,a,b,c)
if (n == 1) then
  print ("move from", a, "to", c)
else
  hanoi (n-1, a, c, b)
  hanoi (1, a, b, c)
  hanoi (n-1, b, a, c)
end
end
hanoi (3, 1, 2, 3)





------------------------------------------------------------------------

_______________________________________________
Grub-devel mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/grub-devel


--

Regards
Vladimir 'phcoder' Serbinenko




reply via email to

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