From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1LrDy0-0003GC-KS for mharc-grub-devel@gnu.org; Tue, 07 Apr 2009 12:16:04 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LrDxz-0003G0-7Y for grub-devel@gnu.org; Tue, 07 Apr 2009 12:16:03 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LrDxu-0003FO-Ol for grub-devel@gnu.org; Tue, 07 Apr 2009 12:16:02 -0400 Received: from [199.232.76.173] (port=56620 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LrDxu-0003FL-Ji for grub-devel@gnu.org; Tue, 07 Apr 2009 12:15:58 -0400 Received: from mta-out.inet.fi ([195.156.147.13]:58166 helo=kirsi2.inet.fi) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LrDxu-00044W-3S for grub-devel@gnu.org; Tue, 07 Apr 2009 12:15:58 -0400 Received: from [192.168.1.102] (84.248.105.254) by kirsi2.inet.fi (8.5.014) id 49CA1EE500946C89 for grub-devel@gnu.org; Tue, 7 Apr 2009 19:15:54 +0300 Message-ID: <49DB7C30.8080209@nic.fi> Date: Tue, 07 Apr 2009 19:15:44 +0300 From: =?ISO-8859-1?Q?Vesa_J=E4=E4skel=E4inen?= User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: The development of GRUB 2 References: In-Reply-To: X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: [PATCH] LUA script engine for grub2 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 16:16:03 -0000 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") I would prefer something like grub.return or grub.exit, or something like that if really needed. Here is something that I would like that it can do: In GUI definition: action="lua:grub.run(\"ls\", \"-l\")" and action="my_lua_action.lua" or just action="lua:my_lua_action.lua" and action="ls -l" or action="(ba)sh:ls -l" This way one could use both grub bash scripting and lua scripting. Now if something is being executed in my_lua_action.lua and execution comes to the end it should return to calling code. grub_lua_execute_file(""); grub_lua_execute("");