Skip to contentSkip to conversation

Can LUA e coming with future Grub2

DISCUSSION y.volta 5 participants 7 messages Sep 3, 2008 – Sep 4, 2008

lore
Share & tools
lore

y.volta

author
#0 lore raw

hi,

i get to know the Fancy menu branch has lua supported, and just wondering, the
official release of Grub2 will have Lua inside ( as a mod )?

if so, i'm usre, it will extend grub2 much more: for it can load its function
library and its scripts. Let's suppose we are trying develop a window GUI style menu system, just like the XOSL does, we can make this as a lua module, user can design its dialog or controls layout in its scripts and 'require ("gui.so");' to have modern window based menu UI. ;-)

at the same time, we can also use lua to extend the grub.cfg, isn't it?

----------------
y.volta

#1 lore raw
Quoted 5 lines · On Wed, 3 Sep 2008 09:08:13 +0800 "y.volta" <[email protected]> wrote:

hi,

i get to know the Fancy menu branch has lua supported, and just
wondering, the official release of Grub2 will have Lua inside ( as a mod )?

It would be cool, to be sure! I never used Lua before, and it was a great experience integrating it into GRUB; Lua is very easy and clean to integrate, and it makes adding totally customizable functionality to themes really easy.

I haven't had a chance to really discuss the possibility of Lua support with the core GRUB developers, however.

My plan was to modularize Lua in such a way that it is an optionally loadable piece of the gfxmenu functionality. Currently the Lua branch has a hard dependency on Lua.

Quoted 9 lines

if so, i'm usre, it will extend grub2 much more: for it can load
its function library and its scripts. Let's suppose we are trying develop a window GUI style menu system, just like the XOSL does, we can make this as a lua module, user can design its dialog or controls layout in its scripts and 'require ("gui.so");' to have modern window based menu UI. ;-)

at the same time, we can also use lua to extend the grub.cfg,
isn't it?

Actually, I think replacing GRUB's "bash-ish" scripting with Lua would be great in many ways, but it is true that Lua (at ~100 KB) is larger than the GRUB script engine.

Regards,
Colin

author
#2 lore raw

For the Grub2 internal script engine, yes, it is little. but need more work to be improved. About the size, i think, Lua can be a replacement if this lua.mod is available at runtime. at the same time, why not load gziped mod file from disk? this will reduce the size of lua module: 100,436 bytes -> 49,766.

But the benifit of using Lua, i think, is for graphic menu. the gfxmenu uses a strange script engine, it is hard to learn for a common user; but the Lua, it is easy. ;-)

So, it is good to have lua support in Grub2.

----------------------
Y.Volta

#3 lore raw
Quoted 6 lines · y.volta

For the Grub2 internal script engine, yes, it is little. but need more work to be improved. About the size, i think, Lua can be a replacement if this lua.mod is available at runtime. at the same time, why not load gziped mod file from disk? this will reduce the size of lua module: 100,436 bytes -> 49,766.

Quoted 6 lines

But the benifit of using Lua, i think, is for graphic menu. the gfxmenu uses a strange script engine, it is hard to learn for a common user; but the Lua, it is easy. ;-)

So, it is good to have lua support in Grub2.

Hi,

In my suggestion to split normal mode, the script engine is separated and can be replaced, as long as they export a certain interface that return information like the menu items, etc. But now, I'm waiting for the handler patch, as it's the basic of the new model.

Signature · 1 line
Bean
#4 lore raw
Quoted 12 lines · Bean
Quoted 11 lines · y.volta

For the Grub2 internal script engine, yes, it is little. but need more work to be improved. About the size, i think, Lua can be a replacement if this lua.mod is available at runtime. at the same time, why not load gziped mod file from disk? this will reduce the size of lua module: 100,436 bytes -> 49,766.

But the benifit of using Lua, i think, is for graphic menu. the gfxmenu uses a strange script engine, it is hard to learn for a common user; but the Lua, it is easy. ;-)

Quoted 8 lines
Quoted 1 line

So, it is good to have lua support in Grub2.

Hi,

In my suggestion to split normal mode, the script engine is separated and can be replaced, as long as they export a certain interface that return information like the menu items, etc. But now, I'm waiting for the handler patch, as it's the basic of the new model.

Note that size is still an issue, though. For example coreboot users will usually want to use scripting for the grub.cfg they store in their ROM.

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."
#5 lore raw
Quoted 16 lines · Robert Millan
Quoted 15 lines · Bean
Quoted 6 lines · y.volta

For the Grub2 internal script engine, yes, it is little. but need more work to be improved. About the size, i think, Lua can be a replacement if this lua.mod is available at runtime. at the same time, why not load gziped mod file from disk? this will reduce the size of lua module: 100,436 bytes -> 49,766.

Quoted 6 lines

But the benifit of using Lua, i think, is for graphic menu. the gfxmenu uses a strange script engine, it is hard to learn for a common user; but the Lua, it is easy. ;-)

So, it is good to have lua support in Grub2.

Hi,

Quoted 7 lines
Quoted 4 lines

In my suggestion to split normal mode, the script engine is separated and can be replaced, as long as they export a certain interface that return information like the menu items, etc. But now, I'm waiting for the handler patch, as it's the basic of the new model.

Note that size is still an issue, though. For example coreboot users will usually want to use scripting for the grub.cfg they store in their ROM.

Hi,

I like the idea of using Lua personally for graphical menu related scripting and in my opinion it could be additional script that could be used.

User could in example defined scripting language in a bit same way that you do that in HTML pages:

lua:"script-filename.lua"

grub:"exec grub-script-filename"

own-extension:"do this and this effect that is integrated to some other module"

In order to one of those work, you need to load script module that registers handler for it.

Do anyone have skills to decipher Lua's license is it compatible with GPLv3 ?

Thanks,
Vesa Jääskeläinen

#6 lore raw
Quoted 3 lines · Vesa Jääskeläinen

Do anyone have skills to decipher Lua's license is it compatible with GPLv3 ?

Yes. It's a standard MIT/X11 style license.

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."