From e73eea7e7d4e482f12125cdc0689dd31fe114547 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 27 Jan 2009 17:30:40 +0000 Subject: do not display some menu entries (eg: noacpi) many options can be obtained using "Fx", but we still keep some entries in case gfxboot fails. We simply hide them when gfxboot is used --- src/common.inc | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'src/common.inc') diff --git a/src/common.inc b/src/common.inc index a8251be..af6a46d 100644 --- a/src/common.inc +++ b/src/common.inc @@ -459,6 +459,50 @@ } def +% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +% get rid of some entries +% the resulting arrrays are malloced +% ( menu_entries_array cmdline_args_array ) == > ( menu_entries_array cmdline_args_array ) +/filter_install_menu_items { + /tmp.args exch def + /tmp.texts exch def + + /keep_it { + syslinux { + dup "alt0" eq + over "alt1" eq or + over "vgalo" eq or + over "vgahi" eq or + over "text" eq or + over "noacpi" eq or + } { + dup "linux-nonfb" eq + } ifelse + exch pop not + } def + + 0 + tmp.texts { + keep_it { 1 add } if + } forall + dup + array /menu.args exch def + array /menu.texts exch def + + /tmp.i 0 def + /tmp.dest_i 0 def + tmp.texts { + keep_it { + menu.args tmp.dest_i tmp.args tmp.i get put + menu.texts tmp.dest_i tmp.texts tmp.i get put + /tmp.dest_i tmp.dest_i 1 add def + } if + /tmp.i tmp.i 1 add def + } forall + + menu.texts menu.args +} def + % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % ( menu_entries_array cmdline_args_array defaultentry ) == > ( ) /MenuInit { @@ -473,6 +517,10 @@ /menu.entry -1 def /menu.dentry exch def + /menu.args.real exch def + /menu.texts.real exch def + + menu.texts.real menu.args.real filter_install_menu_items /menu.args exch def /menu.texts exch def -- cgit v1.2.1