Re: [PATCH] File access library for lua

2009-07-31 Thread Marco Gerards
Bean writes: > 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

Re: [PATCH] File access library for lua

2009-07-05 Thread Bean
On Sun, Jul 5, 2009 at 9:11 PM, Duboucher Thomas wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > >        I was reading the code and now I have a question. You are creating a > grub librairy writen in C including useful functions such as > 'grub.file_open'. But in your implementation, yo

Re: [PATCH] File access library for lua

2009-07-05 Thread Duboucher Thomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I was reading the code and now I have a question. You are creating a grub librairy writen in C including useful functions such as 'grub.file_open'. But in your implementation, you removed base libraries such as 'os' and 'io'. So why don't you j

Re: [PATCH] File access library for lua

2009-07-05 Thread Bean
Committed. On Sat, Jun 27, 2009 at 12:14 PM, Bean wrote: > On Sat, Jun 27, 2009 at 12:04 PM, Pavel Roskin wrote: >> On Sat, 2009-06-27 at 11:53 +0800, Bean wrote: >> >>> Yes, actually it's just a bunch of file_exist AND or OR together, but >>> I think if we use this kind of test often enough, impl

Re: [PATCH] File access library for lua

2009-06-26 Thread Bean
On Sat, Jun 27, 2009 at 12:04 PM, Pavel Roskin wrote: > On Sat, 2009-06-27 at 11:53 +0800, Bean wrote: > >> Yes, actually it's just a bunch of file_exist AND or OR together, but >> I think if we use this kind of test often enough, implement it in c >> would be more efficient. > > So far, we only ha

Re: [PATCH] File access library for lua

2009-06-26 Thread Pavel Roskin
On Sat, 2009-06-27 at 11:53 +0800, Bean wrote: > Yes, actually it's just a bunch of file_exist AND or OR together, but > I think if we use this kind of test often enough, implement it in c > would be more efficient. So far, we only have one file. I checked the Lua reference manual, and no file r

Re: [PATCH] File access library for lua

2009-06-26 Thread Bean
On Sat, Jun 27, 2009 at 8:22 AM, Pavel Roskin wrote: > On Wed, 2009-06-24 at 12:41 +0800, Bean wrote: > >> Oh, fixed typos now. As for "Windows Vista bootmgr"  and "Windows >> NT/2000/XP loader", I just copy them from 10_windows.in, I guess there >> is a reason for it there. > > I don't think so.

Re: [PATCH] File access library for lua

2009-06-26 Thread Pavel Roskin
On Wed, 2009-06-24 at 12:41 +0800, Bean wrote: > Oh, fixed typos now. As for "Windows Vista bootmgr" and "Windows > NT/2000/XP loader", I just copy them from 10_windows.in, I guess there > is a reason for it there. I don't think so. > > inird should be initrd. Please add check for the Fedora s

Re: [PATCH] File access library for lua

2009-06-26 Thread Pavel Roskin
On Fri, 2009-06-26 at 00:39 +0200, Vladimir 'phcoder' Serbinenko wrote: > On Mon, Jun 22, 2009 at 10:06 PM, Pavel Roskin wrote: > > "root hd0,3" has not effect. "root (hd0,3)" and "root=hd0,3" work. > > Yes, that's a bug in the root command. > Can't root command be ditched altogether? It sounds l

Re: [PATCH] File access library for lua

2009-06-26 Thread Pavel Roskin
On Wed, 2009-06-24 at 00:50 +0200, Robert Millan wrote: > On Tue, Jun 23, 2009 at 06:10:36PM -0400, Pavel Roskin wrote: > > On Tue, 2009-06-23 at 17:27 +0800, Bean wrote: > > > Hi, > > > > > > Some bug fix for osdetect.lua, it also detect windows 98/me, freedos, > > > msdos and freebsd. > > > > W

Re: [PATCH] File access library for lua

2009-06-25 Thread Vladimir 'phcoder' Serbinenko
On Mon, Jun 22, 2009 at 10:06 PM, Pavel Roskin wrote: > On Tue, 2009-06-23 at 03:50 +0800, Bean wrote: > >> strange, it's working here, what's the device list ? > > My mistake.  I installed an unpatched GRUB. > > The entries are created now.  However, the initrd is not picked up.  The > old kernel

Re: [PATCH] File access library for lua

2009-06-23 Thread Bean
Hi, Oh, found a small bug in the previous osdetect.lua, here is an updated version. -- Bean osdetect.gz Description: GNU Zip compressed data ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel

Re: [PATCH] File access library for lua

2009-06-23 Thread Bean
On Wed, Jun 24, 2009 at 6:10 AM, Pavel Roskin wrote: > On Tue, 2009-06-23 at 17:27 +0800, Bean wrote: >> Hi, >> >> Some bug fix for osdetect.lua, it also detect windows 98/me, freedos, >> msdos and freebsd. > > Why FressDOS and FressBSD?  I assume it's typos.  Why isn't Linux > capitalized?  MS-DOS

Re: [PATCH] File access library for lua

2009-06-23 Thread Robert Millan
On Tue, Jun 23, 2009 at 06:10:36PM -0400, Pavel Roskin wrote: > On Tue, 2009-06-23 at 17:27 +0800, Bean wrote: > > Hi, > > > > Some bug fix for osdetect.lua, it also detect windows 98/me, freedos, > > msdos and freebsd. > > Why FressDOS and FressBSD? I assume it's typos. Why isn't Linux > capit

Re: [PATCH] File access library for lua

