[systemd-commits] 3 commits - Makefile-man.am man/systemd-backlight at .service.xml man/systemd-efi-boot-generator.xml rules/99-systemd.rules.in src/backlight units/systemd-backlight at .service.in
Lennart Poettering
lennart at kemper.freedesktop.org
Tue Aug 13 12:57:03 PDT 2013
Makefile-man.am | 12 ++++
man/systemd-backlight at .service.xml | 73 ++++++++++++++++++++++++++++++
man/systemd-efi-boot-generator.xml | 87 ++++++++++++++++++++++++++++++++++++
rules/99-systemd.rules.in | 2
src/backlight/backlight.c | 10 +++-
units/systemd-backlight at .service.in | 6 +-
6 files changed, 184 insertions(+), 6 deletions(-)
New commits:
commit 22d0d443b6fbdd319e4c6e0124e6acec086db3fa
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Aug 14 03:31:06 2013 +0200
man: document systemd-efi-boot-generator
diff --git a/Makefile-man.am b/Makefile-man.am
index 4ebc768..235b5a1 100644
--- a/Makefile-man.am
+++ b/Makefile-man.am
@@ -52,6 +52,7 @@ MANPAGES += \
man/systemd-cgtop.1 \
man/systemd-delta.1 \
man/systemd-detect-virt.1 \
+ man/systemd-efi-boot-generator.8 \
man/systemd-fsck at .service.8 \
man/systemd-fstab-generator.8 \
man/systemd-getty-generator.8 \
diff --git a/man/systemd-efi-boot-generator.xml b/man/systemd-efi-boot-generator.xml
new file mode 100644
index 0000000..d5e5aef
--- /dev/null
+++ b/man/systemd-efi-boot-generator.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0"?>
+<!--*-nxml-*-->
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+<!--
+ This file is part of systemd.
+
+ Copyright 2013 Lennart Poettering
+
+ systemd is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ systemd is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
+-->
+<refentry id="systemd-efi-boot-generator">
+
+ <refentryinfo>
+ <title>systemd-efi-boot-generator</title>
+ <productname>systemd</productname>
+
+ <authorgroup>
+ <author>
+ <contrib>Developer</contrib>
+ <firstname>Lennart</firstname>
+ <surname>Poettering</surname>
+ <email>lennart at poettering.net</email>
+ </author>
+ </authorgroup>
+ </refentryinfo>
+
+ <refmeta>
+ <refentrytitle>systemd-efi-boot-generator</refentrytitle>
+ <manvolnum>8</manvolnum>
+ </refmeta>
+
+ <refnamediv>
+ <refname>systemd-efi-boot-generator</refname>
+ <refpurpose>Generator for automatically mounting the
+ EFI System Partition used by the current boot to
+ <filename>/boot</filename></refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <para><filename>/usr/lib/systemd/system-generators/systemd-efi-boot-generator</filename></para>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+
+ <para><filename>systemd-efi-boot-generator</filename>
+ is a generator that automatically creates mount and
+ automount units for the EFI System Partition (ESP)
+ mounting it to <filename>/boot</filename>. Note that
+ this generator will execute no operation on non-EFI
+ systems, on systems where the boot loader does not
+ communicate the used ESP to the OS, on systems where
+ <filename>/boot</filename> is an explicitly configured
+ mount (for example, listed in <citerefentry><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>) or where the <filename>/boot</filename> mount
+ point is non-empty. Since this generator creates an
+ automount unit the mount will only be activated
+ on-demand, when accessed.</para>
+
+ <para><filename>systemd-efi-boot-generator</filename>
+ implements the <ulink
+ url="http://www.freedesktop.org/wiki/Software/systemd/Generators">generator
+ specification</ulink>.</para>
+ </refsect1>
+
+ <refsect1>
+ <title>See Also</title>
+ <para>
+ <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>systemd.automount</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>gummiboot</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>
+ </para>
+ </refsect1>
+
+</refentry>
commit 38e19f93501d5a23d2176be30eea82e1be999f3d
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Aug 14 03:11:30 2013 +0200
man: add man page for systemd-backlight at .service
diff --git a/Makefile-man.am b/Makefile-man.am
index a8d418f..4ebc768 100644
--- a/Makefile-man.am
+++ b/Makefile-man.am
@@ -601,6 +601,17 @@ man/systemd-user.conf.html: man/systemd-system.conf.html
$(html-alias)
+if ENABLE_BACKLIGHT
+MANPAGES += \
+ man/systemd-backlight at .service.8
+MANPAGES_ALIAS += \
+ man/systemd-backlight.8
+man/systemd-backlight.8: man/systemd-backlight at .service.8
+man/systemd-backlight.html: man/systemd-backlight at .service.html
+ $(html-alias)
+
+endif
+
if ENABLE_BINFMT
MANPAGES += \
man/binfmt.d.5 \
diff --git a/man/systemd-backlight at .service.xml b/man/systemd-backlight at .service.xml
new file mode 100644
index 0000000..f2f5472
--- /dev/null
+++ b/man/systemd-backlight at .service.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0"?>
+<!--*-nxml-*-->
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+<!--
+ This file is part of systemd.
+
+ Copyright 2013 Lennart Poettering
+
+ systemd is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ systemd is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
+-->
+<refentry id="systemd-backlight at .service" conditional='ENABLE_BACKLIGHT'>
+
+ <refentryinfo>
+ <title>systemd-backlight at .service</title>
+ <productname>systemd</productname>
+
+ <authorgroup>
+ <author>
+ <contrib>Developer</contrib>
+ <firstname>Lennart</firstname>
+ <surname>Poettering</surname>
+ <email>lennart at poettering.net</email>
+ </author>
+ </authorgroup>
+ </refentryinfo>
+
+ <refmeta>
+ <refentrytitle>systemd-backlight at .service</refentrytitle>
+ <manvolnum>8</manvolnum>
+ </refmeta>
+
+ <refnamediv>
+ <refname>systemd-backlight at .service</refname>
+ <refname>systemd-backlight</refname>
+ <refpurpose>Load and save the display backlight brightness at boot and shutdown</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <para><filename>systemd-backlight at .service</filename></para>
+ <para><filename>/usr/lib/systemd/systemd-backlight</filename></para>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+
+ <para><filename>systemd-backlight at .service</filename>
+ is a service that restores the display backlight
+ brightness at early-boot and saves it at shutdown. On
+ disk the backlight brightness is stored in
+ <filename>/var/lib/backlight/</filename>. Note that by
+ default only firmware backlight devices are
+ saved/restored.</para>
+ </refsect1>
+
+ <refsect1>
+ <title>See Also</title>
+ <para>
+ <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+ </para>
+ </refsect1>
+
+</refentry>
commit 875c6e1b48f37a07dfbb80d6653c73f205e94260
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Aug 14 02:55:57 2013 +0200
backlight: instead of syspath use sysname for identifying backlight devices
This makes the description string of the backlight service a bit nicer.
diff --git a/rules/99-systemd.rules.in b/rules/99-systemd.rules.in
index ac4bc86..bbb7d0c 100644
--- a/rules/99-systemd.rules.in
+++ b/rules/99-systemd.rules.in
@@ -53,7 +53,7 @@ ACTION=="add", SUBSYSTEM=="net", KERNEL!="lo", RUN+="@rootlibexecdir@/systemd-sy
# Pull in backlight save/restore for all firmware backlight devices
-ACTION=="add", SUBSYSTEM=="backlight", ATTR{type}=="firmware", TAG+="systemd", ENV{SYSTEMD_WANTS}+="systemd-backlight at sys%p.service"
+ACTION=="add", SUBSYSTEM=="backlight", ATTR{type}=="firmware", TAG+="systemd", ENV{SYSTEMD_WANTS}+="systemd-backlight@$name.service"
# Asynchronously mount file systems implemented by these modules as
# soon as they are loaded.
diff --git a/src/backlight/backlight.c b/src/backlight/backlight.c
index 3378907..1ef0b45 100644
--- a/src/backlight/backlight.c
+++ b/src/backlight/backlight.c
@@ -54,9 +54,15 @@ int main(int argc, char *argv[]) {
goto finish;
}
- device = udev_device_new_from_syspath(udev, argv[2]);
+ errno = 0;
+ device = udev_device_new_from_subsystem_sysname(udev, "backlight", argv[2]);
if (!device) {
- r = log_oom();
+ if (errno != 0) {
+ log_error("Failed to get backlight device: %m");
+ r = -errno;
+ } else
+ r = log_oom();
+
goto finish;
}
diff --git a/units/systemd-backlight at .service.in b/units/systemd-backlight at .service.in
index 14b1219..b0e75db 100644
--- a/units/systemd-backlight at .service.in
+++ b/units/systemd-backlight at .service.in
@@ -6,7 +6,7 @@
# (at your option) any later version.
[Unit]
-Description=Load/Save Screen Backlight Brightness of %f
+Description=Load/Save Screen Backlight Brightness of %I
Documentation=man:systemd-backlight at .service(8)
DefaultDependencies=no
RequiresMountsFor=/var/lib/backlight
@@ -17,5 +17,5 @@ Before=sysinit.target shutdown.target
[Service]
Type=oneshot
RemainAfterExit=yes
-ExecStart=@rootlibexecdir@/systemd-backlight load %f
-ExecStop=@rootlibexecdir@/systemd-backlight save %f
+ExecStart=@rootlibexecdir@/systemd-backlight load %I
+ExecStop=@rootlibexecdir@/systemd-backlight save %I
More information about the systemd-commits
mailing list