Skip to contentSkip to conversation

SOC - SGD based on grub2 - Menu and scripting status

DISCUSSION adrian15 2 participants 3 messages Apr 28, 2006 – May 1, 2006 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

adrian15

author
#1 lore raw
Quoted 6 lines
Quoted 3 lines

5) I need to define "something" (In my grub legacy fork is a menu.lst) that lets me choose the harddisk-partition which I want to work on. Can I make it easily?

You mean as a variable? That's possible.

I will explain this point in more detail if you don't mind. Here goes copy-pasted
1) the first the "lst" for hard disks and then
2)the second one the "sh" that makes the "lst" for partitions.
3) An "lst" for making easier to call the selection of partitions from inside a function or whatever.
4) An example of how this menues/selectors are called. (lst)

I'm not asking you to develop a command for giving me this lst on the fly adapted to the user pc. You know what I was telling before: If the users hard disk has only three partitions make an array with only three values which are the partitions.

I'm asking you to think about new features that scripting should have so that the developing of this command is far easy.

OFFTOPIC NOTE: I am working on grub legacy call and back commands so that what you see below actually works. I think this night it will work ok but who knows.

adrian15

hard.disk.lst:
==============

title $(choose_title)
pause
title NATURAL LINUX-IDE LINUX-SCSI GNU/GRUB
pause
title 1. hda sda hd0
set out_device=hd0
set out_hd=hd0
set out_lide_hd=hda
set out_lscsi_hd=sda
back

title 2. hdb sdb hd1
set out_device=hd1
set out_hd=hd1
set out_lide_hd=hdb
set out_lscsi_hd=sdb
back

title 3. hdc sdc hd2
set out_device=hd2
set out_hd=hd2
set out_lide_hd=hdc
set out_lscsi_hd=sdc
back

title 4. hdd sdd hd3
set out_device=hd3
set out_hd=hd3
set out_lide_hd=hdd
set out_lscsi_hd=sdd
back

generate_part_lst.sh:
======================

SDG_PARTITIONS_LIST="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17";

cat << EOF

title \$(choose_title)
pause
title NATURAL LINUX-IDE LINUX-SCSI GNU/GRUB GNU/HURD
pause
EOF

for n_partition in $SDG_PARTITIONS_LIST; do

ln_partition=$[$n_partition + 1];

cat << EOF

title ${ln_partition} \$(out_lide_hd)${ln_partition} \$(out_lscsi_hd)${ln_partition} (\$(out_hd),${n_partition}) \$(out_hurd_hd)s${ln_partition}
set out_device=(\$(out_hd),${n_partition}) set out_part=(\$(out_hd),${n_partition}) set out_lide_part=\$(out_lide_hd)${ln_partition} set out_lscsi_part=\$(out_lscsi_hd)${ln_partition} set out_hurd_part=\$(out_hurd_hd)s${ln_partition}

EOF

done

partition.lst:
===============
default 0
timeout 0
title Choose hard disk and partition
call $(grub_device)/boot/grub/choose/hard_disk.lst call $(grub_device)/boot/grub/choose/part.lst back

test.lst:
===========
title THIS IS A TEST FOR CALLING hard disk
set choose_title="TEST FOR CHOOSING HARD DISK TITLE"
call $(grub_device)/boot/grub/choose/hard_disk.lst
title THIS IS A TEST FOR CALLING part.lst
set choose_title="TEST FOR CHOOSING PART ONLY TITLE"
call $(grub_device)/boot/grub/choose/part.lst
title THIS IS A TEST FOR CALLING partition (Both hard disk and partition) set choose_title="TEST FOR CHOOSING PART AND HD TITLE"
call $(grub_device)/boot/grub/choose/partition.lst

This is the begginnings of the generated part.lst and you know it is 9 times bigger:
=======================================================================
title $(choose_title)
pause
title NATURAL LINUX-IDE LINUX-SCSI GNU/GRUB GNU/HURD
pause

title 1 $(out_lide_hd)1 $(out_lscsi_hd)1 ($(out_hd),0) $(out_hurd_hd)s1
set out_device=($(out_hd),0)
set out_part=($(out_hd),0)
set out_lide_part=$(out_lide_hd)1
set out_lscsi_part=$(out_lscsi_hd)1
set out_hurd_part=$(out_hurd_hd)s1

title 2 $(out_lide_hd)2 $(out_lscsi_hd)2 ($(out_hd),1) $(out_hurd_hd)s2
set out_device=($(out_hd),1)
set out_part=($(out_hd),1)
set out_lide_part=$(out_lide_hd)2
set out_lscsi_part=$(out_lscsi_hd)2
set out_hurd_part=$(out_hurd_hd)s2

adrian15

#2 lore raw
Quoted 13 lines · adrian15 <[email protected]> writes:
Quoted 4 lines
Quoted 3 lines

5) I need to define "something" (In my grub legacy fork is a menu.lst) that lets me choose the harddisk-partition which I want to work on. Can I make it easily?

You mean as a variable? That's possible.

I will explain this point in more detail if you don't mind. Here goes copy-pasted
1) the first the "lst" for hard disks and then
2)the second one the "sh" that makes the "lst" for partitions.
3) An "lst" for making easier to call the selection of partitions from inside a function or whatever.
4) An example of how this menues/selectors are called. (lst)

Quoted 7 lines

I'm not asking you to develop a command for giving me this lst on the fly adapted to the user pc. You know what I was telling before: If the users hard disk has only three partitions make an array with only three values which are the partitions.

I'm asking you to think about new features that scripting should have so that the developing of this command is far easy.

I was thinking about an iterator function. Perhaps that might be the easiest to use... Please watch CVS closely. I am actively working on scripting, as much as time permits.

--
Marco

author
#3 lore raw
In reply to a message not in the archive
Quoted 9 lines · Marco Gerards
Quoted 3 lines

Will this mean Adrian can use it for menu entries as well? I think that is what he wants to do.

In my idea, yes. I can say anything before implementing. ;)

Okuji

Yes... The thing that when meaning translation I was thinking about SGD, which is kind of a GUI for Grub so... I did not think about Grub messages but to menu entries as Marco suggested.

However you're right Grub messages could also be translated.

Currently I have SGD (only menu entries) translated to various languages with a three-level structure... one for algorithm... one for "kind of universal language" and one for the actual languages. It's implemented with bash variables and uses sed and other unix tools and it is not perfect...

I know there was this gettext thing and in the first place I didn't get to work it with bash (I think I needed to recompile it) so I discarded the idea.

Maybe I will take a look at gettext again for SG2D.

adrian15