From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MIoJ6-00079q-09 for mharc-grub-devel@gnu.org; Mon, 22 Jun 2009 14:31:52 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MIoJ4-00079h-Le for grub-devel@gnu.org; Mon, 22 Jun 2009 14:31:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MIoIz-00079V-3t for grub-devel@gnu.org; Mon, 22 Jun 2009 14:31:49 -0400 Received: from [199.232.76.173] (port=53148 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MIoIy-00079S-S5 for grub-devel@gnu.org; Mon, 22 Jun 2009 14:31:44 -0400 Received: from c60.cesmail.net ([216.154.195.49]:32822) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1MIoIy-00060Z-8P for grub-devel@gnu.org; Mon, 22 Jun 2009 14:31:44 -0400 Received: from unknown (HELO smtprelay2.cesmail.net) ([192.168.1.112]) by c60.cesmail.net with ESMTP; 22 Jun 2009 14:31:42 -0400 Received: from [192.168.0.22] (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by smtprelay2.cesmail.net (Postfix) with ESMTPSA id 235FD34C6A for ; Mon, 22 Jun 2009 14:37:51 -0400 (EDT) From: Pavel Roskin To: The development of GRUB 2 In-Reply-To: References: <1245631353.9864.7.camel@mj> <20090622094429.GB8969@thorin> <20090622105959.GI8969@thorin> Content-Type: text/plain Date: Mon, 22 Jun 2009 14:31:40 -0400 Message-Id: <1245695500.1926.10.camel@mj> Mime-Version: 1.0 X-Mailer: Evolution 2.26.2 (2.26.2-1.fc11) Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [PATCH] File access library for lua 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: Mon, 22 Jun 2009 18:31:51 -0000 On Tue, 2009-06-23 at 01:37 +0800, Bean wrote: > Hi, > > Update for this patch: > > 1, enum_device now pass fs and uuid as well > 2, enum_file change parameter order, now the callback function is the > first, path is the second > 3, add parameter checking for library function > 4, add three function > > file_eof - test if eof is encounter for a file > file_exist - test if a file exists > add_menu - add menu item The new patch introduces a warning: script/lua/grub_lib.c: In function 'grub_lua_add_menu': script/lua/grub_lib.c:394: warning: pointer targets in passing argument 3 of 'luaL_checklstring' differ in signedness script/lua/lauxlib.h:51: note: expected 'size_t *' but argument is of type 'int *' Fix: diff --git a/script/lua/grub_lib.c b/script/lua/grub_lib.c index 8561dd0..bcff3db 100644 --- a/script/lua/grub_lib.c +++ b/script/lua/grub_lib.c @@ -388,7 +388,8 @@ grub_lua_file_exist (lua_State *state) static int grub_lua_add_menu (lua_State *state) { - int len, n; + int n; + size_t len; const char *source; source = luaL_checklstring (state, 1, &len); > I also add a script osdetect.lua which can detect Windows > 2K/NT/XP/Vista and linux at runtime, to use it, add this in grub.cfg: > > source osdetect.lua It didn't find Linux for me, but it found the "Other OS", which is actually FreeDOS. -- Regards, Pavel Roskin