From 9d26cf93e58b529cf75e77cf1c09909e6c4233b4 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Wed, 14 Jul 2010 14:14:18 +0100 Subject: [PATCH] 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. --- common.inc | 5 +++-- debian/changelog | 3 +++ menuconfig.inc | 21 +++++++++++++++------ 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/common.inc b/common.inc index 4d37ccd..7629607 100644 --- a/common.inc +++ b/common.inc @@ -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 diff --git a/debian/changelog b/debian/changelog index 46f1987..f931e99 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Wed, 14 Jul 2010 14:12:12 +0100 diff --git a/menuconfig.inc b/menuconfig.inc index 9685c7d..1659304 100644 --- a/menuconfig.inc +++ b/menuconfig.inc @@ -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