Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MIoZu-00006N-H0 for mharc-grub-devel@gnu.org; Mon, 22 Jun 2009 14:49:14 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MIoZs-00006A-Oy for grub-devel@gnu.org; Mon, 22 Jun 2009 14:49:12 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MIoZp-00005S-0K for grub-devel@gnu.org; Mon, 22 Jun 2009 14:49:12 -0400 Received: from [199.232.76.173] (port=50542 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MIoZo-00005P-O6 for grub-devel@gnu.org; Mon, 22 Jun 2009 14:49:08 -0400 Received: from mail-pz0-f182.google.com ([209.85.222.182]:35202) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MIoZo-0002P1-7P for grub-devel@gnu.org; Mon, 22 Jun 2009 14:49:08 -0400 Received: by pzk12 with SMTP id 12so1927278pzk.14 for ; Mon, 22 Jun 2009 11:49:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=VadqGlOLYwOKn+WCNtHhXRyGtYfS8qUDKK++kJ8T5Qk=; b=u2v4XpY4SMv+r636CEt+Ixee0JVykDJ4NfM3dx0Rh2+coAQK/IM4HSz5+C8zlkDGDV z+3pJGT/Rs5pYu7OyRm/NwaJk+hdvmSt6BSrPYVGmVn3aTGN688ICSCgey6DAShbv+jn 85D+UVzGIqelMdgJh7XkPMVA3VNxxiJwnn3S8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Bk+e4nwp9tvwtY8UTiazuwEj3dJkCel/nn80sz8uBGZre/FJrHTY1RudXsdLhxSjke 3L8RkIEtvsPqaV6HqR/p/UChNfoudxaRk1VtX9X/rCJnn3Id4aU5wL8YMrsS0sFWpIBd nLJgXA7+1HLRpmFf5ky2/HV8RE5vRpTplK5kQ= MIME-Version: 1.0 Received: by 10.114.106.1 with SMTP id e1mr5398250wac.158.1245696547225; Mon, 22 Jun 2009 11:49:07 -0700 (PDT) In-Reply-To: <1245695500.1926.10.camel@mj> References: <1245631353.9864.7.camel@mj> <20090622094429.GB8969@thorin> <20090622105959.GI8969@thorin> <1245695500.1926.10.camel@mj> Date: Tue, 23 Jun 2009 02:49:07 +0800 Message-ID: From: Bean To: The development of GRUB 2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:49:13 -0000 On Tue, Jun 23, 2009 at 2:31 AM, Pavel Roskin wrote: > 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) > =A0static int > =A0grub_lua_add_menu (lua_State *state) > =A0{ > - =A0int len, n; > + =A0int n; > + =A0size_t len; > =A0 const char *source; > > =A0 source =3D 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. What's the name of kernel and initrd.img ? > > -- > Regards, > Pavel Roskin > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > --=20 Bean