From nobody Mon Feb 12 18:53:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TYYWs6YYYz5BMg4; Mon, 12 Feb 2024 18:53:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TYYWs45Tpz4mcL; Mon, 12 Feb 2024 18:53:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707764025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P/KwJ+QuV/k2fWc1WOaPcmsEs6V2poO8J4KQnp2Gipw=; b=v684MIP1IbQRSucoP3X/Kltao/PvOOw75V59oDM9Ucxh4RGo7Z62NZIumA4eHaIYpMykgy q61oLyTqp1Nb6jd7NZcIYPv2V0UbF/YhNMIKRKOt0xkq7iWWp8HZGYmyBEeM7+t5KSD5Sw KFpsx5b8l+5OVkHj7awiDOgkTNFgM+3G9jOcbOS1ZNKmorJOPj0+ziz6dVVNOlLqPNfZlj TD7teBzUpXuyytKgNoyi80bAu4ydKzHIqB8Bcn58hD1c1RysoNl0QFBUnlu/g4a+3q9Iyn 9H5Ek3ZJ9JFktPbtjPutNazw4ds3mzqGFRTXzai5hXLPGkOhgUi5P7WVOkiJ6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707764025; a=rsa-sha256; cv=none; b=kn7gPS10B2KyLVtiEelxvjABlyIWIUEcp3GKWwCgsSVaMi0MjLo143Cd3LjExbGBzgtwuI 3i+HYLCrTBHO8c1u7PGJjH1vjLgI0rJScgdPAKkL2UjeX/ozW0zBDC1QkfFjYbF8A6BfbG SY8u0ayilbaM3/A3YmvvhS/b9ddiKlE/VeK9U6pqgRuIVoYFiynL66b/lpd1ARRgl2rkf/ nhQcOmtgyv+nPiRQ9VUU4YJMAp7BQ4osEt1QbgU12CgB+nQJGJGyjYTlvYVv8o+GvBB1Ro kiXiCizNU7JqWspm/QhVDnrToB5qW3m4mE6R+6SP3AnWiHRGefn5+i/SFxWQ7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707764025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P/KwJ+QuV/k2fWc1WOaPcmsEs6V2poO8J4KQnp2Gipw=; b=AXwAqBWh/X3ZLLeIPH4tkNNnZsXy6uElxVRjIl3t8UyKaYf/3pLbfLA34VFl+tS/rgiOCW wMtF1U32KCizUG4RDb4vbOdBZKrGOHYBVF8P+98182JFx8A5sQSpviYDtUaDjuwdUt1VM3 1Ym6LS17KewRGyV+SSkThv7VLk6Amrrixm1cz1cwHxbPk/ni0CzL2CjheCcN+V7V9jsmEP mYSlhnr7XhDOr70I3ATI9tMr0qTcEraxRd27TzUds1GjQnI0hrt+wXQNHvYbZymg5n+f46 P+QNu4ACapbefW7QoUmY37Qq7cp8HlCgdIU1I8glwcnCqMUA7cKsfJiZBfe6Jg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TYYWs2vsKzjY0; Mon, 12 Feb 2024 18:53:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41CIrjhk030764; Mon, 12 Feb 2024 18:53:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41CIrjDZ030761; Mon, 12 Feb 2024 18:53:45 GMT (envelope-from git) Date: Mon, 12 Feb 2024 18:53:45 GMT Message-Id: <202402121853.41CIrjDZ030761@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 91d24077024f - main - reboot: Implement -o to set kernel options for next boot List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 91d24077024f5f36069e55b63d237f9034232455 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=91d24077024f5f36069e55b63d237f9034232455 commit 91d24077024f5f36069e55b63d237f9034232455 Author: Warner Losh AuthorDate: 2024-02-12 18:46:03 +0000 Commit: Warner Losh CommitDate: 2024-02-12 18:46:03 +0000 reboot: Implement -o to set kernel options for next boot Sponsored by: Netflix Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D43829 --- sbin/reboot/reboot.8 | 7 +++++++ sbin/reboot/reboot.c | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sbin/reboot/reboot.8 b/sbin/reboot/reboot.8 index a60512fa0c59..ed055327b36a 100644 --- 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 @@ -146,6 +150,9 @@ This can happen when devices have been disconnected, such as with .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 index a4be86a4983f..21acf7514388 100644 --- a/sbin/reboot/reboot.c +++ b/sbin/reboot/reboot.c @@ -180,7 +180,7 @@ main(int argc, char *argv[]) } else howto = 0; Dflag = fflag = lflag = Nflag = nflag = qflag = false; - while ((ch = getopt(argc, argv, "cDde:k:lNnpqr")) != -1) + while ((ch = getopt(argc, argv, "cDde:k:lNno:pqr")) != -1) switch(ch) { case 'c': howto |= RB_POWERCYCLE; @@ -212,6 +212,9 @@ main(int argc, char *argv[]) nflag = true; Nflag = true; break; + case 'o': + add_env(&env, "kernel_options", optarg); + break; case 'p': howto |= RB_POWEROFF; break;