rv = -1;
}
}
+ if (opt.menu_save) {
+ if (syslinux_setadv(ADV_MENUSAVE, strlen(opt.menu_save), opt.menu_save)) {
+ fprintf(stderr, "%s: not enough space for menu-save label\n",
+ program);
+ rv = -1;
+ }
+ }
return rv;
}
usage(EX_USAGE, 0);
if (opt.update_only == -1) {
- if (opt.reset_adv || opt.set_once)
+ if (opt.reset_adv || opt.set_once || opt.menu_save)
return modify_existing_adv(opt.directory);
else
usage(EX_USAGE, 0);
.directory = NULL,
.device = NULL,
.offset = 0,
+ .menu_save = NULL,
};
const struct option long_options[] = {
{"once", 1, NULL, 'o'},
{"clear-once", 0, NULL, 'O'},
{"reset-adv", 0, NULL, OPT_RESET_ADV},
+ {"menu-save", 1, NULL, 'M'},
{0, 0, 0, 0}
};
-const char short_options[] = "id:f:UuzS:H:rvho:O";
+const char short_options[] = "id:f:UuzS:H:rvho:OM:";
void __attribute__ ((noreturn)) usage(int rv, int mode)
{
" --once=... -o Execute a command once upon boot\n"
" --clear-once -O Clear the boot-once command\n"
" --reset-adv Reset auxilliary data\n"
+ " --menu-save= -M Set the label to select as default on the next boot\n"
"\n"
" Note: geometry is determined at boot time for devices which\n"
" are considered hard disks by the BIOS. Unfortunately, this is\n"
case OPT_RESET_ADV:
opt.reset_adv = 1;
break;
+ case 'M':
+ opt.menu_save = optarg;
+ break;
case 'v':
fputs(program, stderr);
fputs(" " VERSION_STR
\fB\-o\fR, \fB\-\-once\fR=\fIcommand\fR
Execute a command once upon boot.
.TP
+\fB\-M\fR, \fB\-\-menu\-save\fR=\fIlabel\fR
+Set the label to select as default on the next boot
+.TP
\fB\-r\fR, \fB\-\-raid\fR
Fall back to the next device on boot failure.
.TP