Preserve the original indices of menu items so that we can pass them

accurately back to the boot loader.  The gfxboot com32 module in
syslinux requires this.
master
Colin Watson 14 years ago
parent 4a4c76ba27
commit 9d26cf93e5

@ -216,7 +216,7 @@
panel.show
} if
boot.buf menu.entry 0
boot.buf menu.indices menu.entry get 0
} def
@ -438,7 +438,7 @@
bc.cmd print "<< (press ESC) " print trace
} if
bc.cmd menu.entry
bc.cmd menu.indices menu.entry get
} def
@ -520,6 +520,7 @@
/menu.args exch def
/menu.texts exch def
/menu.humans exch def
/menu.indices exch def
timeout.hidden {
window.splash

3
debian/changelog vendored

@ -3,6 +3,9 @@ gfxboot-theme-ubuntu (0.10.0) UNRELEASED; urgency=low
* The gfxboot com32 module in syslinux parses the configuration file for
us, but only gives us the human-readable labels. Convert them back to
identifiers in that case so that we can translate them more easily.
* Preserve the original indices of menu items so that we can pass them
accurately back to the boot loader. The gfxboot com32 module in
syslinux requires this.
-- Colin Watson <cjwatson@debian.org> Wed, 14 Jul 2010 14:12:12 +0100

@ -83,6 +83,7 @@
/menuconfig.newargs menuconfig.args length 1 sub array def
/menuconfig.newentries menuconfig.entries length 1 sub array def
/menuconfig.newhumans menuconfig.humans length 1 sub array def
/menuconfig.newindices menuconfig.indices length 1 sub array def
menuconfig.idx 0 ne {
0 1 menuconfig.idx 1 sub {
menuconfig.args over get
@ -90,7 +91,9 @@
menuconfig.entries over get
menuconfig.newentries 2 index rot put
menuconfig.humans over get
menuconfig.newhumans 3 1 roll put
menuconfig.newhumans 2 index rot put
menuconfig.indices over get
menuconfig.newindices 3 1 roll put
} for
} if
@ -102,13 +105,16 @@
menuconfig.entries over 1 add get
menuconfig.newentries 2 index rot put
menuconfig.humans over 1 add get
menuconfig.newhumans 3 1 roll put
menuconfig.newhumans 2 index rot put
menuconfig.indices over 1 add get
menuconfig.newindices 3 1 roll put
} for
} if
/menuconfig.args menuconfig.newargs def
/menuconfig.entries menuconfig.newentries def
/menuconfig.humans menuconfig.newhumans def
/menuconfig.indices menuconfig.newindices def
return
} if
@ -166,14 +172,16 @@
free
} def
% ( menu_entries_array menu_args_array -- menu_humans_array menu_entries_array menu_args_array )
% ( menu_entries_array menu_args_array -- menu_indices_array menu_humans_array menu_entries_array menu_args_array )
% The returned menu_args_array (kernel parameters), menu_entries_array
% (identifiers), and menu_humans_array (human-readable names) will have any
% hidden entries removed.
% (identifiers), menu_humans_array (human-readable names), and
% menu_indices_array (original indices) will have any hidden entries
% removed.
/menuconfig.init {
dup length array /menuconfig.args exch def
over length array /menuconfig.entries exch def
over length array /menuconfig.humans exch def
over length array /menuconfig.indices exch def
% copy input arrays; initialise menuconfig.humans
/menuconfig.idx 0 def
@ -185,6 +193,7 @@
{
dup menuconfig.entries menuconfig.idx rot put
menuconfig.humans menuconfig.idx rot put
menuconfig.indices menuconfig.idx dup put
/menuconfig.idx inc
} forall
@ -197,5 +206,5 @@
.undef menuconfig.parse
menuconfig.humans menuconfig.entries menuconfig.args
menuconfig.indices menuconfig.humans menuconfig.entries menuconfig.args
} def

Loading…
Cancel
Save