diff --git a/sbin/reboot/reboot.8 b/sbin/reboot/reboot.8 --- a/sbin/reboot/reboot.8 +++ b/sbin/reboot/reboot.8 @@ -39,18 +39,22 @@ .Op Fl DflNnpq .Op Fl e Ar variable=value .Op Fl k Ar kernel +.Op Fl o Ar options .Nm .Op Fl cDdflNnpqr .Op Fl e Ar variable=value .Op Fl k Ar kernel +.Op Fl o Ar options .Nm fasthalt .Op Fl DflNnpq .Op Fl e Ar variable=value .Op Fl k Ar kernel +.Op Fl o Ar options .Nm fastboot .Op Fl dDflNnpq .Op Fl e Ar variable=value .Op Fl k Ar kernel +.Op Fl o Ar options .Sh DESCRIPTION The .Nm halt @@ -131,6 +135,9 @@ .It Fl n The file system cache is not flushed. This option should probably not be used. +.It Fl o Ar options +This option +allows the passing of kernel flags for the next boot. .It Fl p The system will turn off the power if it can. If the power down action fails, the system diff --git a/sbin/reboot/reboot.c b/sbin/reboot/reboot.c --- a/sbin/reboot/reboot.c +++ b/sbin/reboot/reboot.c @@ -191,7 +191,7 @@ } else howto = 0; Dflag = fflag = lflag = Nflag = nflag = qflag = false; - while ((ch = getopt(argc, argv, "cDdek:lNnpqr")) != -1) + while ((ch = getopt(argc, argv, "cDdek:lNnopqr")) != -1) switch(ch) { case 'c': howto |= RB_POWERCYCLE; @@ -230,6 +230,15 @@ nflag = true; Nflag = true; break; + case 'o': + oldenv = env; + v = quoted(kernel); + asprintf(&env, "%s%s=%s\n", oldenv ? oldenv : "", "kernel_options", v); + if (env == NULL) + errx(1, "No memory to build env array"); + free(v); + free(oldenv); + break; case 'p': howto |= RB_POWEROFF; break;