From a8e74b2834664543166744cf0832e1d6db36347f Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 11 Apr 2011 14:59:45 -0700 Subject: menu: Add "menu hiddenkey" to make terminating menu hidden a command Use "menu hiddenkey" together with "menu hidden" for a one-keystroke action. Signed-off-by: H. Peter Anvin --- com32/libutil/Makefile | 3 +- com32/libutil/include/getkey.h | 4 ++ com32/libutil/keyname.c | 133 +++++++++++++++++++++++++++++++++++++++++ com32/menu/menu.h | 2 + com32/menu/menumain.c | 2 +- com32/menu/readconfig.c | 31 +++++++++- doc/menu.txt | 16 +++++ 7 files changed, 188 insertions(+), 3 deletions(-) create mode 100644 com32/libutil/keyname.c diff --git a/com32/libutil/Makefile b/com32/libutil/Makefile index 02789ca6..7a6b5272 100644 --- a/com32/libutil/Makefile +++ b/com32/libutil/Makefile @@ -32,7 +32,8 @@ topdir = ../.. include ../MCONFIG -LIBOBJS = ansiline.o ansiraw.o get_key.o sha1hash.o unbase64.o \ +LIBOBJS = ansiline.o ansiraw.o get_key.o keyname.o \ + sha1hash.o unbase64.o \ md5.o crypt-md5.o sha256crypt.o sha512crypt.o base64.o LNXLIBOBJS = $(patsubst %.o,%.lo,$(LIBOBJS)) diff --git a/com32/libutil/include/getkey.h b/com32/libutil/include/getkey.h index 52312a25..a46de812 100644 --- a/com32/libutil/include/getkey.h +++ b/com32/libutil/include/getkey.h @@ -75,6 +75,10 @@ #define KEY_INSERT 0x0128 #define KEY_DELETE 0x0129 +#define KEY_MAX 0x012a + int get_key(FILE *, clock_t); +int key_name_to_code(const char *); +const char *key_code_to_name(int); #endif /* LIBUTIL_GETKEY_H */ diff --git a/com32/libutil/keyname.c b/com32/libutil/keyname.c new file mode 100644 index 00000000..6aebbd59 --- /dev/null +++ b/com32/libutil/keyname.c @@ -0,0 +1,133 @@ +/* ----------------------------------------------------------------------- * + * + * Copyright 2011 Intel Corporation; author: H. Peter Anvin + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall + * be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * ----------------------------------------------------------------------- */ + +/* + * keyname.c + * + * Conversion between strings and get_key() key numbers. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct keyname { + const char *string; + int key; +}; + +static const struct keyname key_names[] = { + { "Backspace", KEY_BACKSPACE }, + { "Tab", KEY_TAB }, + { "Enter", KEY_ENTER }, + { "Esc", KEY_ESC }, + { "Escape", KEY_ESC }, + { "Space", ' ' }, + { "^?", KEY_DEL }, + { "F1", KEY_F1 }, + { "F2", KEY_F2}, + { "F3", KEY_F3 }, + { "F4", KEY_F4 }, + { "F5", KEY_F5 }, + { "F6", KEY_F6 }, + { "F7", KEY_F7 }, + { "F8", KEY_F8 }, + { "F9", KEY_F9 }, + { "F10", KEY_F10 }, + { "F11", KEY_F11 }, + { "F12", KEY_F12 }, + { "Up", KEY_UP }, + { "Down", KEY_DOWN }, + { "Left", KEY_LEFT }, + { "Right", KEY_RIGHT }, + { "PgUp", KEY_PGUP }, + { "PgDn", KEY_PGDN }, + { "Home", KEY_HOME }, + { "End", KEY_END }, + { "Insert", KEY_INSERT }, + { "Delete", KEY_DELETE }, + { NULL, KEY_NONE } +}; + +int key_name_to_code(const char *code) +{ + const struct keyname *name; + + if (code[0] && !code[1]) { + /* Single character */ + return (unsigned char)code[0]; + } else if (code[0] == '^' && code[1] && !code[2]) { + /* Control character */ + if (code[1] == '?') + return 0x7f; + else + return (unsigned char)code[1] & 0x9f; + } + + + for (name = key_names; name->string; name++) { + if (!strcasecmp(name->string, code)) + break; + } + return name->key; /* KEY_NONE at end of array */ +} + +const char *key_code_to_name(int key) +{ + static char buf[4]; + const struct keyname *name; + + if (key < 0) + return NULL; + + if (key < 0x100 && key != ' ') { + if (key == 0x7f) { + return "^?"; + } else if (key & 0x60) { + buf[0] = key; + buf[1] = '\0'; + } else { + buf[0] = '^'; + buf[1] = key | 0x40; + buf[2] = '\0'; + } + return buf; + } + + for (name = key_names; name->string; name++) { + if (key == name->key) + return name->string; + } + + return NULL; +} diff --git a/com32/menu/menu.h b/com32/menu/menu.h index 36c5669c..1db4d7c9 100644 --- a/com32/menu/menu.h +++ b/com32/menu/menu.h @@ -26,6 +26,7 @@ #include #include #include +#include #include "refstr.h" /* #define DEBUG 1 */ @@ -186,6 +187,7 @@ extern int shiftkey; extern int hiddenmenu; extern int clearmenu; extern long long totaltimeout; +extern const char *hide_key[KEY_MAX]; void parse_configs(char **argv); int draw_background(const char *filename); diff --git a/com32/menu/menumain.c b/com32/menu/menumain.c index 06725f37..df1eb185 100644 --- a/com32/menu/menumain.c +++ b/com32/menu/menumain.c @@ -727,7 +727,7 @@ static const char *do_hidden_menu(void) key = mygetkey(this_timeout); if (key != KEY_NONE) - return NULL; /* Key pressed */ + return hide_key[key]; /* NULL if no MENU HIDEKEY in effect */ timeout_left -= this_timeout; } diff --git a/com32/menu/readconfig.c b/com32/menu/readconfig.c index f3b0f96d..1d02120c 100644 --- a/com32/menu/readconfig.c +++ b/com32/menu/readconfig.c @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------- * * * Copyright 2004-2009 H. Peter Anvin - All Rights Reserved - * Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin + * Copyright 2009-2011 Intel Corporation; author: H. Peter Anvin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,6 +37,7 @@ int shiftkey = 0; /* Only display menu if shift key pressed */ int hiddenmenu = 0; int clearmenu = 0; long long totaltimeout = 0; +const char *hide_key[KEY_MAX]; /* Keep track of global default */ static int has_ui = 0; /* DEFAULT only counts if UI is found */ @@ -141,6 +142,22 @@ static char *looking_at(char *line, const char *kwd) return my_isspace(*p) ? p : NULL; /* Must be EOL or whitespace */ } +/* Get a single word into a new refstr; advances the input pointer */ +static char *get_word(char *str, const char **word) +{ + char *p = str; + char *q; + + while (*p && !my_isspace(*p)) + p++; + + *word = q = refstr_alloc(p - str + 1); + memcpy(q, str, p - str); + /* refstr_alloc() already inserted a terminating NUL */ + + return p; +} + static struct menu *new_menu(struct menu *parent, struct menu_entry *parent_entry, const char *label) { @@ -703,6 +720,18 @@ static void parse_config_file(FILE * f) m->menu_background = refdup_word(&p); } else if ((ep = looking_at(p, "hidden"))) { hiddenmenu = 1; + } else if (looking_at(p, "hiddenkey")) { + const char *key_name; + int key; + p = skipspace(p + 7); + p = get_word(p, &key_name); + p = skipspace(p); + key = key_name_to_code(key_name); + refstr_put(key_name); + if (key >= 0) { + refstr_put(hide_key[key]); + hide_key[key] = refstrdup(skipspace(p)); + } } else if ((ep = looking_at(p, "clear"))) { clearmenu = 1; } else if ((ep = is_message_name(p, &msgnr))) { diff --git a/doc/menu.txt b/doc/menu.txt index e2dd1e1c..892de48a 100644 --- a/doc/menu.txt +++ b/doc/menu.txt @@ -48,6 +48,22 @@ MENU HIDDEN All that is displayed is a timeout message. +MENU HIDDENKEY key command... + + If they key used to interrupt MENU HIDDEN is , then + execute the specified command instead of displaying the menu. + + Currently, the following key names are recognized: + + Backspace, Tab, Enter, Esc, Space, F1..F12, Up, Down, Left, + Right, PgUp, PgDn, Home, End, Insert, Delete + + ... in addition to all single characters plus the syntax ^X + for Ctrl-X. Note that single characters are treated as case + sensitive, so a different command can be bound to "A" than + "a". + + MENU CLEAR Clear the screen when exiting the menu, instead of leaving the -- cgit v1.2.3 From 67603c535d96bcd611d06b2844fcd3d33da90f22 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 11 Apr 2011 15:22:17 -0700 Subject: menu hiddenkey: fix parsing the config file option Fix parsing bugs in the config file. Signed-off-by: H. Peter Anvin --- com32/menu/readconfig.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/com32/menu/readconfig.c b/com32/menu/readconfig.c index 1d02120c..fdf2e27a 100644 --- a/com32/menu/readconfig.c +++ b/com32/menu/readconfig.c @@ -151,7 +151,7 @@ static char *get_word(char *str, const char **word) while (*p && !my_isspace(*p)) p++; - *word = q = refstr_alloc(p - str + 1); + *word = q = refstr_alloc(p - str); memcpy(q, str, p - str); /* refstr_alloc() already inserted a terminating NUL */ @@ -723,8 +723,7 @@ static void parse_config_file(FILE * f) } else if (looking_at(p, "hiddenkey")) { const char *key_name; int key; - p = skipspace(p + 7); - p = get_word(p, &key_name); + p = get_word(skipspace(p + 9), &key_name); p = skipspace(p); key = key_name_to_code(key_name); refstr_put(key_name); -- cgit v1.2.3 From ff43174663ef3eabb25d672d874500dc228a9b49 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 11 Apr 2011 15:23:05 -0700 Subject: menu: clear the timeout line on MENU HIDDENKEY Signed-off-by: H. Peter Anvin --- com32/menu/menumain.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/com32/menu/menumain.c b/com32/menu/menumain.c index df1eb185..5b3f6bd1 100644 --- a/com32/menu/menumain.c +++ b/com32/menu/menumain.c @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------- * * * Copyright 2004-2008 H. Peter Anvin - All Rights Reserved - * Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin + * Copyright 2009-2011 Intel Corporation; author: H. Peter Anvin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -726,8 +726,11 @@ static const char *do_hidden_menu(void) this_timeout = min(timeout_left, CLK_TCK); key = mygetkey(this_timeout); - if (key != KEY_NONE) + if (key != KEY_NONE) { + /* Clear the message from the screen */ + print_timeout_message(0, HIDDEN_ROW, ""); return hide_key[key]; /* NULL if no MENU HIDEKEY in effect */ + } timeout_left -= this_timeout; } -- cgit v1.2.3 From b51b322e9fa9b55ed0b181f3d5e5a1f1c8ed6342 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 11 Apr 2011 15:33:48 -0700 Subject: keytest: show the human name together with the keycode Since we now have library support for showing the keycode name, make keytest print that as well. Signed-off-by: H. Peter Anvin --- com32/samples/keytest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com32/samples/keytest.c b/com32/samples/keytest.c index b4f8f5b0..a5cdd5c1 100644 --- a/com32/samples/keytest.c +++ b/com32/samples/keytest.c @@ -43,7 +43,7 @@ static void cooked_keys(void) if (key >= 0x20 && key < 0x100) { putchar(key); } else { - printf("[%04x]", key); + printf("[%s,%04x]", key_code_to_name(key), key); } } } -- cgit v1.2.3 From eb27a41b4ad733a53efd576534426334b389d2ae Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 11 Apr 2011 15:41:26 -0700 Subject: keyname: better handling of named control characters Named control character (Tab, Enter, Backspace etc.) should use those names rather than caret sequences. Signed-off-by: H. Peter Anvin --- com32/libutil/keyname.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/com32/libutil/keyname.c b/com32/libutil/keyname.c index 6aebbd59..3b9e6581 100644 --- a/com32/libutil/keyname.c +++ b/com32/libutil/keyname.c @@ -110,10 +110,8 @@ const char *key_code_to_name(int key) if (key < 0) return NULL; - if (key < 0x100 && key != ' ') { - if (key == 0x7f) { - return "^?"; - } else if (key & 0x60) { + if (key > ' ' && key < 0x100) { + if (key & 0x60) { buf[0] = key; buf[1] = '\0'; } else { @@ -129,5 +127,12 @@ const char *key_code_to_name(int key) return name->string; } + if (key < ' ') { + buf[0] = '^'; + buf[1] = key | 0x40; + buf[2] = '\0'; + return buf; + } + return NULL; } -- cgit v1.2.3 From c4c4a898e5856bda4857834845d9f92a97271233 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 11 Apr 2011 15:42:06 -0700 Subject: keytest: make somewhat more comprehensible Someone may very well need to use keytest to figure out their keymappings. Make it a bit more user friendly. Signed-off-by: H. Peter Anvin --- com32/samples/keytest.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/com32/samples/keytest.c b/com32/samples/keytest.c index a5cdd5c1..09c041a1 100644 --- a/com32/samples/keytest.c +++ b/com32/samples/keytest.c @@ -37,7 +37,7 @@ static void cooked_keys(void) if (key == 0x03) { printf("[done]\n"); exit(0); - } else if (key == '?') + } else if (key == '!') return; if (key >= 0x20 && key < 0x100) { @@ -63,7 +63,8 @@ static void raw_keys(void) } else if (key == '!') return; - printf("<%02x>", key); + if (key != EOF) + printf("<%02x>", key); } } @@ -72,7 +73,7 @@ int main(void) console_ansi_raw(); printf("CLK_TCK = %d\n", (int)CLK_TCK); - printf("Press keys, end with Ctrl-C...\n"); + printf("Press keys, end with Ctrl-C, ! changes from cooked to raw\n"); for (;;) { cooked_keys(); -- cgit v1.2.3 From 0ac822d2744359de5e3bd6f19d9e33fb523a01ec Mon Sep 17 00:00:00 2001 From: Paulo Alcantara Date: Fri, 15 Apr 2011 14:55:29 -0300 Subject: libinstaller: implement syslinux_already_installed syslinux_already_installed function will be used in both extlinux and syslinux for checking if the boot sector has either the string "SYSLINUX" or "EXTLINUX" in the OEMID field. Signed-off-by: Paulo Alcantara --- libinstaller/syslxcom.c | 13 +++++++++++++ libinstaller/syslxcom.h | 1 + 2 files changed, 14 insertions(+) diff --git a/libinstaller/syslxcom.c b/libinstaller/syslxcom.c index b176f6d7..1de85aa5 100644 --- a/libinstaller/syslxcom.c +++ b/libinstaller/syslxcom.c @@ -284,3 +284,16 @@ int sectmap(int fd, sector_t *sectors, int nsectors) return sectmap_fib(fd, sectors, nsectors); } + +/* + * SYSLINUX installs the string 'SYSLINUX' at offset 3 in the boot + * sector; this is consistent with FAT filesystems. Earlier versions + * would install the string "EXTLINUX" instead, handle both. + */ +int syslinux_already_installed(int dev_fd) +{ + char buffer[8]; + + xpread(dev_fd, buffer, 8, 3); + return !memcmp(buffer, "SYSLINUX", 8) || !memcmp(buffer, "EXTLINUX", 8); +} diff --git a/libinstaller/syslxcom.h b/libinstaller/syslxcom.h index 39ca09d3..bf186ca6 100644 --- a/libinstaller/syslxcom.h +++ b/libinstaller/syslxcom.h @@ -18,5 +18,6 @@ ssize_t xpwrite(int fd, const void *buf, size_t count, off_t offset); void clear_attributes(int fd); void set_attributes(int fd); int sectmap(int fd, sector_t *sectors, int nsectors); +int syslinux_already_installed(int dev_fd); #endif -- cgit v1.2.3 From c3bac70e8a299934cce5450e3a7f8d1ee228d38a Mon Sep 17 00:00:00 2001 From: Paulo Alcantara Date: Fri, 15 Apr 2011 15:13:54 -0300 Subject: extlinux: use syslinux_already_installed instead of already_installed Signed-off-by: Paulo Alcantara --- extlinux/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extlinux/main.c b/extlinux/main.c index 21369e46..fb3cc779 100755 --- a/extlinux/main.c +++ b/extlinux/main.c @@ -766,7 +766,7 @@ int install_loader(const char *path, int update_only) if (devfd < 0) return 1; - if (update_only && !already_installed(devfd)) { + if (update_only && !syslinux_already_installed(devfd)) { fprintf(stderr, "%s: no previous syslinux boot sector found\n", program); close(devfd); -- cgit v1.2.3 From 205b829d0d9b6a6fe72b49b7ab763c75e27ebcdc Mon Sep 17 00:00:00 2001 From: Paulo Alcantara Date: Fri, 15 Apr 2011 15:21:10 -0300 Subject: extlinux: remove already_installed Signed-off-by: Paulo Alcantara --- extlinux/main.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/extlinux/main.c b/extlinux/main.c index fb3cc779..e5212a95 100755 --- a/extlinux/main.c +++ b/extlinux/main.c @@ -503,19 +503,6 @@ int install_file(const char *path, int devfd, struct stat *rst) return 1; } -/* - * SYSLINUX installs the string 'SYSLINUX' at offset 3 in the boot - * sector; this is consistent with FAT filesystems. Earlier versions - * would install the string "EXTLINUX" instead, handle both. - */ -int already_installed(int devfd) -{ - char buffer[8]; - - xpread(devfd, buffer, 8, 3); - return !memcmp(buffer, "SYSLINUX", 8) || !memcmp(buffer, "EXTLINUX", 8); -} - #ifdef __KLIBC__ static char devname_buf[64]; -- cgit v1.2.3 From fa6d94a16234683002235bea6d333162ba292da8 Mon Sep 17 00:00:00 2001 From: Paulo Alcantara Date: Fri, 15 Apr 2011 15:28:31 -0300 Subject: syslinux: check --update option properly Signed-off-by: Paulo Alcantara --- linux/syslinux.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linux/syslinux.c b/linux/syslinux.c index 97b6a306..c7a9ecc4 100755 --- a/linux/syslinux.c +++ b/linux/syslinux.c @@ -382,6 +382,10 @@ int main(int argc, char *argv[]) sync(); rmdir(mntpath); exit(0); + } else if (opt.update_only && !syslinux_already_installed(dev_fd)) { + fprintf(stderr, "%s: no previous syslinux boot sector found\n", + argv[0]); + exit(1); } else { fprintf(stderr, "%s: please specify --install or --update for the future\n", argv[0]); opt.update_only = 0; -- cgit v1.2.3 From 400330e6ac2422a41a984d177993d945ffacc98f Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 18 Apr 2011 13:53:19 -0700 Subject: NEWS: Document MENU HIDDENKEY Signed-off-by: H. Peter Anvin --- NEWS | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 5d9b5206..94c47ab9 100644 --- a/NEWS +++ b/NEWS @@ -48,7 +48,10 @@ Changes in 4.04: * Include a set of diagnostics by Gene Cumm. * Fixes for gcc 4.6 and binutils 2.21.51. * chain.c32: Allow "uuid" as a synonym to "guid". - * Handle directory names starting with .. for vfat and iso9660. + * Handle directory names starting with .. for vfat and + iso9660. + * New MENU HIDDENKEY command to provide a one-keystroke way to + activate a boot option from a hidden menu intro screen. Changes in 4.03: * Don't hang if no configuration file is found. -- cgit v1.2.3 From 830dd5801d9ab9347576ec7ab5c7427b247b67e4 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 18 Apr 2011 14:06:54 -0700 Subject: menu: allow "menu hiddenkey" to take multiple keys; run unlabel - Allow "menu hiddenkey" to take a comma-separated list of keys. - Run unlabel() on the commands passed to menu hiddenkey. XXX: Consider moving unlabelling to post-menu instead. Signed-off-by: H. Peter Anvin --- com32/menu/readconfig.c | 34 ++++++++++++++++++++++++++-------- doc/menu.txt | 9 ++++++--- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/com32/menu/readconfig.c b/com32/menu/readconfig.c index fdf2e27a..0ac2564a 100644 --- a/com32/menu/readconfig.c +++ b/com32/menu/readconfig.c @@ -143,7 +143,7 @@ static char *looking_at(char *line, const char *kwd) } /* Get a single word into a new refstr; advances the input pointer */ -static char *get_word(char *str, const char **word) +static char *get_word(char *str, char **word) { char *p = str; char *q; @@ -721,16 +721,27 @@ static void parse_config_file(FILE * f) } else if ((ep = looking_at(p, "hidden"))) { hiddenmenu = 1; } else if (looking_at(p, "hiddenkey")) { - const char *key_name; + char *key_name, *k, *ek; + const char *command; int key; p = get_word(skipspace(p + 9), &key_name); - p = skipspace(p); - key = key_name_to_code(key_name); - refstr_put(key_name); - if (key >= 0) { - refstr_put(hide_key[key]); - hide_key[key] = refstrdup(skipspace(p)); + command = refstrdup(skipspace(p)); + k = key_name; + for (;;) { + ek = strchr(k+1, ','); + if (ek) + *ek = '\0'; + key = key_name_to_code(k); + if (key >= 0) { + refstr_put(hide_key[key]); + hide_key[key] = refstr_get(command); + } + if (!ek) + break; + k = ek+1; } + refstr_put(key_name); + refstr_put(command); } else if ((ep = looking_at(p, "clear"))) { clearmenu = 1; } else if ((ep = is_message_name(p, &msgnr))) { @@ -1064,6 +1075,7 @@ void parse_configs(char **argv) const char *filename; struct menu *m; struct menu_entry *me; + int k; empty_string = refstrdup(""); @@ -1125,4 +1137,10 @@ void parse_configs(char **argv) if (m->onerror) m->onerror = unlabel(m->onerror); } + + /* Final global initialization, with all labels known */ + for (k = 0; k < KEY_MAX; k++) { + if (hide_key[k]) + hide_key[k] = unlabel(hide_key[k]); + } } diff --git a/doc/menu.txt b/doc/menu.txt index 892de48a..620527e6 100644 --- a/doc/menu.txt +++ b/doc/menu.txt @@ -48,7 +48,7 @@ MENU HIDDEN All that is displayed is a timeout message. -MENU HIDDENKEY key command... +MENU HIDDENKEY key[,key...] command... If they key used to interrupt MENU HIDDEN is , then execute the specified command instead of displaying the menu. @@ -61,8 +61,11 @@ MENU HIDDENKEY key command... ... in addition to all single characters plus the syntax ^X for Ctrl-X. Note that single characters are treated as case sensitive, so a different command can be bound to "A" than - "a". - + "a". One can bind the same command to multiple keys by giving + a comma-separated list of keys: + + menu hiddenkey A,a key_a_command + MENU CLEAR -- cgit v1.2.3 From 3c3ae582112e3da08b7a71128f36b66c8e3b641c Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 18 Apr 2011 14:12:58 -0700 Subject: diag: Don't remove BTARGET on make clean "make clean" should not remove BTARGET Signed-off-by: H. Peter Anvin --- diag/geodsp/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/diag/geodsp/Makefile b/diag/geodsp/Makefile index 4c8eff6f..6af0d2db 100644 --- a/diag/geodsp/Makefile +++ b/diag/geodsp/Makefile @@ -58,6 +58,7 @@ tidy dist: rm -Rf *.img clean: tidy - rm -f $(BTARGET) *.lst *.bin *_bin.c + rm -f *.lst *.bin *_bin.c spotless: clean + rm -f $(BTARGET) -- cgit v1.2.3 From 1370ad3a91803626d326abea253f9270bd6819c3 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 18 Apr 2011 14:24:17 -0700 Subject: spec: Use BuildRequires, add diag/ subdirectory Signed-off-by: H. Peter Anvin --- syslinux.spec.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/syslinux.spec.in b/syslinux.spec.in index c4b466b5..b82d9a14 100644 --- a/syslinux.spec.in +++ b/syslinux.spec.in @@ -11,7 +11,7 @@ Source0: ftp://ftp.kernel.org/pub/linux/utils/boot/syslinux/%{name}-%{VERSION}.t ExclusiveArch: i386 i486 i586 i686 athlon pentium4 x86_64 Packager: H. Peter Anvin Buildroot: %{_tmppath}/%{name}-%{VERSION}-root -BuildPrereq: nasm >= 2.03, perl +BuildRequires: nasm >= 2.03, perl Autoreq: 0 %ifarch x86_64 Requires: mtools, libc.so.6()(64bit) @@ -94,6 +94,7 @@ rm -rf %{buildroot} %{_datadir}/syslinux/*.0 %{_datadir}/syslinux/memdisk %{_datadir}/syslinux/dosutil/* +%{_datadir}/syslinux/diag/* %files devel %{_datadir}/syslinux/com32 -- cgit v1.2.3