xref: /freebsd/usr.sbin/efiwake/efiwake.8 (revision 02e9120893770924227138ba49df1edb3896112a)
1.\"
2.\" SPDX-License-Identifier: BSD-2-Clause
3.\"
4.\" Copyright (c) 2023 Johannes Totz
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25.\" SUCH DAMAGE.
26.\"
27.Dd May 9, 2023
28.Dt EFIWAKE 8
29.Os
30.Sh NAME
31.Nm efiwake
32.Nd manipulate the EFI wake timer
33.Sh SYNOPSIS
34.Nm
35.Nm
36.Fl d
37.Nm
38.Fl e Ar yyyy-mm-ddThh:mm:ss
39.Sh DESCRIPTION
40.Nm
41reports the current value of, disables or enables the EFI wake timer that can
42wake your machine from S3 sleep at a given time.
43.Pp
44If invoked without arguments, the current EFI time and the current value of the
45wake timer will be printed, followed by an
46.Em enabled
47status and a
48.Em pending
49status.
50EFI time is supposed to be in UTC.
51Note that it can be out of sync with kernel time.
52The pending status tells whether the wake timer fired recently; it is cleared
53upon reading.
54.Pp
55If invoked with the
56.Sy -d
57option, the wake timer is reset and disabled.
58.Pp
59If invoked with the
60.Sy -e
61option, the wake timer is set to the given time and date.
62If the date or time is invalid, an error is returned.
63.Pp
64The current EFI time is always printed.
65.Sh EXAMPLES
66Without arguments:
67.Bd -literal -offset indent
68# efiwake
69Current EFI time: 2023-05-04T15:30:45
70EFI wake time: 2023-05-04T10:00:00; enabled=0, pending=1
71.Ed
72.Pp
73Disabling and resetting the wake timer:
74.Bd -literal -offset indent
75# efiwake -d
76Current EFI time: 2023-05-04T15:32:16
77EFI wake time: 2023-05-04T15:32:16; enabled=0, pending=0
78.Ed
79.Pp
80Enabling the wake timer with a valid date:
81.Bd -literal -offset indent
82# efiwake -e 2023-05-04T15:35:00
83Current EFI time: 2023-05-04T15:34:05
84EFI wake time: 2023-05-04T15:35:00; enabled=1, pending=0
85.Ed
86.Pp
87Trying to enable with an invalid date (there is no 31st of April):
88.Bd -literal -offset indent
89# efiwake -e 2023-04-31T15:35:00
90Current EFI time: 2023-05-04T15:35:25
91efiwake: cannot enable EFI wake time: Invalid argument
92.Ed
93.Sh AUTHORS
94.An -nosplit
95The tool and manual page were written by
96.An Johannes Totz Aq Mt jo@bruelltuete.com .
97.Sh BUGS
98The quality of EFI implementations differs widely.
99Corruption of the wake-up date has been observed on real hardware.
100