2009-06-23 Thread Pavel Roskin
On Tue, 2009-06-23 at 17:27 +0800, Bean wrote: > Hi, > > Some bug fix for osdetect.lua, it also detect windows 98/me, freedos, > msdos and freebsd. Why FressDOS and FressBSD? I assume it's typos. Why isn't Linux capitalized? MS-DOS is written with a dash. "Windows Vista bootmgr" should be "Wi

Re: [PATCH] File access library for lua

2009-06-23 Thread Bean
Hi, Some bug fix for osdetect.lua, it also detect windows 98/me, freedos, msdos and freebsd. Extend the function of grub.file_exist to allow testing multiple names at the same time, this simplify osdetect.lua. On Tue, Jun 23, 2009 at 4:06 AM, Pavel Roskin wrote: > On Tue, 2009-06-23 at 03:50 +08

Re: [PATCH] File access library for lua

2009-06-22 Thread Pavel Roskin
On Tue, 2009-06-23 at 03:50 +0800, Bean wrote: > strange, it's working here, what's the device list ? My mistake. I installed an unpatched GRUB. The entries are created now. However, the initrd is not picked up. The old kernel (vmlinuz-2.6.30-wl.old) goes before the new one (vmlinuz-2.6.30-wl

Re: [PATCH] File access library for lua

2009-06-22 Thread Bean
On Tue, Jun 23, 2009 at 3:28 AM, Pavel Roskin wrote: > On Tue, 2009-06-23 at 03:15 +0800, Bean wrote: > >> Oh, find the bug now, try this one. > > This one fails to find anything: > > sh:grub> source /boot/grub/osdetect.lua > error: Lua: grub:1: attempt to call field 'enum_device' (a nil value) > s

Re: [PATCH] File access library for lua

2009-06-22 Thread Pavel Roskin
On Tue, 2009-06-23 at 03:15 +0800, Bean wrote: > Oh, find the bug now, try this one. This one fails to find anything: sh:grub> source /boot/grub/osdetect.lua error: Lua: grub:1: attempt to call field 'enum_device' (a nil value) sh:grub> -- Regards, Pavel Roskin __

Re: [PATCH] File access library for lua

2009-06-22 Thread Bean
On Tue, Jun 23, 2009 at 2:59 AM, Pavel Roskin wrote: > On Tue, 2009-06-23 at 02:49 +0800, Bean wrote: > >> What's the name of kernel and initrd.img ? > > vmlinuz-2.6.30-wl and initrd-2.6.30-wl.img Hi, Oh, find the bug now, try this one. > > -- > Regards, > Pavel Roskin > > >

Re: [PATCH] File access library for lua

2009-06-22 Thread Pavel Roskin
On Tue, 2009-06-23 at 02:49 +0800, Bean wrote: > What's the name of kernel and initrd.img ? vmlinuz-2.6.30-wl and initrd-2.6.30-wl.img -- Regards, Pavel Roskin ___ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub

Re: [PATCH] File access library for lua

2009-06-22 Thread Bean
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

Re: [PATCH] File access library for lua

2009-06-22 Thread Pavel Roskin
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 funct

Re: [PATCH] File access library for lua

2009-06-22 Thread Bean
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 -

Re: [PATCH] File access library for lua

2009-06-22 Thread Robert Millan
On Mon, Jun 22, 2009 at 06:26:02PM +0800, Bean wrote: > On Mon, Jun 22, 2009 at 5:44 PM, Robert Millan wrote: > > On Mon, Jun 22, 2009 at 11:38:35AM +0800, Bean wrote: > >> > > >> > I'm feeling uneasy about having a parser in GRUB that is not used by > >> > default, but it's not related to the qual

Re: [PATCH] File access library for lua

2009-06-22 Thread Bean
On Mon, Jun 22, 2009 at 5:44 PM, Robert Millan wrote: > On Mon, Jun 22, 2009 at 11:38:35AM +0800, Bean wrote: >> > >> > I'm feeling uneasy about having a parser in GRUB that is not used by >> > default, but it's not related to the quality of the patch. >> >> Actually, this is about to change. > > I

Re: [PATCH] File access library for lua

2009-06-22 Thread Robert Millan
On Mon, Jun 22, 2009 at 11:38:35AM +0800, Bean wrote: > > > > I'm feeling uneasy about having a parser in GRUB that is not used by > > default, but it's not related to the quality of the patch. > > Actually, this is about to change. I don't mind LUA being supported if it's useful for some users,

Re: [PATCH] File access library for lua

2009-06-21 Thread Pavel Roskin
On Mon, 2009-06-22 at 11:38 +0800, Bean wrote: > Actually, this is about to change. The file function here can be used > in a script osdetect.lua to generate menu items at runtime, and I also > plans to integrate lua with menu viewer. OK, that sounds interesting! -- Regards, Pavel Roskin

Re: [PATCH] File access library for lua

2009-06-21 Thread Bean
Hi, On Mon, Jun 22, 2009 at 8:42 AM, Pavel Roskin wrote: > On Sun, 2009-06-21 at 19:33 +0800, Bean wrote: > >> I've added a few function in the lua grub library to access files: > ... >> I also enable the string library from lua. > > The patch doesn't introduce any compiler warnings, and that's go

Re: [PATCH] File access library for lua

2009-06-21 Thread Pavel Roskin
On Sun, 2009-06-21 at 19:33 +0800, Bean wrote: > I've added a few function in the lua grub library to access files: ... > I also enable the string library from lua. The patch doesn't introduce any compiler warnings, and that's good. It makes lua.mod bigger by about 10%, but it's very little comp

[PATCH] File access library for lua

2009-06-21 Thread Bean
Hi, I've added a few function in the lua grub library to access files: enum_device - enumerate devices enum_file - enumerate files file_open - open file file_close - close file file_seek - seek file file_read - read n bytes file_getline - read a line file_getsize - get file size file_getpos - get