Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: systemd@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH systemd.eclass] Introduce systemd_is_booted().
Date: Wed, 24 Jul 2013 07:18:21
Message-Id: 1374650293-21212-1-git-send-email-mgorny@gentoo.org
1 Pacho requested that to be able to warn users in GNOME packages that do
2 not work anymore without systemd.
3 ---
4 gx86/eclass/systemd.eclass | 17 +++++++++++++++++
5 1 file changed, 17 insertions(+)
6
7 diff --git a/gx86/eclass/systemd.eclass b/gx86/eclass/systemd.eclass
8 index 166c7be..a2750d7 100644
9 --- a/gx86/eclass/systemd.eclass
10 +++ b/gx86/eclass/systemd.eclass
11 @@ -252,3 +252,20 @@ systemd_update_catalog() {
12 debug-print "${FUNCNAME}: journalctl not found."
13 fi
14 }
15 +
16 +# @FUNCTION: systemd_is_booted
17 +# @DESCRIPTION:
18 +# Check whether the system was booted using systemd.
19 +#
20 +# Returns 0 if systemd is used to boot the system, 1 otherwise.
21 +#
22 +# See: man sd_booted
23 +systemd_update_catalog() {
24 + debug-print-function ${FUNCNAME} "${@}"
25 +
26 + [[ -d /run/systemd/system ]]
27 + local ret=${?}
28 +
29 + debug-print "${FUNCNAME}: [[ -d /run/systemd/system ]] -> ${ret}"
30 + return ${ret}
31 +}
32 --
33 1.8.3.2

Replies