hib-res-generator: add "noresume"
This is an override parameter, to totally skip dehiberanation.
This commit is contained in:
parent
a79858bfd1
commit
e83419d043
5
TODO
5
TODO
|
@ -86,11 +86,10 @@ Features:
|
||||||
|
|
||||||
1. add resume_offset support to the resume code (i.e. support swap files
|
1. add resume_offset support to the resume code (i.e. support swap files
|
||||||
properly)
|
properly)
|
||||||
2. check of swap is on weird storage and refuse if so
|
2. check if swap is on weird storage and refuse if so
|
||||||
3. add env-var based option to disable hibernation
|
3. add env-var based option to disable hibernation
|
||||||
4. figure out what to do with swap-on-luks
|
4. figure out what to do with swap-on-luks
|
||||||
5. add autodetection of hibernation images, and add "noresume" to disable
|
5. add autodetection of hibernation images
|
||||||
this
|
|
||||||
|
|
||||||
* portables: introduce a new unit file directory /etc/systemd/system.attached/
|
* portables: introduce a new unit file directory /etc/systemd/system.attached/
|
||||||
or so, where we attach portable services to
|
or so, where we attach portable services to
|
||||||
|
|
|
@ -28,11 +28,13 @@
|
||||||
<refsect1>
|
<refsect1>
|
||||||
<title>Description</title>
|
<title>Description</title>
|
||||||
|
|
||||||
<para><filename>systemd-hibernate-resume-generator</filename> is a
|
<para><command>systemd-hibernate-resume-generator</command> is a
|
||||||
generator that instantiates
|
generator that initiates the procedure to resume the system from hibernation.
|
||||||
|
It instantiates the
|
||||||
<citerefentry><refentrytitle>systemd-hibernate-resume@.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
|
<citerefentry><refentrytitle>systemd-hibernate-resume@.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
|
||||||
unit according to the value of <option>resume=</option> parameter
|
unit according to the value of <option>resume=</option> parameter
|
||||||
specified on the kernel command line.</para>
|
specified on the kernel command line, which will instruct the kernel
|
||||||
|
to resume the system from the hibernation image on that device.</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
|
@ -54,6 +56,12 @@
|
||||||
supported.</para></listitem>
|
supported.</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>noresume</varname></term>
|
||||||
|
|
||||||
|
<listitem><para>Do not try to resume from hibernation. If this parameter is
|
||||||
|
present, <varname>resume=</varname> is ignored.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
static const char *arg_dest = "/tmp";
|
static const char *arg_dest = "/tmp";
|
||||||
static char *arg_resume_device = NULL;
|
static char *arg_resume_device = NULL;
|
||||||
|
static bool arg_noresume = false;
|
||||||
|
|
||||||
static int parse_proc_cmdline_item(const char *key, const char *value, void *data) {
|
static int parse_proc_cmdline_item(const char *key, const char *value, void *data) {
|
||||||
|
|
||||||
|
@ -28,8 +29,15 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
|
||||||
if (!s)
|
if (!s)
|
||||||
return log_oom();
|
return log_oom();
|
||||||
|
|
||||||
free(arg_resume_device);
|
free_and_replace(arg_resume_device, s);
|
||||||
arg_resume_device = s;
|
|
||||||
|
} else if (streq(key, "noresume")) {
|
||||||
|
if (value) {
|
||||||
|
log_warning("\"noresume\" kernel command line switch specified with an argument, ignoring.");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
arg_noresume = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -85,6 +93,11 @@ int main(int argc, char *argv[]) {
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
log_warning_errno(r, "Failed to parse kernel command line, ignoring: %m");
|
log_warning_errno(r, "Failed to parse kernel command line, ignoring: %m");
|
||||||
|
|
||||||
|
if (arg_noresume) {
|
||||||
|
log_notice("Found \"noresume\" on the kernel command line, quitting.");
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
r = process_resume();
|
r = process_resume();
|
||||||
free(arg_resume_device);
|
free(arg_resume_device);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue