From 89f352cbee373069ed035476cb4c18027ff0a5b3 Mon Sep 17 00:00:00 2001 From: Paul Nasrat Date: Thu, 19 Apr 2007 10:13:43 +0100 Subject: [PATCH 1/1] yaboot menu user interface This patch allows for denoting a kernel label as a "boot-once" label when printing the menu of labels. The label flagged as default is marked with an asterisk (*). If a label matches the global bootoncelabel, I'm marking it with an ampersand (&). I'm ambivalent about the symbol used here, or even if it is. But I found this bit useful when debugging and testing the functionality, and it's trivial to add cleanly. I chose ampersand because it's immediately left of the asterisk on my keyboard. --- second/cfg.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/second/cfg.c b/second/cfg.c index 4167582..56b058a 100644 --- a/second/cfg.c +++ b/second/cfg.c @@ -29,6 +29,7 @@ /* Imported functions */ extern int strcasecmp(const char *s1, const char *s2); extern int strncasecmp(const char *cs, const char *ct, size_t n); +extern char bootoncelabel[1024]; typedef enum { cft_strg, cft_flag, cft_end @@ -482,10 +483,16 @@ static int printl_count = 0; static void printlabel (char *label, int defflag) { int len = strlen (label); + char a = ' '; if (!printl_count) prom_printf ("\n"); - prom_printf ("%s %s",defflag?"*":" ", label); + switch (defflag) { + case 1: a='*'; break; + case 2: a='&'; break; + default: a=' '; break; + } + prom_printf ("%c %s", a, label); while (len++ < 25) prom_putchar (' '); printl_count++; @@ -513,7 +520,9 @@ void cfg_print_images (void) if (alias) label = alias + 1; } - if(!strcmp(ret,label)) + if(!strcmp(bootoncelabel,label)) + defflag=2; + else if(!strcmp(ret,label)) defflag=1; else defflag=0; -- 2.39.2