Skip to contentSkip to conversation

gsd grub2 option proposal

DISCUSSION adrian15 2 participants 2 messages Aug 30, 2005 – Aug 31, 2005

lore
Share & tools
lore

adrian15

author
#0 lore raw

Well,

Here I am subscribed to devel grub mailing list.

I supposed that my former email
(grub2 grub super disk proposals, remember?)
you have decided that is good idea to implement commands called:

grub_title
echo

and some other ideas.

I wanted to talk about user interaction.
User Interaction is very important on Grub Super Disk.

I need the user to choose some options some variables.

Just below a option line there has to be a
command which is neither title
neither option.

Once every option is read (till next title or till end of file) the options are presented (in a menu):

2nd hard disk
3rd hard disk
4th hard disk

and once one of them is selected the lines which are below the selected option and the next one are executed.

In my example when we choose 2nd hard disk
the line:

swapped_hd_value=(hd1)
is executed.

So I am going to write you a hipotetical grub2 menu.lst grub2.cfg you call it now?
with the option idea and you tell me
if you have already developed something similar or if you're planning to do it.

# Default values of swapped disks and devices to boot

swapped_hd=2nd hard disk
swapped_hd_value=(hd1)
boot_dev=(fd0)

# grub_title is the variable for showing the grub title (in place of free 
mem and grub version)
grub_title=Swap 1st hard disk with $swapped_hd and boot $boot_dev

title Select Swapped hard disk
option 2nd hard disk
swapped_hd=2nd hard disk
swapped_hd_value=(hd1)
option 3rd hard disk
swapped_hd=3rd hard disk
swapped_hd_value=(hd2)
option 4th hard disk
swapped_hd_value=(hd3)
swapped_hd=4th hard disk

title Select device to boot
option 1st partition 2nd hard disk
boot_dev=(hd1,0)
option floppy
boot_dev=(fd0)
option cdrom
boot_dev=(cd)

title Go!
map (hd0) $swap_hd_value
map $swap_hd_value (hd0)
rootnoverify $boot_dev
boot

That's all folks!

adrian15

#1 lore raw
Quoted 3 lines · On Aug 30, 2005, at 1:28 PM, adrian15 wrote:

I wanted to talk about user interaction.
User Interaction is very important on Grub Super Disk.

First you need to define "Grub Super Disk," because I really don't know what you're talking about...

Quoted 29 lines

# Default values of swapped disks and devices to boot

swapped_hd=2nd hard disk
swapped_hd_value=(hd1)
boot_dev=(fd0)

# grub_title is the variable for showing the grub title (in place of free
mem and grub version)
grub_title=Swap 1st hard disk with $swapped_hd and boot $boot_dev

title Select Swapped hard disk
option 2nd hard disk
swapped_hd=2nd hard disk
swapped_hd_value=(hd1)
option 3rd hard disk
swapped_hd=3rd hard disk
swapped_hd_value=(hd2)
option 4th hard disk
swapped_hd_value=(hd3)
swapped_hd=4th hard disk

title Select device to boot
option 1st partition 2nd hard disk
boot_dev=(hd1,0)
option floppy
boot_dev=(fd0)
option cdrom
boot_dev=(cd)

Quoted 5 lines

title Go!
map (hd0) $swap_hd_value
map $swap_hd_value (hd0)
rootnoverify $boot_dev
boot

This might even work now, although obviously you would need to select two entries: some hard disk, and then "Go!". Doesn't seem very convenient to me.

If you're just trying to avoid typing that stuff under "Go!", I guess a script function would be useful here.

-Hollis