Skip to contentSkip to conversation

grub2 file browser draft

DISCUSSION adrian15 2 participants 2 messages Oct 4, 2006 – Oct 5, 2006

lore
Share & tools
lore

adrian15

author
#0 lore raw

Marco Gerards you asked me the other day about scripting. If there was something missing or any other thing that he could do.

This draft about a grub2 file draft can help him thinking about how powerful is his scripting or not.

The user sees inside a menu:
Floppy1
Floppy2
HardDisk1
HardDisk2

He selects HardDisk1. He sees another menu:
View
Save as Argument 1
Save as Argument 2
Setup Grub Here
This is Grub Root (Only if the hard disk/device has no partitions)
He selects View. He sees another menu:
hda1
hda2
hda3
hda4
hda5
He selects hda1. He sees another menu:
View
Save as Argument 1
Save as Argument 2
Setup Grub Here
This is Grub Root (Only if partition filesystem is grub readable)
He selects View. He sees another menu:
/boot
/etc
/var
He selects /etc. He sees another menu:
View
Save as Argument 1
Save as Argument 2
He selects View. He sees another menu:
fstab
config1
config2
He select fstab. He sees another menu:
View
Save as Argument 1
Save as Argument 2
Let's say he returns to previous menu where he is seeing /etc folder. He select my_index.html. He sees another menu:
View inside a web browser (GRUB2 will have a module with basic html
reading I suppose)
View
Save as Argument 1
Save as Argument 2

So Marco Gerards....
Do you think that this can be done with your grub scripting? Or the grub2 scripting needs more hacking?

adrian15

#1 lore raw

adrian15 <[email protected]> writes:

Hi Adrian,

Quoted 5 lines

Marco Gerards you asked me the other day about scripting. If there was something missing or any other thing that he could do.

This draft about a grub2 file draft can help him thinking about how powerful is his scripting or not.

Some of these things are possible (like using variables, etc). Other things are not possible yet. One of the most import (at least for you!) missing constructs is the `for' which can be used to iterate over files in bash.

I noticed you mention hda1 here, which is a Linux device name. I have explained you before it is technically not possible to translate GRUB device names to Linux device names. I wish it was possible, but unfortunately it currently isn't because the BIOS is used to access harddisks.

Here are some things I would like to work on:

- Error handling. It should become very clear how errors are dealt with from scripts.

- The `for' loop. This is useful in some cases, for example to automatically include files, to generate menu entries, etc, etc.

- Generating menu entries. My plan is to make it possible to create templates over which you can iterate. I will explain this another time in detail.

- Completing/rewriting the test command (which I almost finished, btw).

- Documentation. This is the most important thing that is currently lacking. I will soon write a document that describes the current functionality and the functionality I plan to implement. This is important for people who like to test all this, but more
importantly: it gives fellow developers the chance to influence what I am doing, criticize it and to take part in the discussion about the syntax.

- Adding random features and bug fixing.

The documentation will come within a few weeks (or days, who knows...). It's important to me and other people that these features can and will be discussed.

--
Marco