From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1FZRP3-0005mF-I5 for mharc-grub-devel@gnu.org; Fri, 28 Apr 2006 07:44:53 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FZRP2-0005m1-3v for grub-devel@gnu.org; Fri, 28 Apr 2006 07:44:52 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FZRP1-0005lp-LG for grub-devel@gnu.org; Fri, 28 Apr 2006 07:44:51 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FZRP1-0005lm-CW for grub-devel@gnu.org; Fri, 28 Apr 2006 07:44:51 -0400 Received: from [193.144.10.29] (helo=relay2.udl.es) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FZRS8-0001wE-Jh for grub-devel@gnu.org; Fri, 28 Apr 2006 07:48:05 -0400 Received: from jupiter.udl.net (jupiter.udl.net [172.16.2.2]) by relay2.udl.es (8.13.6/8.13.4) with ESMTP id k3SBiWsr028248 for ; Fri, 28 Apr 2006 13:44:37 +0200 Received: from [172.16.2.100] (eup33_01 [172.16.2.100]) by jupiter.udl.net (8.11.7p1+Sun/8.11.6) with ESMTP id k3SBgnq16643 for ; Fri, 28 Apr 2006 13:42:54 +0200 (MET DST) Message-ID: <4451FFBA.2050203@raulete.net> Date: Fri, 28 Apr 2006 13:42:50 +0200 From: adrian15 User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: grub-devel@gnu.org References: <200604251605.k3PG58Ax008963@dell01.dinaserver.com> In-Reply-To: <200604251605.k3PG58Ax008963@dell01.dinaserver.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.88/1428/Thu Apr 27 20:39:31 2006 on relay2.udl.es X-Virus-Status: Clean Subject: Re: SOC - SGD based on grub2 - Menu and scripting status X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Apr 2006 11:44:52 -0000 >>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