From nobody Tue May 9 14:33:39 2023 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 4QG0yX0Ng9z4BGD7; Tue, 9 May 2023 14:33:40 +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 4QG0yW71lFz3jcD; Tue, 9 May 2023 14:33:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683642820; 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=qhNzNLL7fOIZ4DFXe6fhjx0o8bpC8uydtHaHZohV1jY=; b=P4q3XGcUnKTyBSfvnx44xXNuWurXBSoxknwKCvw78Z1oovY4gNBCPdGYGWp8HDGuQBZ7Sv zPX3Rgpwi3VAK0t0jXrPB5z8kS0pgzrs0Mvp0oPXZpGZoZBNSRhxyztpB/oebsjfrrnovo CAERP7BP3X9JSCXmbRulW36u/5Fmbus7zMOlpDu6Wd8/E1q101tbkCfB5XuV8nJfHBM9oo NypsbC0+x9632qfCKsK5Eq+e9EcHzzNG+b/aGZqYSgqx83cr2OcyNzBtvwrqxh/M/25kdy nbhde3rWFohcXZ215bE99EghOeCQo5OZvR8bCL92vbpvbNkmN6unnz/7DrtiGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683642820; 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=qhNzNLL7fOIZ4DFXe6fhjx0o8bpC8uydtHaHZohV1jY=; b=N6F454DN0w68GpvY2LdsVQXI7SaS5jGQE48Ot8RCbbb8TLE/cswrIghFWmHbh8sV7HYw5k +N6dat6XlZZ90/ynSne5WYFtkIXFo4og4IJmCr0OBwOJ3Z819+e+GozROafHdxP2k0w+AY jZmeM3iTLy9JgRqF7bUgOLUVi3HyR+tXqrRavyM4hR19ziVOZB94b49uYUoRaXPNitshaJ NPAAFOzI+IaDk/li9aXM1hWABrLlCjazCByjkRPeyNTgy0XBjRlGOraACKv+hRGgb7eFiJ rnXnLXHYItMDOqWXoeUReckeqz+Nz/TZdETMjHeXjTLlaSD2de0varksosDJBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683642820; a=rsa-sha256; cv=none; b=rDP/2uWcPKkOEP457P0rslmNyFNfGsOgcEO9V6eg8ltNdGChTlsdEv7uYJMVejiRYeS8la UjuJc3ZuYEdDewOxe6qMB+UO6C7ughSqpZAvNoQIVIXUb5mlBk1bmqwNMgijjJyYTaPfQx DZ42soh1wK8MaZhh25AyvBPeokZHN5fFiMWphOrqqOCh7IjmVXbHGuXyrDEZPgVcGY0xf0 KQjAUhBQuoeP09JbXRcrzbe4+epMm51TsqdnNvTh9ML4W1o5VsKyasb3fsT+5tSebsnmuh iz1Z2eUKT/Rqv29sS4xwGq5H/x9W6q0Uqc8ASs0/ytbOkWrDyKpB+UGEVlDoQQ== 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 4QG0yW66jDzXDd; Tue, 9 May 2023 14:33:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 349EXdK3032465; Tue, 9 May 2023 14:33:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 349EXdwi032464; Tue, 9 May 2023 14:33:39 GMT (envelope-from git) Date: Tue, 9 May 2023 14:33:39 GMT Message-Id: <202305091433.349EXdwi032464@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: de9bed030f47 - main - efiwake(8): add man page 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: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: de9bed030f4726a1bed062fcc5453ff4c74f0047 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=de9bed030f4726a1bed062fcc5453ff4c74f0047 commit de9bed030f4726a1bed062fcc5453ff4c74f0047 Author: Johannes Totz AuthorDate: 2023-05-09 13:42:19 +0000 Commit: Konstantin Belousov CommitDate: 2023-05-09 14:33:18 +0000 efiwake(8): add man page Reviewed by: christos, grahamperrin, kib Differential revision: https://reviews.freebsd.org/D39961 --- usr.sbin/efiwake/Makefile | 2 +- usr.sbin/efiwake/efiwake.8 | 99 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+), 1 deletion(-) diff --git a/usr.sbin/efiwake/Makefile b/usr.sbin/efiwake/Makefile index ed2292f8a3ac..ff7c8c0f57e4 100644 --- a/usr.sbin/efiwake/Makefile +++ b/usr.sbin/efiwake/Makefile @@ -3,7 +3,7 @@ PACKAGE= efi-tools PROG= efiwake -MAN= +MAN= efiwake.8 SRCS= efiwake.c diff --git a/usr.sbin/efiwake/efiwake.8 b/usr.sbin/efiwake/efiwake.8 new file mode 100644 index 000000000000..10ebc68a9d33 --- /dev/null +++ b/usr.sbin/efiwake/efiwake.8 @@ -0,0 +1,99 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2023 Johannes Totz +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd May 9, 2023 +.Dt EFIWAKE 8 +.Os +.Sh NAME +.Nm efiwake +.Nd manipulate the EFI wake timer +.Sh SYNOPSIS +.Nm +.Nm +.Fl d +.Nm +.Fl e Ar yyyy-mm-ddThh:mm:ss +.Sh DESCRIPTION +.Nm +reports the current value of, disables or enables the EFI wake timer that can +wake your machine from S3 sleep at a given time. +.Pp +If invoked without arguments, the current EFI time and the current value of the +wake timer will be printed, followed by an +.Em enabled +status and a +.Em pending +status. +EFI time is supposed to be in UTC. +Note that it can be out of sync with kernel time. +The pending status tells whether the wake timer fired recently; it is cleared +upon reading. +.Pp +If invoked with the +.Sy -d +option, the wake timer is reset and disabled. +.Pp +If invoked with the +.Sy -e +option, the wake timer is set to the given time and date. +If the date or time is invalid, an error is returned. +.Pp +The current EFI time is always printed. +.Sh EXAMPLES +Without arguments: +.Bd -literal -offset indent +# efiwake +Current EFI time: 2023-05-04T15:30:45 +EFI wake time: 2023-05-04T10:00:00; enabled=0, pending=1 +.Ed +.Pp +Disabling and resetting the wake timer: +.Bd -literal -offset indent +# efiwake -d +Current EFI time: 2023-05-04T15:32:16 +EFI wake time: 2023-05-04T15:32:16; enabled=0, pending=0 +.Ed +.Pp +Enabling the wake timer with a valid date: +.Bd -literal -offset indent +# efiwake -e 2023-05-04T15:35:00 +Current EFI time: 2023-05-04T15:34:05 +EFI wake time: 2023-05-04T15:35:00; enabled=1, pending=0 +.Ed +.Pp +Trying to enable with an invalid date (there is no 31st of April): +.Bd -literal -offset indent +# efiwake -e 2023-04-31T15:35:00 +Current EFI time: 2023-05-04T15:35:25 +efiwake: cannot enable EFI wake time: Invalid argument +.Ed +.Sh AUTHORS +.An -nosplit +The tool and manual page were written by +.An Johannes Totz Aq Mt jo@bruelltuete.com . +.Sh BUGS +The quality of EFI implementations differs widely. +Corruption of the wake-up date has been observed on real hardware.