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.
/* Imported functions */
extern int strcasecmp(const char *s1, const char *s2);
extern int strncasecmp(const char *cs, const char *ct, size_t n);
/* 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
typedef enum {
cft_strg, cft_flag, cft_end
static void printlabel (char *label, int defflag)
{
int len = strlen (label);
static void printlabel (char *label, int defflag)
{
int len = strlen (label);
if (!printl_count)
prom_printf ("\n");
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++;
while (len++ < 25)
prom_putchar (' ');
printl_count++;
if (alias)
label = alias + 1;
}
if (alias)
label = alias + 1;
}
+ if(!strcmp(bootoncelabel,label))
+ defflag=2;
+ else if(!strcmp(ret,label))
defflag=1;
else
defflag=0;
defflag=1;
else
defflag=0;