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 panel.show
} if } if
boot.buf menu.entry 0 boot.buf menu.indices menu.entry get 0
} def } def
@ -438,7 +438,7 @@
bc.cmd print "<< (press ESC) " print trace bc.cmd print "<< (press ESC) " print trace
} if } if
bc.cmd menu.entry bc.cmd menu.indices menu.entry get
} def } def
@ -520,6 +520,7 @@
/menu.args exch def /menu.args exch def
/menu.texts exch def /menu.texts exch def
/menu.humans exch def /menu.humans exch def
/menu.indices exch def
timeout.hidden { timeout.hidden {
window.splash 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 * The gfxboot com32 module in syslinux parses the configuration file for
us, but only gives us the human-readable labels. Convert them back to 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. 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 -- 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.newargs menuconfig.args length 1 sub array def
/menuconfig.newentries menuconfig.entries length 1 sub array def /menuconfig.newentries menuconfig.entries length 1 sub array def
/menuconfig.newhumans menuconfig.humans 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 { menuconfig.idx 0 ne {
0 1 menuconfig.idx 1 sub { 0 1 menuconfig.idx 1 sub {
menuconfig.args over get menuconfig.args over get
@ -90,7 +91,9 @@
menuconfig.entries over get menuconfig.entries over get
menuconfig.newentries 2 index rot put menuconfig.newentries 2 index rot put
menuconfig.humans over get 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 } for
} if } if
@ -102,13 +105,16 @@
menuconfig.entries over 1 add get menuconfig.entries over 1 add get
menuconfig.newentries 2 index rot put menuconfig.newentries 2 index rot put
menuconfig.humans over 1 add get 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 } for
} if } if
/menuconfig.args menuconfig.newargs def /menuconfig.args menuconfig.newargs def
/menuconfig.entries menuconfig.newentries def /menuconfig.entries menuconfig.newentries def
/menuconfig.humans menuconfig.newhumans def /menuconfig.humans menuconfig.newhumans def
/menuconfig.indices menuconfig.newindices def
return return
} if } if
@ -166,14 +172,16 @@
free free
} def } 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 % The returned menu_args_array (kernel parameters), menu_entries_array
% (identifiers), and menu_humans_array (human-readable names) will have any % (identifiers), menu_humans_array (human-readable names), and
% hidden entries removed. % menu_indices_array (original indices) will have any hidden entries
% removed.
/menuconfig.init { /menuconfig.init {
dup length array /menuconfig.args exch def dup length array /menuconfig.args exch def
over length array /menuconfig.entries exch def over length array /menuconfig.entries exch def
over length array /menuconfig.humans exch def over length array /menuconfig.humans exch def
over length array /menuconfig.indices exch def
% copy input arrays; initialise menuconfig.humans % copy input arrays; initialise menuconfig.humans
/menuconfig.idx 0 def /menuconfig.idx 0 def
@ -185,6 +193,7 @@
{ {
dup menuconfig.entries menuconfig.idx rot put dup menuconfig.entries menuconfig.idx rot put
menuconfig.humans menuconfig.idx rot put menuconfig.humans menuconfig.idx rot put
menuconfig.indices menuconfig.idx dup put
/menuconfig.idx inc /menuconfig.idx inc
} forall } forall
@ -197,5 +206,5 @@
.undef menuconfig.parse .undef menuconfig.parse
menuconfig.humans menuconfig.entries menuconfig.args menuconfig.indices menuconfig.humans menuconfig.entries menuconfig.args
} def } def

Loading…
Cancel
Save