On Sunday 13 April 2008 16:17:39 Felipe Sateler wrote:
> On Wednesday 19 March 2008 23:10:58 Robert Millan wrote:
> > Hi!
> >
> > On Sun, Mar 16, 2008 at 02:36:37PM -0300, Felipe Sateler wrote:
> > > Package: grub-pc
> > > Version: 1.96+20080228-1
> > > Followup-For: Bug #470398
> > >
> > > The attached patch provides a possible implementation for an altoptions
> > > mechanism.
> >
> > Thanks for your effort.  Please, can you send this to [EMAIL PROTECTED]
> > ?
>
> Sorry for the delay, Gmail's spam filter ate this message :(. I'm sending
> this now.

I have tried but the list keeps rejecting my mails. Attached are a patch to 
add the options, and a second one to automatically export those variables.

-- 
Felipe Sateler
--- 10_linux.orig	2008-03-07 13:19:07.000000000 -0300
+++ /etc/grub.d/10_linux	2008-03-07 13:28:57.000000000 -0300
@@ -128,6 +128,24 @@
   cat << EOF
 }
 EOF
+  for alternative in $GRUB_ALTERNATIVES ; do
+    var_name=`echo GRUB_ALTERNATIVE_${alternative}_OPTS`
+    alt_options=`eval "echo \\$$var_name"`
+    var_name=`echo GRUB_ALTERNATIVE_${alternative}_NAME`
+    alt_name=`eval "echo \\$$var_name"`
+    cat << EOF
+menuentry "${OS}, linux ${version} (${alt_name})" {
+	linux	${grub_dirname}/${basename} root=${GRUB_DEVICE} ro ${GRUB_CMDLINE_LINUX} ${alt_options}
+EOF
+    if test -n "${initrd}" ; then
+      cat << EOF
+	initrd	${grub_dirname}/${initrd}
+EOF
+    fi
+    cat << EOF
+}
+EOF
+  done
 
   list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '`
 done
--- update-grub.orig	2008-04-13 16:27:58.000000000 -0400
+++ update-grub	2008-04-13 16:29:43.000000000 -0400
@@ -118,6 +118,13 @@
 
 if test -f ${sysconfdir}/default/grub ; then
   . ${sysconfdir}/default/grub
+  if [ ! -z "$GRUB_ALTERNATIVES" ] ; then
+    export GRUB_ALTERNATIVES
+    for altoption in $GRUB_ALTERNATIVES ; do
+      export GRUB_ALTERNATIVE_${altoption}_OPTS
+      export GRUB_ALTERNATIVE_${altoption}_NAME
+    done
+  fi
 fi
 
 # if ${GRUB_TERMINAL} is set, check it has a sane value.  if undefined,

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to