All of lore.kernel.org
 help / color / mirror / Atom feed
From: adrian15 <adrian15@raulete.net>
To: grub-devel@gnu.org
Subject: Re: SOC - SGD based on grub2 - Menu and scripting status
Date: Fri, 28 Apr 2006 13:42:50 +0200	[thread overview]
Message-ID: <4451FFBA.2050203@raulete.net> (raw)
In-Reply-To: <200604251605.k3PG58Ax008963@dell01.dinaserver.com>

>>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	other threads:[~2006-04-28 11:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200604251605.k3PG58Ax008963@dell01.dinaserver.com>
2006-04-28 11:42 ` adrian15 [this message]
2006-05-01 18:57   ` SOC - SGD based on grub2 - Menu and scripting status Marco Gerards
2006-04-28 11:48 ` adrian15
     [not found] <200605011855.k41ItvdZ029423@dell01.dinaserver.com>
2006-05-02 16:18 ` adrian15
2006-04-24 10:48 adrian15
2006-04-24 16:49 ` Marco Gerards
2006-04-24 18:10   ` Yoshinori K. Okuji
2006-04-24 18:36     ` Marco Gerards
2006-04-24 18:44       ` Yoshinori K. Okuji
2006-04-25 20:40       ` Vesa Jääskeläinen
2006-04-25 20:46         ` Marco Gerards

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4451FFBA.2050203@raulete.net \
    --to=adrian15@raulete.net \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.