grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SOC - SGD based on grub2 - Menu and scripting status


From: adrian15
Subject: Re: SOC - SGD based on grub2 - Menu and scripting status
Date: Fri, 28 Apr 2006 13:42:50 +0200
User-agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]