diff options
Diffstat (limited to 'meta/recipes-core/systemd')
27 files changed, 1950 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd-compat-units.bb b/meta/recipes-core/systemd/systemd-compat-units.bb new file mode 100644 index 0000000000..6419bc2c65 --- /dev/null +++ b/meta/recipes-core/systemd/systemd-compat-units.bb | |||
@@ -0,0 +1,41 @@ | |||
1 | SUMMARY = "Enhances systemd compatilibity with existing SysVinit scripts" | ||
2 | |||
3 | LICENSE = "MIT" | ||
4 | LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690" | ||
5 | |||
6 | PR = "r29" | ||
7 | |||
8 | DEPENDS = "systemd-systemctl-native" | ||
9 | |||
10 | inherit allarch | ||
11 | |||
12 | ALLOW_EMPTY_${PN} = "1" | ||
13 | |||
14 | SYSTEMD_DISABLED_SYSV_SERVICES = " \ | ||
15 | busybox-udhcpc \ | ||
16 | hwclock \ | ||
17 | networking \ | ||
18 | nfsserver \ | ||
19 | nfscommon \ | ||
20 | syslog.busybox \ | ||
21 | " | ||
22 | |||
23 | pkg_postinst_${PN} () { | ||
24 | cd $D${sysconfdir}/init.d | ||
25 | |||
26 | echo "Disabling the following sysv scripts: " | ||
27 | |||
28 | OPTS="" | ||
29 | |||
30 | if [ -n "$D" ]; then | ||
31 | OPTS="--root=$D" | ||
32 | fi | ||
33 | |||
34 | for i in ${SYSTEMD_DISABLED_SYSV_SERVICES} ; do | ||
35 | if [ \( -e $i -o $i.sh \) -a ! \( -e $D${sysconfdir}/systemd/system/$i.service -o -e $D${systemd_unitdir}/system/$i.service \) ] ; then | ||
36 | echo -n "$i: " ; systemctl ${OPTS} mask $i.service | ||
37 | fi | ||
38 | done ; echo | ||
39 | } | ||
40 | |||
41 | RDPEPENDS_${PN} = "systemd" | ||
diff --git a/meta/recipes-core/systemd/systemd-serialgetty.bb b/meta/recipes-core/systemd/systemd-serialgetty.bb new file mode 100644 index 0000000000..1c34d5c747 --- /dev/null +++ b/meta/recipes-core/systemd/systemd-serialgetty.bb | |||
@@ -0,0 +1,49 @@ | |||
1 | SUMMARY = "Serial terminal support for systemd" | ||
2 | LICENSE = "GPLv2+" | ||
3 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" | ||
4 | |||
5 | PR = "r5" | ||
6 | |||
7 | SERIAL_CONSOLE ?= "115200 ttyS0" | ||
8 | |||
9 | SRC_URI = "file://serial-getty@.service" | ||
10 | |||
11 | do_install() { | ||
12 | if [ ! -z "${SERIAL_CONSOLES}" ] ; then | ||
13 | default_baudrate=`echo "${SERIAL_CONSOLES}" | sed 's/\;.*//'` | ||
14 | install -d ${D}${systemd_unitdir}/system/ | ||
15 | install -d ${D}${sysconfdir}/systemd/system/getty.target.wants/ | ||
16 | install -m 0644 ${WORKDIR}/serial-getty@.service ${D}${systemd_unitdir}/system/ | ||
17 | sed -i -e s/\@BAUDRATE\@/$default_baudrate/g ${D}${systemd_unitdir}/system/serial-getty@.service | ||
18 | |||
19 | tmp="${SERIAL_CONSOLES}" | ||
20 | for entry in $tmp ; do | ||
21 | baudrate=`echo $entry | sed 's/\;.*//'` | ||
22 | ttydev=`echo $entry | sed -e 's/^[0-9]*\;//' -e 's/\;.*//'` | ||
23 | if [ "$baudrate" = "$default_baudrate" ] ; then | ||
24 | # enable the service | ||
25 | ln -sf ${systemd_unitdir}/system/serial-getty@.service \ | ||
26 | ${D}${sysconfdir}/systemd/system/getty.target.wants/serial-getty@$ttydev.service | ||
27 | else | ||
28 | # install custom service file for the non-default baudrate | ||
29 | install -m 0644 ${WORKDIR}/serial-getty@.service ${D}${systemd_unitdir}/system/serial-getty$baudrate@.service | ||
30 | sed -i -e s/\@BAUDRATE\@/$baudrate/g ${D}${systemd_unitdir}/system/serial-getty$baudrate@.service | ||
31 | # enable the service | ||
32 | ln -sf ${systemd_unitdir}/system/serial-getty$baudrate@.service \ | ||
33 | ${D}${sysconfdir}/systemd/system/getty.target.wants/serial-getty$baudrate@$ttydev.service | ||
34 | fi | ||
35 | done | ||
36 | fi | ||
37 | } | ||
38 | |||
39 | RDEPENDS_${PN} = "systemd" | ||
40 | |||
41 | # This is a machine specific file | ||
42 | FILES_${PN} = "${systemd_unitdir}/system/*.service ${sysconfdir}" | ||
43 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
44 | |||
45 | # As this package is tied to systemd, only build it when we're also building systemd. | ||
46 | python () { | ||
47 | if not bb.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d): | ||
48 | raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES") | ||
49 | } | ||
diff --git a/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service b/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service new file mode 100644 index 0000000000..6dd335c0bc --- /dev/null +++ b/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service | |||
@@ -0,0 +1,37 @@ | |||
1 | # This file is part of systemd. | ||
2 | # | ||
3 | # systemd is free software; you can redistribute it and/or modify it | ||
4 | # under the terms of the GNU Lesser General Public License as published by | ||
5 | # the Free Software Foundation; either version 2.1 of the License, or | ||
6 | # (at your option) any later version. | ||
7 | |||
8 | [Unit] | ||
9 | Description=Serial Getty on %I | ||
10 | Documentation=man:agetty(8) man:systemd-getty-generator(8) | ||
11 | Documentation=http://0pointer.de/blog/projects/serial-console.html | ||
12 | BindsTo=dev-%i.device | ||
13 | After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service | ||
14 | After=rc-local.service | ||
15 | |||
16 | # If additional gettys are spawned during boot then we should make | ||
17 | # sure that this is synchronized before getty.target, even though | ||
18 | # getty.target didn't actually pull it in. | ||
19 | Before=getty.target | ||
20 | IgnoreOnIsolate=yes | ||
21 | |||
22 | [Service] | ||
23 | Environment="TERM=xterm" | ||
24 | ExecStart=-/sbin/agetty -8 --keep-baud %I @BAUDRATE@ $TERM | ||
25 | Type=idle | ||
26 | Restart=always | ||
27 | RestartSec=0 | ||
28 | UtmpIdentifier=%I | ||
29 | TTYPath=/dev/%I | ||
30 | TTYReset=yes | ||
31 | TTYVHangup=yes | ||
32 | KillMode=process | ||
33 | IgnoreSIGPIPE=no | ||
34 | SendSIGHUP=yes | ||
35 | |||
36 | [Install] | ||
37 | WantedBy=getty.target | ||
diff --git a/meta/recipes-core/systemd/systemd-systemctl-native.bb b/meta/recipes-core/systemd/systemd-systemctl-native.bb new file mode 100644 index 0000000000..72bc77df4f --- /dev/null +++ b/meta/recipes-core/systemd/systemd-systemctl-native.bb | |||
@@ -0,0 +1,15 @@ | |||
1 | SUMMARY = "Wrapper for enabling systemd services" | ||
2 | |||
3 | LICENSE = "MIT" | ||
4 | LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690" | ||
5 | |||
6 | PR = "r6" | ||
7 | |||
8 | inherit native | ||
9 | |||
10 | SRC_URI = "file://systemctl" | ||
11 | |||
12 | do_install() { | ||
13 | install -d ${D}${bindir} | ||
14 | install -m 0755 ${WORKDIR}/systemctl ${D}${bindir} | ||
15 | } | ||
diff --git a/meta/recipes-core/systemd/systemd-systemctl/systemctl b/meta/recipes-core/systemd/systemd-systemctl/systemctl new file mode 100755 index 0000000000..b37f27abfb --- /dev/null +++ b/meta/recipes-core/systemd/systemd-systemctl/systemctl | |||
@@ -0,0 +1,153 @@ | |||
1 | #!/bin/sh | ||
2 | echo "Started $0 $*" | ||
3 | |||
4 | ROOT= | ||
5 | |||
6 | # parse command line params | ||
7 | action= | ||
8 | while [ $# != 0 ]; do | ||
9 | opt="$1" | ||
10 | |||
11 | case "$opt" in | ||
12 | enable) | ||
13 | shift | ||
14 | |||
15 | action="$opt" | ||
16 | services="$1" | ||
17 | cmd_args="1" | ||
18 | shift | ||
19 | ;; | ||
20 | disable) | ||
21 | shift | ||
22 | |||
23 | action="$opt" | ||
24 | services="$1" | ||
25 | cmd_args="1" | ||
26 | shift | ||
27 | ;; | ||
28 | mask) | ||
29 | shift | ||
30 | |||
31 | action="$opt" | ||
32 | services="$1" | ||
33 | cmd_args="1" | ||
34 | shift | ||
35 | ;; | ||
36 | preset) | ||
37 | shift | ||
38 | |||
39 | action="$opt" | ||
40 | services="$1" | ||
41 | cmd_args="1" | ||
42 | shift | ||
43 | ;; | ||
44 | --root=*) | ||
45 | ROOT=${opt##--root=} | ||
46 | cmd_args="0" | ||
47 | shift | ||
48 | ;; | ||
49 | *) | ||
50 | if [ "$cmd_args" = "1" ]; then | ||
51 | services="$services $opt" | ||
52 | shift | ||
53 | else | ||
54 | echo "'$opt' is an unkown option; exiting with error" | ||
55 | exit 1 | ||
56 | fi | ||
57 | ;; | ||
58 | esac | ||
59 | done | ||
60 | if [ "$action" = "preset" -a "$service_file" = "" ]; then | ||
61 | services=$(for f in `find $ROOT/etc/systemd/system $ROOT/lib/systemd/system $ROOT/usr/lib/systemd/system -type f 2>1`; do basename $f; done) | ||
62 | services="$services $opt" | ||
63 | presetall=1 | ||
64 | fi | ||
65 | |||
66 | for service in $services; do | ||
67 | if [ "$presetall" = "1" ]; then | ||
68 | action="preset" | ||
69 | fi | ||
70 | if [ "$action" = "mask" ]; then | ||
71 | if [ ! -d $ROOT/etc/systemd/system/ ]; then | ||
72 | mkdir -p $ROOT/etc/systemd/system/ | ||
73 | fi | ||
74 | cmd="ln -s /dev/null $ROOT/etc/systemd/system/$service" | ||
75 | echo "$cmd" | ||
76 | $cmd | ||
77 | exit 0 | ||
78 | fi | ||
79 | |||
80 | echo "Try to find location of $service..." | ||
81 | # find service file | ||
82 | for p in $ROOT/etc/systemd/system \ | ||
83 | $ROOT/lib/systemd/system \ | ||
84 | $ROOT/usr/lib/systemd/system; do | ||
85 | if [ -e $p/$service ]; then | ||
86 | service_file=$p/$service | ||
87 | service_file=${service_file##$ROOT} | ||
88 | fi | ||
89 | done | ||
90 | if [ -z "$service_file" ]; then | ||
91 | echo "'$service' couldn't be found; exiting with error" | ||
92 | exit 1 | ||
93 | fi | ||
94 | echo "Found $service in $service_file" | ||
95 | |||
96 | # If any new unit types are added to systemd they should be added | ||
97 | # to this regular expression. | ||
98 | unit_types_re='\.\(service\|socket\|device\|mount\|automount\|swap\|target\|path\|timer\|snapshot\)$' | ||
99 | if [ "$action" = "preset" ]; then | ||
100 | action=`egrep -sh $service $ROOT/etc/systemd/user-preset/*.preset | cut -f1 -d' '` | ||
101 | if [ -z "$action" ]; then | ||
102 | globalpreset=`egrep -sh '\*' $ROOT/etc/systemd/user-preset/*.preset | cut -f1 -d' '` | ||
103 | if [ -n "$globalpreset" ]; then | ||
104 | action="$globalpreset" | ||
105 | else | ||
106 | action="enable" | ||
107 | fi | ||
108 | fi | ||
109 | fi | ||
110 | # create the required symbolic links | ||
111 | wanted_by=$(sed '/^WantedBy[[:space:]]*=/s,[^=]*=,,p;d' "$ROOT/$service_file" \ | ||
112 | | tr ',' '\n' \ | ||
113 | | grep "$unit_types_re") | ||
114 | |||
115 | for r in $wanted_by; do | ||
116 | echo "WantedBy=$r found in $service" | ||
117 | if [ "$action" = "enable" ]; then | ||
118 | mkdir -p $ROOT/etc/systemd/system/$r.wants | ||
119 | ln -s $service_file $ROOT/etc/systemd/system/$r.wants | ||
120 | echo "Enabled $service for $wanted_by." | ||
121 | else | ||
122 | rm -f $ROOT/etc/systemd/system/$r.wants/$service | ||
123 | rmdir --ignore-fail-on-non-empty -p $ROOT/etc/systemd/system/$r.wants | ||
124 | echo "Disabled $service for $wanted_by." | ||
125 | fi | ||
126 | done | ||
127 | |||
128 | # create the required symbolic 'Alias' links | ||
129 | alias=$(sed '/^Alias[[:space:]]*=/s,[^=]*=,,p;d' "$ROOT/$service_file" \ | ||
130 | | tr ',' '\n' \ | ||
131 | | grep "$unit_types_re") | ||
132 | |||
133 | for r in $alias; do | ||
134 | if [ "$action" = "enable" ]; then | ||
135 | mkdir -p $ROOT/etc/systemd/system | ||
136 | ln -s $service_file $ROOT/etc/systemd/system/$r | ||
137 | echo "Enabled $service for $alias." | ||
138 | else | ||
139 | rm -f $ROOT/etc/systemd/system/$r | ||
140 | echo "Disabled $service for $alias." | ||
141 | fi | ||
142 | done | ||
143 | |||
144 | # call us for the other required scripts | ||
145 | also=$(sed '/^Also[[:space:]]*=/s,[^=]*=,,p;d' "$ROOT/$service_file" \ | ||
146 | | tr ',' '\n') | ||
147 | for a in $also; do | ||
148 | echo "Also=$a found in $service" | ||
149 | if [ "$action" = "enable" ]; then | ||
150 | $0 --root=$ROOT enable $a | ||
151 | fi | ||
152 | done | ||
153 | done | ||
diff --git a/meta/recipes-core/systemd/systemd/00-create-volatile.conf b/meta/recipes-core/systemd/systemd/00-create-volatile.conf new file mode 100644 index 0000000000..9ffa88e464 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/00-create-volatile.conf | |||
@@ -0,0 +1,7 @@ | |||
1 | #This goes hand-in-hand with the base-files of OE-Core. The file must | ||
2 | # be sorted before 'systemd.conf' becuase this attempts to create a file | ||
3 | # inside /var/log. | ||
4 | |||
5 | |||
6 | d /var/volatile/log - - - - | ||
7 | d /var/volatile/tmp - - - - | ||
diff --git a/meta/recipes-core/systemd/systemd/0001-Make-root-s-home-directory-configurable.patch b/meta/recipes-core/systemd/systemd/0001-Make-root-s-home-directory-configurable.patch new file mode 100644 index 0000000000..c5ad29174c --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0001-Make-root-s-home-directory-configurable.patch | |||
@@ -0,0 +1,180 @@ | |||
1 | From 4dc8dee0435bb63cbe474004b0a8df0363fe94dd Mon Sep 17 00:00:00 2001 | ||
2 | From: Dan McGregor <dan.mcgregor@usask.ca> | ||
3 | Date: Fri, 5 Sep 2014 06:28:58 -0600 | ||
4 | Subject: [PATCH] Make root's home directory configurable. | ||
5 | |||
6 | OpenEmbedded has a configurable home directory for root. Allow | ||
7 | systemd to be built using its idea of what root's home directory | ||
8 | should be. | ||
9 | |||
10 | Upstream-Status: Pending | ||
11 | |||
12 | Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca> | ||
13 | --- | ||
14 | Makefile.am | 2 ++ | ||
15 | configure.ac | 7 +++++++ | ||
16 | src/core/unit-printf.c | 2 +- | ||
17 | src/nspawn/nspawn.c | 4 ++-- | ||
18 | src/shared/util.c | 4 ++-- | ||
19 | units/console-shell.service.m4.in | 4 ++-- | ||
20 | units/emergency.service.in | 4 ++-- | ||
21 | units/rescue.service.m4.in | 4 ++-- | ||
22 | 8 files changed, 20 insertions(+), 11 deletions(-) | ||
23 | |||
24 | diff --git a/Makefile.am b/Makefile.am | ||
25 | index 4028112..5d18f5c 100644 | ||
26 | --- a/Makefile.am | ||
27 | +++ b/Makefile.am | ||
28 | @@ -191,6 +191,7 @@ AM_CPPFLAGS = \ | ||
29 | -DKEXEC=\"$(KEXEC)\" \ | ||
30 | -DLIBDIR=\"$(libdir)\" \ | ||
31 | -DROOTLIBDIR=\"$(rootlibdir)\" \ | ||
32 | + -DROOTHOMEDIR=\"$(roothomedir)\" \ | ||
33 | -DTEST_DIR=\"$(abs_top_srcdir)/test\" \ | ||
34 | -I $(top_srcdir)/src \ | ||
35 | -I $(top_builddir)/src/shared \ | ||
36 | @@ -5584,6 +5585,7 @@ EXTRA_DIST += \ | ||
37 | substitutions = \ | ||
38 | '|rootlibexecdir=$(rootlibexecdir)|' \ | ||
39 | '|rootbindir=$(rootbindir)|' \ | ||
40 | + '|roothomedir=$(roothomedir)|' \ | ||
41 | '|bindir=$(bindir)|' \ | ||
42 | '|SYSTEMCTL=$(rootbindir)/systemctl|' \ | ||
43 | '|SYSTEMD_NOTIFY=$(rootbindir)/systemd-notify|' \ | ||
44 | diff --git a/configure.ac b/configure.ac | ||
45 | index 18b7198..365bc73 100644 | ||
46 | --- a/configure.ac | ||
47 | +++ b/configure.ac | ||
48 | @@ -1272,6 +1272,11 @@ AC_ARG_WITH([rootlibdir], | ||
49 | [], | ||
50 | [with_rootlibdir=${libdir}]) | ||
51 | |||
52 | +AC_ARG_WITH([roothomedir], | ||
53 | + AS_HELP_STRING([--with-roothomedir=DIR], [Home directory for the root user]), | ||
54 | + [], | ||
55 | + [with_roothomedir=/root]) | ||
56 | + | ||
57 | AC_ARG_WITH([pamlibdir], | ||
58 | AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]), | ||
59 | [], | ||
60 | @@ -1317,6 +1322,7 @@ AC_SUBST([pamlibdir], [$with_pamlibdir]) | ||
61 | AC_SUBST([pamconfdir], [$with_pamconfdir]) | ||
62 | AC_SUBST([rootprefix], [$with_rootprefix]) | ||
63 | AC_SUBST([rootlibdir], [$with_rootlibdir]) | ||
64 | +AC_SUBST([roothomedir], [$with_roothomedir]) | ||
65 | |||
66 | AC_CONFIG_FILES([ | ||
67 | Makefile po/Makefile.in | ||
68 | @@ -1400,6 +1406,7 @@ AC_MSG_RESULT([ | ||
69 | include_prefix: ${INCLUDE_PREFIX} | ||
70 | lib dir: ${libdir} | ||
71 | rootlib dir: ${with_rootlibdir} | ||
72 | + root home dir: ${with_roothomedir} | ||
73 | SysV init scripts: ${SYSTEM_SYSVINIT_PATH} | ||
74 | SysV rc?.d directories: ${SYSTEM_SYSVRCND_PATH} | ||
75 | Build Python: ${PYTHON} | ||
76 | diff --git a/src/core/unit-printf.c b/src/core/unit-printf.c | ||
77 | index 62599d0..852d34c 100644 | ||
78 | --- a/src/core/unit-printf.c | ||
79 | +++ b/src/core/unit-printf.c | ||
80 | @@ -259,7 +259,7 @@ static int specifier_user_home(char specifier, void *data, void *userdata, char | ||
81 | * best of it if we can, but fail if we can't */ | ||
82 | |||
83 | if (!c->user || streq(c->user, "root") || streq(c->user, "0")) | ||
84 | - n = strdup("/root"); | ||
85 | + n = strdup(ROOTHOMEDIR); | ||
86 | else | ||
87 | return -ENOTSUP; | ||
88 | |||
89 | diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c | ||
90 | index d01da45..3e876d5 100644 | ||
91 | --- a/src/nspawn/nspawn.c | ||
92 | +++ b/src/nspawn/nspawn.c | ||
93 | @@ -3312,7 +3312,7 @@ int main(int argc, char *argv[]) { | ||
94 | if (r < 0) | ||
95 | _exit(EXIT_FAILURE); | ||
96 | |||
97 | - if ((asprintf((char**)(envp + n_env++), "HOME=%s", home ? home: "/root") < 0) || | ||
98 | + if ((asprintf((char**)(envp + n_env++), "HOME=%s", home ? home: ROOTHOMEDIR) < 0) || | ||
99 | (asprintf((char**)(envp + n_env++), "USER=%s", arg_user ? arg_user : "root") < 0) || | ||
100 | (asprintf((char**)(envp + n_env++), "LOGNAME=%s", arg_user ? arg_user : "root") < 0)) { | ||
101 | log_oom(); | ||
102 | @@ -3402,7 +3402,7 @@ int main(int argc, char *argv[]) { | ||
103 | } else if (argc > optind) | ||
104 | execvpe(argv[optind], argv + optind, env_use); | ||
105 | else { | ||
106 | - chdir(home ? home : "/root"); | ||
107 | + chdir(home ? home : ROOTHOMEDIR); | ||
108 | execle("/bin/bash", "-bash", NULL, env_use); | ||
109 | execle("/bin/sh", "-sh", NULL, env_use); | ||
110 | } | ||
111 | diff --git a/src/shared/util.c b/src/shared/util.c | ||
112 | index 85a570a..aef6033 100644 | ||
113 | --- a/src/shared/util.c | ||
114 | +++ b/src/shared/util.c | ||
115 | @@ -4377,7 +4377,7 @@ int get_user_creds( | ||
116 | *gid = 0; | ||
117 | |||
118 | if (home) | ||
119 | - *home = "/root"; | ||
120 | + *home = ROOTHOMEDIR; | ||
121 | |||
122 | if (shell) | ||
123 | *shell = "/bin/sh"; | ||
124 | @@ -5363,7 +5363,7 @@ int get_home_dir(char **_h) { | ||
125 | /* Hardcode home directory for root to avoid NSS */ | ||
126 | u = getuid(); | ||
127 | if (u == 0) { | ||
128 | - h = strdup("/root"); | ||
129 | + h = strdup(ROOTHOMEDIR); | ||
130 | if (!h) | ||
131 | return -ENOMEM; | ||
132 | |||
133 | diff --git a/units/console-shell.service.m4.in b/units/console-shell.service.m4.in | ||
134 | index 3f4904a..e2af652 100644 | ||
135 | --- a/units/console-shell.service.m4.in | ||
136 | +++ b/units/console-shell.service.m4.in | ||
137 | @@ -15,8 +15,8 @@ After=rc-local.service | ||
138 | Before=getty.target | ||
139 | |||
140 | [Service] | ||
141 | -Environment=HOME=/root | ||
142 | -WorkingDirectory=/root | ||
143 | +Environment=HOME=@roothomedir@ | ||
144 | +WorkingDirectory=@roothomedir@ | ||
145 | ExecStart=-/sbin/sulogin | ||
146 | ExecStopPost=-@SYSTEMCTL@ poweroff | ||
147 | Type=idle | ||
148 | diff --git a/units/emergency.service.in b/units/emergency.service.in | ||
149 | index 91fc1bb..659547e 100644 | ||
150 | --- a/units/emergency.service.in | ||
151 | +++ b/units/emergency.service.in | ||
152 | @@ -13,8 +13,8 @@ Conflicts=shutdown.target | ||
153 | Before=shutdown.target | ||
154 | |||
155 | [Service] | ||
156 | -Environment=HOME=/root | ||
157 | -WorkingDirectory=/root | ||
158 | +Environment=HOME=@roothomedir@ | ||
159 | +WorkingDirectory=@roothomedir@ | ||
160 | ExecStartPre=-/bin/plymouth quit | ||
161 | ExecStartPre=-/bin/echo -e 'Welcome to emergency mode! After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" to try again\\nto boot into default mode.' | ||
162 | ExecStart=-/bin/sh -c "/sbin/sulogin; @SYSTEMCTL@ --fail --no-block default" | ||
163 | diff --git a/units/rescue.service.m4.in b/units/rescue.service.m4.in | ||
164 | index ef54369..7aad86f 100644 | ||
165 | --- a/units/rescue.service.m4.in | ||
166 | +++ b/units/rescue.service.m4.in | ||
167 | @@ -14,8 +14,8 @@ After=sysinit.target plymouth-start.service | ||
168 | Before=shutdown.target | ||
169 | |||
170 | [Service] | ||
171 | -Environment=HOME=/root | ||
172 | -WorkingDirectory=/root | ||
173 | +Environment=HOME=@roothomedir@ | ||
174 | +WorkingDirectory=@roothomedir@ | ||
175 | ExecStartPre=-/bin/plymouth quit | ||
176 | ExecStartPre=-/bin/echo -e 'Welcome to rescue mode! Type "systemctl default" or ^D to enter default mode.\\nType "journalctl -xb" to view system logs. Type "systemctl reboot" to reboot.' | ||
177 | ExecStart=-/bin/sh -c "/sbin/sulogin; @SYSTEMCTL@ --fail --no-block default" | ||
178 | -- | ||
179 | 1.9.3 | ||
180 | |||
diff --git a/meta/recipes-core/systemd/systemd/0001-add-support-for-executing-scripts-under-etc-rcS.d.patch b/meta/recipes-core/systemd/systemd/0001-add-support-for-executing-scripts-under-etc-rcS.d.patch new file mode 100644 index 0000000000..9aa07c1b10 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0001-add-support-for-executing-scripts-under-etc-rcS.d.patch | |||
@@ -0,0 +1,138 @@ | |||
1 | Upstream-Status: Inappropriate [OE specific] | ||
2 | |||
3 | Subject: add support for executing scripts under /etc/rcS.d/ | ||
4 | |||
5 | To be compatible, all services translated from scripts under /etc/rcS.d would | ||
6 | run before services translated from scripts under /etc/rcN.d. | ||
7 | |||
8 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> | ||
9 | --- | ||
10 | src/sysv-generator/sysv-generator.c | 50 ++++++++++++++++++++++++++++--------- | ||
11 | 1 file changed, 38 insertions(+), 12 deletions(-) | ||
12 | |||
13 | diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c | ||
14 | index 9a869ba..10c55c0 100644 | ||
15 | --- a/src/sysv-generator/sysv-generator.c | ||
16 | +++ b/src/sysv-generator/sysv-generator.c | ||
17 | @@ -43,7 +43,8 @@ | ||
18 | |||
19 | typedef enum RunlevelType { | ||
20 | RUNLEVEL_UP, | ||
21 | - RUNLEVEL_DOWN | ||
22 | + RUNLEVEL_DOWN, | ||
23 | + RUNLEVEL_SYSINIT | ||
24 | } RunlevelType; | ||
25 | |||
26 | static const struct { | ||
27 | @@ -58,6 +59,9 @@ static const struct { | ||
28 | { "rc4.d", SPECIAL_RUNLEVEL4_TARGET, RUNLEVEL_UP }, | ||
29 | { "rc5.d", SPECIAL_RUNLEVEL5_TARGET, RUNLEVEL_UP }, | ||
30 | |||
31 | + /* Debian style rcS.d, also adopted by OE */ | ||
32 | + { "rcS.d", SPECIAL_SYSINIT_TARGET, RUNLEVEL_SYSINIT}, | ||
33 | + | ||
34 | /* Standard SysV runlevels for shutdown */ | ||
35 | { "rc0.d", SPECIAL_POWEROFF_TARGET, RUNLEVEL_DOWN }, | ||
36 | { "rc6.d", SPECIAL_REBOOT_TARGET, RUNLEVEL_DOWN } | ||
37 | @@ -66,7 +70,7 @@ static const struct { | ||
38 | directories in this order, and we want to make sure that | ||
39 | sysv_start_priority is known when we first load the | ||
40 | unit. And that value we only know from S links. Hence | ||
41 | - UP must be read before DOWN */ | ||
42 | + UP/SYSINIT must be read before DOWN */ | ||
43 | }; | ||
44 | |||
45 | typedef struct SysvStub { | ||
46 | @@ -82,6 +86,8 @@ typedef struct SysvStub { | ||
47 | char **conflicts; | ||
48 | bool has_lsb; | ||
49 | bool reload; | ||
50 | + bool default_dependencies; | ||
51 | + bool from_rcsd; | ||
52 | } SysvStub; | ||
53 | |||
54 | const char *arg_dest = "/tmp"; | ||
55 | @@ -156,6 +162,9 @@ static int generate_unit_file(SysvStub *s) { | ||
56 | "Description=%s\n", | ||
57 | s->path, s->description); | ||
58 | |||
59 | + if (!s->default_dependencies) | ||
60 | + fprintf(f, "DefaultDependencies=no\n"); | ||
61 | + | ||
62 | if (!isempty(before)) | ||
63 | fprintf(f, "Before=%s\n", before); | ||
64 | if (!isempty(after)) | ||
65 | @@ -661,18 +670,30 @@ static int fix_order(SysvStub *s, Hashmap *all_services) { | ||
66 | if (s->has_lsb && other->has_lsb) | ||
67 | continue; | ||
68 | |||
69 | - if (other->sysv_start_priority < s->sysv_start_priority) { | ||
70 | - r = strv_extend(&s->after, other->name); | ||
71 | + /* All scripts under /etc/rcS.d should execute before scripts under | ||
72 | + * /etc/rcN.d */ | ||
73 | + if (!other->from_rcsd && s->from_rcsd) { | ||
74 | + r = strv_extend(&s->before, other->name); | ||
75 | if (r < 0) | ||
76 | return log_oom(); | ||
77 | - } | ||
78 | - else if (other->sysv_start_priority > s->sysv_start_priority) { | ||
79 | - r = strv_extend(&s->before, other->name); | ||
80 | + } else if (other->from_rcsd && !s->from_rcsd) { | ||
81 | + r = strv_extend(&s->after, other->name); | ||
82 | if (r < 0) | ||
83 | return log_oom(); | ||
84 | - } | ||
85 | - else | ||
86 | - continue; | ||
87 | + } else { | ||
88 | + if (other->sysv_start_priority < s->sysv_start_priority) { | ||
89 | + r = strv_extend(&s->after, other->name); | ||
90 | + if (r < 0) | ||
91 | + return log_oom(); | ||
92 | + } | ||
93 | + else if (other->sysv_start_priority > s->sysv_start_priority) { | ||
94 | + r = strv_extend(&s->before, other->name); | ||
95 | + if (r < 0) | ||
96 | + return log_oom(); | ||
97 | + } | ||
98 | + else | ||
99 | + continue; | ||
100 | + } | ||
101 | |||
102 | /* FIXME: Maybe we should compare the name here lexicographically? */ | ||
103 | } | ||
104 | @@ -725,6 +746,8 @@ static int enumerate_sysv(LookupPaths lp, Hashmap *all_services) { | ||
105 | return log_oom(); | ||
106 | |||
107 | service->sysv_start_priority = -1; | ||
108 | + service->default_dependencies = true; | ||
109 | + service->from_rcsd = false; | ||
110 | service->name = name; | ||
111 | service->path = fpath; | ||
112 | |||
113 | @@ -810,9 +833,11 @@ static int set_dependencies_from_rcnd(LookupPaths lp, Hashmap *all_services) { | ||
114 | |||
115 | if (de->d_name[0] == 'S') { | ||
116 | |||
117 | - if (rcnd_table[i].type == RUNLEVEL_UP) { | ||
118 | + if (rcnd_table[i].type == RUNLEVEL_UP || rcnd_table[i].type == RUNLEVEL_SYSINIT) { | ||
119 | service->sysv_start_priority = | ||
120 | MAX(a*10 + b, service->sysv_start_priority); | ||
121 | + service->default_dependencies = (rcnd_table[i].type == RUNLEVEL_SYSINIT)?false:true; | ||
122 | + service->from_rcsd = (rcnd_table[i].type == RUNLEVEL_SYSINIT)?true:false; | ||
123 | } | ||
124 | |||
125 | r = set_ensure_allocated(&runlevel_services[i], | ||
126 | @@ -825,7 +850,8 @@ static int set_dependencies_from_rcnd(LookupPaths lp, Hashmap *all_services) { | ||
127 | goto finish; | ||
128 | |||
129 | } else if (de->d_name[0] == 'K' && | ||
130 | - (rcnd_table[i].type == RUNLEVEL_DOWN)) { | ||
131 | + (rcnd_table[i].type == RUNLEVEL_DOWN || | ||
132 | + rcnd_table[i].type == RUNLEVEL_SYSINIT)) { | ||
133 | |||
134 | r = set_ensure_allocated(&shutdown_services, | ||
135 | trivial_hash_func, trivial_compare_func); | ||
136 | -- | ||
137 | 1.9.1 | ||
138 | |||
diff --git a/meta/recipes-core/systemd/systemd/0001-build-sys-configure-the-list-of-system-users-files-a.patch b/meta/recipes-core/systemd/systemd/0001-build-sys-configure-the-list-of-system-users-files-a.patch new file mode 100644 index 0000000000..e0043597a2 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0001-build-sys-configure-the-list-of-system-users-files-a.patch | |||
@@ -0,0 +1,176 @@ | |||
1 | From 5a16bc264c32237e38a844d55e7a1820a31b8440 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?=C5=81ukasz=20Stelmach?= <l.stelmach@samsung.com> | ||
3 | Date: Fri, 28 Nov 2014 15:59:59 +0100 | ||
4 | Subject: [PATCH] build-sys: configure the list of system users, files and | ||
5 | directories | ||
6 | |||
7 | Choose which system users defined in sysusers.d/systemd.conf and files | ||
8 | or directories in tmpfiles.d/systemd.conf, should be provided depending | ||
9 | on comile-time configuration. | ||
10 | |||
11 | Upstream-Status: Backport | ||
12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
13 | --- | ||
14 | Makefile.am | 4 ++++ | ||
15 | configure.ac | 2 ++ | ||
16 | sysusers.d/.gitignore | 1 + | ||
17 | sysusers.d/{systemd.conf => systemd.conf.m4} | 8 ++++++++ | ||
18 | tmpfiles.d/.gitignore | 3 ++- | ||
19 | tmpfiles.d/{systemd.conf => systemd.conf.m4} | 2 ++ | ||
20 | 6 files changed, 19 insertions(+), 1 deletion(-) | ||
21 | rename sysusers.d/{systemd.conf => systemd.conf.m4} (77%) | ||
22 | rename tmpfiles.d/{systemd.conf => systemd.conf.m4} (96%) | ||
23 | |||
24 | Index: git/Makefile.am | ||
25 | =================================================================== | ||
26 | --- git.orig/Makefile.am 2015-01-23 21:23:04.000000000 +0000 | ||
27 | +++ git/Makefile.am 2015-01-23 21:23:04.000000000 +0000 | ||
28 | @@ -5698,6 +5698,10 @@ | ||
29 | $(AM_V_at)$(MKDIR_P) $(dir $@) | ||
30 | $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@ | ||
31 | |||
32 | +sysusers.d/%: sysusers.d/%.m4 | ||
33 | + $(AM_V_at)$(MKDIR_P) $(dir $@) | ||
34 | + $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@ | ||
35 | + | ||
36 | tmpfiles.d/%: tmpfiles.d/%.m4 | ||
37 | $(AM_V_at)$(MKDIR_P) $(dir $@) | ||
38 | $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@ | ||
39 | Index: git/configure.ac | ||
40 | =================================================================== | ||
41 | --- git.orig/configure.ac 2015-01-23 21:23:04.000000000 +0000 | ||
42 | +++ git/configure.ac 2015-01-23 21:23:04.000000000 +0000 | ||
43 | @@ -971,6 +971,7 @@ | ||
44 | AC_ARG_ENABLE(timesyncd, AS_HELP_STRING([--disable-timesyncd], [disable timesync daemon])) | ||
45 | if test "x$enable_timesyncd" != "xno"; then | ||
46 | have_timesyncd=yes | ||
47 | + M4_DEFINES="$M4_DEFINES -DENABLE_TIMESYNCD" | ||
48 | fi | ||
49 | AM_CONDITIONAL(ENABLE_TIMESYNCD, [test "$have_timesyncd" = "yes"]) | ||
50 | |||
51 | @@ -1060,6 +1061,7 @@ | ||
52 | AS_IF([test "x$enable_networkd" != "xno"], [ | ||
53 | AC_DEFINE(ENABLE_NETWORKD, 1, [Define if networkd support is to be enabled]) | ||
54 | have_networkd=yes | ||
55 | + M4_DEFINES="$M4_DEFINES -DENABLE_NETWORKD" | ||
56 | ]) | ||
57 | AM_CONDITIONAL(ENABLE_NETWORKD, [test "x$have_networkd" = "xyes"]) | ||
58 | |||
59 | Index: git/sysusers.d/systemd.conf | ||
60 | =================================================================== | ||
61 | --- git.orig/sysusers.d/systemd.conf 2015-01-23 21:23:02.000000000 +0000 | ||
62 | +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
63 | @@ -1,12 +0,0 @@ | ||
64 | -# This file is part of systemd. | ||
65 | -# | ||
66 | -# systemd is free software; you can redistribute it and/or modify it | ||
67 | -# under the terms of the GNU Lesser General Public License as published by | ||
68 | -# the Free Software Foundation; either version 2.1 of the License, or | ||
69 | -# (at your option) any later version. | ||
70 | - | ||
71 | -g systemd-journal - - | ||
72 | -u systemd-bus-proxy - "systemd Bus Proxy" | ||
73 | -u systemd-network - "systemd Network Management" | ||
74 | -u systemd-resolve - "systemd Resolver" | ||
75 | -u systemd-timesync - "systemd Time Synchronization" | ||
76 | Index: git/sysusers.d/systemd.conf.m4 | ||
77 | =================================================================== | ||
78 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
79 | +++ git/sysusers.d/systemd.conf.m4 2015-01-23 21:26:30.000000000 +0000 | ||
80 | @@ -0,0 +1,20 @@ | ||
81 | +# This file is part of systemd. | ||
82 | +# | ||
83 | +# systemd is free software; you can redistribute it and/or modify it | ||
84 | +# under the terms of the GNU Lesser General Public License as published by | ||
85 | +# the Free Software Foundation; either version 2.1 of the License, or | ||
86 | +# (at your option) any later version. | ||
87 | + | ||
88 | +g systemd-journal - - | ||
89 | +m4_ifdef(`ENABLE_KDBUS', | ||
90 | +u systemd-bus-proxy - "systemd Bus Proxy" | ||
91 | +)m4_dnl | ||
92 | +m4_ifdef(`ENABLE_NETWORKD', | ||
93 | +u systemd-network - "systemd Network Management" | ||
94 | +)m4_dnl | ||
95 | +m4_ifdef(`ENABLE_RESOLVED', | ||
96 | +u systemd-resolve - "systemd Resolver" | ||
97 | +)m4_dnl | ||
98 | +m4_ifdef(`ENABLE_TIMESYNCD', | ||
99 | +u systemd-timesync - "systemd Time Synchronization" | ||
100 | +)m4_dnl | ||
101 | Index: git/tmpfiles.d/systemd.conf | ||
102 | =================================================================== | ||
103 | --- git.orig/tmpfiles.d/systemd.conf 2015-01-23 21:23:02.000000000 +0000 | ||
104 | +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
105 | @@ -1,32 +0,0 @@ | ||
106 | -# This file is part of systemd. | ||
107 | -# | ||
108 | -# systemd is free software; you can redistribute it and/or modify it | ||
109 | -# under the terms of the GNU Lesser General Public License as published by | ||
110 | -# the Free Software Foundation; either version 2.1 of the License, or | ||
111 | -# (at your option) any later version. | ||
112 | - | ||
113 | -# See tmpfiles.d(5) for details | ||
114 | - | ||
115 | -d /run/user 0755 root root - | ||
116 | -F! /run/utmp 0664 root utmp - | ||
117 | - | ||
118 | -d /run/systemd/ask-password 0755 root root - | ||
119 | -d /run/systemd/seats 0755 root root - | ||
120 | -d /run/systemd/sessions 0755 root root - | ||
121 | -d /run/systemd/users 0755 root root - | ||
122 | -d /run/systemd/machines 0755 root root - | ||
123 | -d /run/systemd/shutdown 0755 root root - | ||
124 | -d /run/systemd/netif 0755 systemd-network systemd-network - | ||
125 | -d /run/systemd/netif/links 0755 systemd-network systemd-network - | ||
126 | -d /run/systemd/netif/leases 0755 systemd-network systemd-network - | ||
127 | - | ||
128 | -d /run/log 0755 root root - | ||
129 | - | ||
130 | -z /run/log/journal 2755 root systemd-journal - - | ||
131 | -Z /run/log/journal/%m ~2750 root systemd-journal - - | ||
132 | - | ||
133 | -z /var/log/journal 2755 root systemd-journal - - | ||
134 | -z /var/log/journal/%m 2755 root systemd-journal - - | ||
135 | - | ||
136 | -d /var/lib/systemd 0755 root root - | ||
137 | -d /var/lib/systemd/coredump 0755 root root 3d | ||
138 | Index: git/tmpfiles.d/systemd.conf.m4 | ||
139 | =================================================================== | ||
140 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
141 | +++ git/tmpfiles.d/systemd.conf.m4 2015-01-23 21:26:46.000000000 +0000 | ||
142 | @@ -0,0 +1,34 @@ | ||
143 | +# This file is part of systemd. | ||
144 | +# | ||
145 | +# systemd is free software; you can redistribute it and/or modify it | ||
146 | +# under the terms of the GNU Lesser General Public License as published by | ||
147 | +# the Free Software Foundation; either version 2.1 of the License, or | ||
148 | +# (at your option) any later version. | ||
149 | + | ||
150 | +# See tmpfiles.d(5) for details | ||
151 | + | ||
152 | +d /run/user 0755 root root - | ||
153 | +F! /run/utmp 0664 root utmp - | ||
154 | + | ||
155 | +d /run/systemd/ask-password 0755 root root - | ||
156 | +d /run/systemd/seats 0755 root root - | ||
157 | +d /run/systemd/sessions 0755 root root - | ||
158 | +d /run/systemd/users 0755 root root - | ||
159 | +d /run/systemd/machines 0755 root root - | ||
160 | +d /run/systemd/shutdown 0755 root root - | ||
161 | +m4_ifdef(`ENABLE_NETWORKD', | ||
162 | +d /run/systemd/netif 0755 systemd-network systemd-network - | ||
163 | +d /run/systemd/netif/links 0755 systemd-network systemd-network - | ||
164 | +d /run/systemd/netif/leases 0755 systemd-network systemd-network - | ||
165 | +)m4_dnl | ||
166 | + | ||
167 | +d /run/log 0755 root root - | ||
168 | + | ||
169 | +z /run/log/journal 2755 root systemd-journal - - | ||
170 | +Z /run/log/journal/%m ~2750 root systemd-journal - - | ||
171 | + | ||
172 | +z /var/log/journal 2755 root systemd-journal - - | ||
173 | +z /var/log/journal/%m 2755 root systemd-journal - - | ||
174 | + | ||
175 | +d /var/lib/systemd 0755 root root - | ||
176 | +d /var/lib/systemd/coredump 0755 root root 3d | ||
diff --git a/meta/recipes-core/systemd/systemd/0001-build-sys-do-not-install-tmpfiles-and-sysusers-files.patch b/meta/recipes-core/systemd/systemd/0001-build-sys-do-not-install-tmpfiles-and-sysusers-files.patch new file mode 100644 index 0000000000..4795f8670f --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0001-build-sys-do-not-install-tmpfiles-and-sysusers-files.patch | |||
@@ -0,0 +1,56 @@ | |||
1 | From bedd083aaedb3bbb14ef579a047bf4b4fed56d9b Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?=C5=81ukasz=20Stelmach?= <l.stelmach@samsung.com> | ||
3 | Date: Wed, 26 Nov 2014 09:17:50 +0100 | ||
4 | Subject: [PATCH] build-sys: do not install tmpfiles and sysusers files by | ||
5 | default | ||
6 | |||
7 | Upstream-Status: Backport | ||
8 | |||
9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
10 | |||
11 | --- | ||
12 | Makefile.am | 14 +++++++++++--- | ||
13 | 1 file changed, 11 insertions(+), 3 deletions(-) | ||
14 | |||
15 | diff --git a/Makefile.am b/Makefile.am | ||
16 | index ddd0df1..65bb176 100644 | ||
17 | --- a/Makefile.am | ||
18 | +++ b/Makefile.am | ||
19 | @@ -2039,7 +2039,6 @@ nodist_tmpfiles_DATA = \ | ||
20 | dist_tmpfiles_DATA = \ | ||
21 | tmpfiles.d/systemd.conf \ | ||
22 | tmpfiles.d/systemd-nologin.conf \ | ||
23 | - tmpfiles.d/systemd-remote.conf \ | ||
24 | tmpfiles.d/tmp.conf \ | ||
25 | tmpfiles.d/x11.conf \ | ||
26 | tmpfiles.d/var.conf | ||
27 | @@ -2094,8 +2093,7 @@ SYSINIT_TARGET_WANTS += \ | ||
28 | systemd-sysusers.service | ||
29 | |||
30 | dist_sysusers_DATA = \ | ||
31 | - sysusers.d/systemd.conf \ | ||
32 | - sysusers.d/systemd-remote.conf | ||
33 | + sysusers.d/systemd.conf | ||
34 | |||
35 | nodist_sysusers_DATA = \ | ||
36 | sysusers.d/basic.conf | ||
37 | @@ -3839,6 +3837,16 @@ systemd_journal_remote_CFLAGS = \ | ||
38 | systemd_journal_remote_LDADD += \ | ||
39 | $(MICROHTTPD_LIBS) | ||
40 | |||
41 | +if ENABLE_SYSUSERS | ||
42 | +dist_sysusers_DATA += \ | ||
43 | + sysusers.d/systemd-remote.conf | ||
44 | +endif | ||
45 | + | ||
46 | +if ENABLE_TMPFILES | ||
47 | +dist_tmpfiles_DATA += \ | ||
48 | + tmpfiles.d/systemd-remote.conf | ||
49 | +endif | ||
50 | + | ||
51 | if HAVE_GNUTLS | ||
52 | systemd_journal_remote_LDADD += \ | ||
53 | $(GNUTLS_LIBS) | ||
54 | -- | ||
55 | 1.9.1 | ||
56 | |||
diff --git a/meta/recipes-core/systemd/systemd/0001-journal-Fix-navigating-backwards-missing-entries.patch b/meta/recipes-core/systemd/systemd/0001-journal-Fix-navigating-backwards-missing-entries.patch new file mode 100644 index 0000000000..911e2ff1c1 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0001-journal-Fix-navigating-backwards-missing-entries.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | From 2173cbf847fc53ca24950e77958c902edecfc207 Mon Sep 17 00:00:00 2001 | ||
2 | From: Olivier Brunel <jjk@jjacky.com> | ||
3 | Date: Fri, 5 Dec 2014 16:06:45 +0100 | ||
4 | Subject: [PATCH] journal: Fix navigating backwards missing entries | ||
5 | |||
6 | With DIRECTION_UP (i.e. navigating backwards) in generic_array_bisect() when the | ||
7 | needle was found as the last item in the array, it wasn't actually processed as | ||
8 | match, resulting in entries being missed. | ||
9 | |||
10 | https://bugs.freedesktop.org/show_bug.cgi?id=86855 | ||
11 | |||
12 | Upstream-Status: Backport | ||
13 | |||
14 | Signed-off-by: Jonathan Liu <net147@gmail.com> | ||
15 | --- | ||
16 | src/journal/journal-file.c | 2 +- | ||
17 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
18 | |||
19 | diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c | ||
20 | index 7858435..c5d2d19 100644 | ||
21 | --- a/src/journal/journal-file.c | ||
22 | +++ b/src/journal/journal-file.c | ||
23 | @@ -1657,7 +1657,7 @@ static int generic_array_bisect( | ||
24 | } | ||
25 | } | ||
26 | |||
27 | - if (k > n) { | ||
28 | + if (k >= n) { | ||
29 | if (direction == DIRECTION_UP) { | ||
30 | i = n; | ||
31 | subtract_one = true; | ||
32 | -- | ||
33 | 2.1.3 | ||
diff --git a/meta/recipes-core/systemd/systemd/0001-missing.h-add-fake-__NR_memfd_create-for-MIPS.patch b/meta/recipes-core/systemd/systemd/0001-missing.h-add-fake-__NR_memfd_create-for-MIPS.patch new file mode 100644 index 0000000000..448ef1a917 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0001-missing.h-add-fake-__NR_memfd_create-for-MIPS.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | Upstream-Status: Backport | ||
2 | |||
3 | Subject: missing.h: add fake __NR_memfd_create for MIPS | ||
4 | |||
5 | We don't have the correct __NR_memfd_create syscall number yet, so set it to | ||
6 | 0xffffffff for now to prevent compile time errors. | ||
7 | |||
8 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> | ||
9 | --- | ||
10 | src/shared/missing.h | 3 +++ | ||
11 | 1 file changed, 3 insertions(+) | ||
12 | |||
13 | diff --git a/src/shared/missing.h b/src/shared/missing.h | ||
14 | index 3ff1a21..3051cb5 100644 | ||
15 | --- a/src/shared/missing.h | ||
16 | +++ b/src/shared/missing.h | ||
17 | @@ -167,6 +167,9 @@ static inline int pivot_root(const char *new_root, const char *put_old) { | ||
18 | # define __NR_fanotify_mark 5296 | ||
19 | # endif | ||
20 | # endif | ||
21 | +# ifndef __NR_memfd_create | ||
22 | +# define __NR_memfd_create 0xffffffff /* FIXME */ | ||
23 | +# endif | ||
24 | #else | ||
25 | # ifndef __NR_fanotify_init | ||
26 | # define __NR_fanotify_init 338 | ||
27 | -- | ||
28 | 1.9.1 | ||
29 | |||
diff --git a/meta/recipes-core/systemd/systemd/0001-systemd-user-avoid-using-system-auth.patch b/meta/recipes-core/systemd/systemd/0001-systemd-user-avoid-using-system-auth.patch new file mode 100644 index 0000000000..fbde13f077 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0001-systemd-user-avoid-using-system-auth.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | Upstream-Status: Inappropriate [oe specific] | ||
2 | |||
3 | Subject: systemd-user: avoid using system-auth | ||
4 | |||
5 | In OE, we don't provide system-auth, instead, we use common-* files. | ||
6 | So modify systemd-user file to use common-* files. | ||
7 | |||
8 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> | ||
9 | --- | ||
10 | src/login/systemd-user | 4 ++-- | ||
11 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
12 | |||
13 | diff --git a/src/login/systemd-user b/src/login/systemd-user | ||
14 | index 8112d74..99635af 100644 | ||
15 | --- a/src/login/systemd-user | ||
16 | +++ b/src/login/systemd-user | ||
17 | @@ -2,5 +2,5 @@ | ||
18 | # | ||
19 | # Used by systemd --user instances. | ||
20 | |||
21 | -account include system-auth | ||
22 | -session include system-auth | ||
23 | +account include common-account | ||
24 | +session include common-session | ||
25 | -- | ||
26 | 1.9.1 | ||
diff --git a/meta/recipes-core/systemd/systemd/0001-tmpfiles-make-resolv.conf-entry-conditional-on-resol.patch b/meta/recipes-core/systemd/systemd/0001-tmpfiles-make-resolv.conf-entry-conditional-on-resol.patch new file mode 100644 index 0000000000..b5b0168149 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0001-tmpfiles-make-resolv.conf-entry-conditional-on-resol.patch | |||
@@ -0,0 +1,142 @@ | |||
1 | From aeb50ff0bd4bbbca74c4695072232348351d512d Mon Sep 17 00:00:00 2001 | ||
2 | From: Tom Gundersen <teg@jklm.no> | ||
3 | Date: Wed, 27 Aug 2014 17:45:41 +0200 | ||
4 | Subject: [PATCH] tmpfiles: make resolv.conf entry conditional on resolved | ||
5 | support | ||
6 | |||
7 | Upstream-Status: Backport | ||
8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
9 | |||
10 | --- | ||
11 | Makefile.am | 15 +++++++++++++-- | ||
12 | TODO | 2 -- | ||
13 | configure.ac | 1 + | ||
14 | tmpfiles.d/.gitignore | 1 + | ||
15 | tmpfiles.d/{etc.conf => etc.conf.m4} | 2 ++ | ||
16 | 5 files changed, 17 insertions(+), 4 deletions(-) | ||
17 | create mode 100644 tmpfiles.d/.gitignore | ||
18 | rename tmpfiles.d/{etc.conf => etc.conf.m4} (95%) | ||
19 | |||
20 | Index: git/Makefile.am | ||
21 | =================================================================== | ||
22 | --- git.orig/Makefile.am 2015-01-24 00:41:20.134716451 -0800 | ||
23 | +++ git/Makefile.am 2015-01-24 00:41:20.126716451 -0800 | ||
24 | @@ -1935,14 +1935,16 @@ | ||
25 | units/systemd-tmpfiles-setup.service \ | ||
26 | units/systemd-tmpfiles-clean.service | ||
27 | |||
28 | +nodist_tmpfiles_DATA = \ | ||
29 | + tmpfiles.d/etc.conf | ||
30 | + | ||
31 | dist_tmpfiles_DATA = \ | ||
32 | tmpfiles.d/systemd.conf \ | ||
33 | tmpfiles.d/systemd-nologin.conf \ | ||
34 | tmpfiles.d/systemd-remote.conf \ | ||
35 | tmpfiles.d/tmp.conf \ | ||
36 | tmpfiles.d/x11.conf \ | ||
37 | - tmpfiles.d/var.conf \ | ||
38 | - tmpfiles.d/etc.conf | ||
39 | + tmpfiles.d/var.conf | ||
40 | |||
41 | if HAVE_SYSV_COMPAT | ||
42 | dist_tmpfiles_DATA += \ | ||
43 | @@ -1965,10 +1967,14 @@ | ||
44 | endif | ||
45 | |||
46 | EXTRA_DIST += \ | ||
47 | + tmpfiles.d/etc.conf.m4 \ | ||
48 | units/systemd-tmpfiles-setup-dev.service.in \ | ||
49 | units/systemd-tmpfiles-setup.service.in \ | ||
50 | units/systemd-tmpfiles-clean.service.in | ||
51 | |||
52 | +CLEANFILES += \ | ||
53 | + tmpfiles.d/etc.conf | ||
54 | + | ||
55 | # ------------------------------------------------------------------------------ | ||
56 | if ENABLE_SYSUSERS | ||
57 | systemd_sysusers_SOURCES = \ | ||
58 | @@ -5684,6 +5690,11 @@ | ||
59 | $(AM_V_at)$(MKDIR_P) $(dir $@) | ||
60 | $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@ | ||
61 | |||
62 | +tmpfiles.d/%: tmpfiles.d/%.m4 | ||
63 | + $(AM_V_at)$(MKDIR_P) $(dir $@) | ||
64 | + $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@ | ||
65 | + | ||
66 | + | ||
67 | units/%: units/%.m4 | ||
68 | $(AM_V_at)$(MKDIR_P) $(dir $@) | ||
69 | $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_SYSTEM=1 < $< > $@ | ||
70 | Index: git/TODO | ||
71 | =================================================================== | ||
72 | --- git.orig/TODO 2015-01-24 00:41:20.134716451 -0800 | ||
73 | +++ git/TODO 2015-01-24 00:41:20.126716451 -0800 | ||
74 | @@ -111,8 +111,6 @@ | ||
75 | |||
76 | * Allow multiple ExecStart= for all Type= settings, so that we can cover rescue.service nicely | ||
77 | |||
78 | -* the resolv.conf tmpfiles line should be covered by ENABLE_NETWORKD... | ||
79 | - | ||
80 | * Add a new verb "systemctl top" | ||
81 | |||
82 | * logind: allow users to kill or lock their own sessions | ||
83 | Index: git/configure.ac | ||
84 | =================================================================== | ||
85 | --- git.orig/configure.ac 2015-01-24 00:41:20.134716451 -0800 | ||
86 | +++ git/configure.ac 2015-01-24 00:41:20.126716451 -0800 | ||
87 | @@ -1041,6 +1041,7 @@ | ||
88 | AC_ARG_ENABLE(resolved, AS_HELP_STRING([--disable-resolved], [disable resolve daemon])) | ||
89 | if test "x$enable_resolved" != "xno"; then | ||
90 | have_resolved=yes | ||
91 | + M4_DEFINES="$M4_DEFINES -DENABLE_RESOLVED" | ||
92 | fi | ||
93 | AM_CONDITIONAL(ENABLE_RESOLVED, [test "$have_resolved" = "yes"]) | ||
94 | |||
95 | Index: git/tmpfiles.d/.gitignore | ||
96 | =================================================================== | ||
97 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
98 | +++ git/tmpfiles.d/.gitignore 2015-01-24 00:41:20.126716451 -0800 | ||
99 | @@ -0,0 +1 @@ | ||
100 | +etc.conf | ||
101 | Index: git/tmpfiles.d/etc.conf | ||
102 | =================================================================== | ||
103 | --- git.orig/tmpfiles.d/etc.conf 2015-01-24 00:41:20.134716451 -0800 | ||
104 | +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
105 | @@ -1,15 +0,0 @@ | ||
106 | -# This file is part of systemd. | ||
107 | -# | ||
108 | -# systemd is free software; you can redistribute it and/or modify it | ||
109 | -# under the terms of the GNU Lesser General Public License as published by | ||
110 | -# the Free Software Foundation; either version 2.1 of the License, or | ||
111 | -# (at your option) any later version. | ||
112 | - | ||
113 | -# See tmpfiles.d(5) for details | ||
114 | - | ||
115 | -L /etc/os-release - - - - ../usr/lib/os-release | ||
116 | -L /etc/localtime - - - - ../usr/share/zoneinfo/UTC | ||
117 | -L+ /etc/mtab - - - - ../proc/self/mounts | ||
118 | -L /etc/resolv.conf - - - - ../run/systemd/resolve/resolv.conf | ||
119 | -C /etc/nsswitch.conf - - - - | ||
120 | -C /etc/pam.d - - - - | ||
121 | Index: git/tmpfiles.d/etc.conf.m4 | ||
122 | =================================================================== | ||
123 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
124 | +++ git/tmpfiles.d/etc.conf.m4 2015-01-24 00:41:20.126716451 -0800 | ||
125 | @@ -0,0 +1,17 @@ | ||
126 | +# This file is part of systemd. | ||
127 | +# | ||
128 | +# systemd is free software; you can redistribute it and/or modify it | ||
129 | +# under the terms of the GNU Lesser General Public License as published by | ||
130 | +# the Free Software Foundation; either version 2.1 of the License, or | ||
131 | +# (at your option) any later version. | ||
132 | + | ||
133 | +# See tmpfiles.d(5) for details | ||
134 | + | ||
135 | +L /etc/os-release - - - - ../usr/lib/os-release | ||
136 | +L /etc/localtime - - - - ../usr/share/zoneinfo/UTC | ||
137 | +L+ /etc/mtab - - - - ../proc/self/mounts | ||
138 | +m4_ifdef(`ENABLE_RESOLVED', | ||
139 | +L /etc/resolv.conf - - - - ../run/systemd/resolve/resolv.conf | ||
140 | +) | ||
141 | +C /etc/nsswitch.conf - - - - | ||
142 | +C /etc/pam.d - - - - | ||
diff --git a/meta/recipes-core/systemd/systemd/binfmt-install.patch b/meta/recipes-core/systemd/systemd/binfmt-install.patch new file mode 100644 index 0000000000..c2d5099f24 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/binfmt-install.patch | |||
@@ -0,0 +1,56 @@ | |||
1 | Don't install dependency links at install time for the binfmt services, use | ||
2 | [Install] blocks so that they get created when the service is enabled like a | ||
3 | traditional service. | ||
4 | |||
5 | The [Install] blocks were rejected upstream as they don't have a way to "enable" | ||
6 | it on install without static symlinks which can't be disabled, only masked. We | ||
7 | however can do that in a postinst. | ||
8 | |||
9 | Upstream-Status: Denied | ||
10 | Signed-off-by: Ross Burton <ross.burton@intel.com> | ||
11 | |||
12 | diff --git a/Makefile.am b/Makefile.am | ||
13 | index 7933de6..78acb6f 100644 | ||
14 | --- a/Makefile.am | ||
15 | +++ b/Makefile.am | ||
16 | @@ -3133,10 +3133,6 @@ INSTALL_DIRS += \ | ||
17 | $(prefix)/lib/binfmt.d \ | ||
18 | $(sysconfdir)/binfmt.d | ||
19 | |||
20 | -SYSINIT_TARGET_WANTS += \ | ||
21 | - systemd-binfmt.service \ | ||
22 | - proc-sys-fs-binfmt_misc.automount | ||
23 | - | ||
24 | endif | ||
25 | |||
26 | EXTRA_DIST += \ | ||
27 | diff --git a/units/proc-sys-fs-binfmt_misc.automount b/units/proc-sys-fs-binfmt_misc.automount | ||
28 | index 6be3893..709adef 100644 | ||
29 | --- a/units/proc-sys-fs-binfmt_misc.automount | ||
30 | +++ b/units/proc-sys-fs-binfmt_misc.automount | ||
31 | @@ -16,3 +16,6 @@ ConditionPathIsReadWrite=/proc/sys/ | ||
32 | |||
33 | [Automount] | ||
34 | Where=/proc/sys/fs/binfmt_misc | ||
35 | + | ||
36 | +[Install] | ||
37 | +WantedBy=sysinit.target | ||
38 | diff --git a/units/systemd-binfmt.service.in b/units/systemd-binfmt.service.in | ||
39 | index 02dfe77..86d3481 100644 | ||
40 | --- a/units/systemd-binfmt.service.in | ||
41 | +++ b/units/systemd-binfmt.service.in | ||
42 | @@ -11,6 +11,7 @@ Documentation=man:systemd-binfmt.service(8) man:binfmt.d(5) | ||
43 | Documentation=https://www.kernel.org/doc/Documentation/binfmt_misc.txt | ||
44 | DefaultDependencies=no | ||
45 | Conflicts=shutdown.target | ||
46 | +Wants=proc-sys-fs-binfmt_misc.automount | ||
47 | After=systemd-readahead-collect.service systemd-readahead-replay.service proc-sys-fs-binfmt_misc.automount | ||
48 | Before=sysinit.target shutdown.target | ||
49 | ConditionPathIsReadWrite=/proc/sys/ | ||
50 | @@ -24,3 +25,6 @@ ConditionDirectoryNotEmpty=|/run/binfmt.d | ||
51 | Type=oneshot | ||
52 | RemainAfterExit=yes | ||
53 | ExecStart=@rootlibexecdir@/systemd-binfmt | ||
54 | + | ||
55 | +[Install] | ||
56 | +WantedBy=sysinit.target | ||
diff --git a/meta/recipes-core/systemd/systemd/init b/meta/recipes-core/systemd/systemd/init new file mode 100644 index 0000000000..ea52be4820 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/init | |||
@@ -0,0 +1,104 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | ### BEGIN INIT INFO | ||
4 | # Provides: udev | ||
5 | # Required-Start: mountvirtfs | ||
6 | # Required-Stop: | ||
7 | # Default-Start: S | ||
8 | # Default-Stop: | ||
9 | # Short-Description: Start udevd, populate /dev and load drivers. | ||
10 | ### END INIT INFO | ||
11 | |||
12 | . /etc/init.d/functions | ||
13 | |||
14 | export TZ=/etc/localtime | ||
15 | |||
16 | [ -d /sys/class ] || exit 1 | ||
17 | [ -r /proc/mounts ] || exit 1 | ||
18 | [ -x @UDEVD@ ] || exit 1 | ||
19 | [ -f /etc/default/udev-cache ] && . /etc/default/udev-cache | ||
20 | [ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf | ||
21 | |||
22 | readfile () { | ||
23 | filename=$1 | ||
24 | READDATA="" | ||
25 | if [ -r $filename ]; then | ||
26 | while read line; do | ||
27 | READDATA="$READDATA$line" | ||
28 | done < $filename | ||
29 | fi | ||
30 | } | ||
31 | |||
32 | case "$1" in | ||
33 | start) | ||
34 | export ACTION=add | ||
35 | # propagate /dev from /sys | ||
36 | echo "Starting udev" | ||
37 | |||
38 | # mount the devtmpfs on /dev, if not already done | ||
39 | LANG=C awk '$2 == "/dev" && ($3 == "devtmpfs") { exit 1 }' /proc/mounts && { | ||
40 | mount -n -o mode=0755 -t devtmpfs none "/dev" | ||
41 | } | ||
42 | [ -e /dev/pts ] || mkdir -m 0755 /dev/pts | ||
43 | [ -e /dev/shm ] || mkdir -m 1777 /dev/shm | ||
44 | mount -a -t tmpfs 2>/dev/null | ||
45 | |||
46 | # cache handling | ||
47 | if [ "$DEVCACHE" != "" ]; then | ||
48 | readfile /proc/version | ||
49 | VERSION="$READDATA" | ||
50 | readfile /proc/cmdline | ||
51 | CMDLINE="$READDATA" | ||
52 | readfile /proc/devices | ||
53 | DEVICES="$READDATA" | ||
54 | readfile /proc/atags | ||
55 | ATAGS="$READDATA" | ||
56 | |||
57 | if [ -e $DEVCACHE ]; then | ||
58 | readfile /etc/udev/cache.data | ||
59 | if [ "$READDATA" = "$VERSION$CMDLINE$DEVICES$ATAGS" ]; then | ||
60 | (cd /; tar xf $DEVCACHE > /dev/null 2>&1) | ||
61 | not_first_boot=1 | ||
62 | [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE" | ||
63 | [ -e /dev/shm/udev.cache ] && rm -f /dev/shm/udev.cache | ||
64 | else | ||
65 | echo "$VERSION$CMDLINE$DEVICES$ATAGS" > /dev/shm/udev.cache | ||
66 | fi | ||
67 | else | ||
68 | echo "$VERSION$CMDLINE$DEVICES$ATAGS" > /dev/shm/udev.cache | ||
69 | fi | ||
70 | fi | ||
71 | |||
72 | # make_extra_nodes | ||
73 | killproc systemd-udevd > "/dev/null" 2>&1 | ||
74 | |||
75 | # trigger the sorted events | ||
76 | echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug | ||
77 | @UDEVD@ -d | ||
78 | |||
79 | udevadm control --env=STARTUP=1 | ||
80 | if [ "$not_first_boot" != "" ];then | ||
81 | udevadm trigger --action=add --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus --subsystem-nomatch=graphics --subsystem-nomatch=backlight --subsystem-nomatch=video4linux --subsystem-nomatch=platform | ||
82 | (udevadm settle --timeout=3; udevadm control --env=STARTUP=)& | ||
83 | else | ||
84 | udevadm trigger --action=add | ||
85 | udevadm settle | ||
86 | fi | ||
87 | ;; | ||
88 | stop) | ||
89 | echo "Stopping udevd" | ||
90 | start-stop-daemon --stop --name systemd-udevd --quiet | ||
91 | ;; | ||
92 | restart) | ||
93 | $0 stop | ||
94 | sleep 1 | ||
95 | $0 start | ||
96 | ;; | ||
97 | status) | ||
98 | status systemd-udevd | ||
99 | ;; | ||
100 | *) | ||
101 | echo "Usage: $0 {start|stop|status|restart}" | ||
102 | exit 1 | ||
103 | esac | ||
104 | exit 0 | ||
diff --git a/meta/recipes-core/systemd/systemd/optional_secure_getenv.patch b/meta/recipes-core/systemd/systemd/optional_secure_getenv.patch new file mode 100644 index 0000000000..2063268246 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/optional_secure_getenv.patch | |||
@@ -0,0 +1,19 @@ | |||
1 | on uclibc secure_getenv is not available | ||
2 | therefore default to using getenv instead | ||
3 | |||
4 | Upstream-Status: Denied [no desire for uclibc support] | ||
5 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
6 | |||
7 | Index: git/src/shared/missing.h | ||
8 | =================================================================== | ||
9 | --- git.orig/src/shared/missing.h 2012-09-22 18:46:44.141282145 -0700 | ||
10 | +++ git/src/shared/missing.h 2012-09-22 18:48:44.081276570 -0700 | ||
11 | @@ -233,6 +233,8 @@ | ||
12 | #ifndef HAVE_SECURE_GETENV | ||
13 | # ifdef HAVE___SECURE_GETENV | ||
14 | # define secure_getenv __secure_getenv | ||
15 | +# elif defined __UCLIBC__ | ||
16 | +# define secure_getenv getenv | ||
17 | # else | ||
18 | # error neither secure_getenv nor __secure_getenv are available | ||
19 | # endif | ||
diff --git a/meta/recipes-core/systemd/systemd/run-ptest b/meta/recipes-core/systemd/systemd/run-ptest new file mode 100644 index 0000000000..a2d61c2894 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/run-ptest | |||
@@ -0,0 +1,5 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | tar -C test -xJf test/sys.tar.xz | ||
4 | make test/rules-test.sh.log | ||
5 | make test/udev-test.pl.log | ||
diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch b/meta/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch new file mode 100644 index 0000000000..4639532236 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | Upstream-Status: Denied [no desire for uclibc support] | ||
2 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
3 | |||
4 | Index: git/configure.ac | ||
5 | =================================================================== | ||
6 | --- git.orig/configure.ac 2014-03-15 17:53:51.756340454 -0700 | ||
7 | +++ git/configure.ac 2014-03-15 18:07:34.888355897 -0700 | ||
8 | @@ -78,6 +78,24 @@ | ||
9 | |||
10 | M4_DEFINES= | ||
11 | |||
12 | +# check for few functions not implemented in uClibc | ||
13 | + | ||
14 | +AC_CHECK_FUNCS_ONCE(mkostemp execvpe posix_fallocate) | ||
15 | + | ||
16 | +# check for %ms format support - assume always no if cross compiling | ||
17 | + | ||
18 | +AC_MSG_CHECKING([whether %ms format is supported by *scanf]) | ||
19 | + | ||
20 | +AC_LINK_IFELSE( | ||
21 | + [AC_LANG_PROGRAM([ | ||
22 | + #include <stdio.h> | ||
23 | + ],[ | ||
24 | + char *buf1, *buf2, *buf3, str="1 2.3 abcde" ; | ||
25 | + int rc = sscanf(str, "%ms %ms %ms", &buf1, &buf2, &buf3) ; | ||
26 | + return (rc==3)?0:1;])], | ||
27 | + [AC_DEFINE([HAVE_MSFORMAT], [1], [Define if %ms format is supported by *scanf.])], | ||
28 | + [AC_MSG_RESULT([no])]) | ||
29 | + | ||
30 | # gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line | ||
31 | m4_ifdef([GTK_DOC_CHECK], [ | ||
32 | GTK_DOC_CHECK([1.18],[--flavour no-tmpl])], | ||
diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch b/meta/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch new file mode 100644 index 0000000000..7170a38af3 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | Upstream-Status: Denied [no desire for uclibc support] | ||
2 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
3 | |||
4 | Index: systemd-209/src/nspawn/nspawn.c | ||
5 | =================================================================== | ||
6 | --- systemd-209.orig/src/nspawn/nspawn.c 2014-02-19 15:03:09.000000000 -0800 | ||
7 | +++ systemd-209/src/nspawn/nspawn.c 2014-02-19 23:20:38.720628627 -0800 | ||
8 | @@ -91,6 +91,8 @@ | ||
9 | LINK_GUEST | ||
10 | } LinkJournal; | ||
11 | |||
12 | +#include "config.h" | ||
13 | + | ||
14 | static char *arg_directory = NULL; | ||
15 | static char *arg_user = NULL; | ||
16 | static sd_id128_t arg_uuid = {}; | ||
17 | @@ -2045,7 +2047,12 @@ | ||
18 | a[0] = (char*) "/sbin/init"; | ||
19 | execve(a[0], a, env_use); | ||
20 | } else if (argc > optind) | ||
21 | +#ifdef HAVE_EXECVPE | ||
22 | execvpe(argv[optind], argv + optind, env_use); | ||
23 | +#else | ||
24 | + environ = env_use; | ||
25 | + execvp(argv[optind], argv + optind); | ||
26 | +#endif /* HAVE_EXECVPE */ | ||
27 | else { | ||
28 | chdir(home ? home : "/root"); | ||
29 | execle("/bin/bash", "-bash", NULL, env_use); | ||
diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch b/meta/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch new file mode 100644 index 0000000000..f8e19ce172 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch | |||
@@ -0,0 +1,92 @@ | |||
1 | Upstream-Status: Denied [no desire for uclibc support] | ||
2 | |||
3 | This patch is uclibc specific, thus not suitable for upstream. | ||
4 | |||
5 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
6 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> | ||
7 | --- | ||
8 | src/journal/journal-file.c | 16 +++++++++++++++- | ||
9 | src/journal/journald-kmsg.c | 16 ++++++++++++++-- | ||
10 | 2 files changed, 29 insertions(+), 3 deletions(-) | ||
11 | |||
12 | diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c | ||
13 | index f2f1f35..092f87b 100644 | ||
14 | --- a/src/journal/journal-file.c | ||
15 | +++ b/src/journal/journal-file.c | ||
16 | @@ -38,6 +38,8 @@ | ||
17 | #include "compress.h" | ||
18 | #include "fsprg.h" | ||
19 | |||
20 | +#include "config.h" | ||
21 | + | ||
22 | #define DEFAULT_DATA_HASH_TABLE_SIZE (2047ULL*sizeof(HashItem)) | ||
23 | #define DEFAULT_FIELD_HASH_TABLE_SIZE (333ULL*sizeof(HashItem)) | ||
24 | |||
25 | @@ -314,7 +316,7 @@ static int journal_file_verify_header(JournalFile *f) { | ||
26 | |||
27 | static int journal_file_allocate(JournalFile *f, uint64_t offset, uint64_t size) { | ||
28 | uint64_t old_size, new_size; | ||
29 | - int r; | ||
30 | + int r = 0; | ||
31 | |||
32 | assert(f); | ||
33 | |||
34 | @@ -362,9 +364,21 @@ static int journal_file_allocate(JournalFile *f, uint64_t offset, uint64_t size) | ||
35 | /* Note that the glibc fallocate() fallback is very | ||
36 | inefficient, hence we try to minimize the allocation area | ||
37 | as we can. */ | ||
38 | +#ifdef HAVE_POSIX_FALLOCATE | ||
39 | r = posix_fallocate(f->fd, old_size, new_size - old_size); | ||
40 | if (r != 0) | ||
41 | return -r; | ||
42 | +#else | ||
43 | + /* Write something every 512 bytes to make sure the block is allocated */ | ||
44 | + uint64_t len = new_size - old_size; | ||
45 | + uint64_t offset = old_size; | ||
46 | + for (offset += (len-1) % 512; len > 0; offset += 512) { | ||
47 | + len -= 512; | ||
48 | + if (pwrite(f->fd, "", 1, offset) != 1) | ||
49 | + return -errno; | ||
50 | + } | ||
51 | + | ||
52 | +#endif /* HAVE_POSIX_FALLOCATE */ | ||
53 | |||
54 | if (fstat(f->fd, &f->last_stat) < 0) | ||
55 | return -errno; | ||
56 | diff --git a/src/journal/journald-kmsg.c b/src/journal/journald-kmsg.c | ||
57 | index 12992e7..dc4fa93 100644 | ||
58 | --- a/src/journal/journald-kmsg.c | ||
59 | +++ b/src/journal/journald-kmsg.c | ||
60 | @@ -437,6 +437,7 @@ fail: | ||
61 | int server_open_kernel_seqnum(Server *s) { | ||
62 | _cleanup_close_ int fd; | ||
63 | uint64_t *p; | ||
64 | + int r = 0; | ||
65 | |||
66 | assert(s); | ||
67 | |||
68 | @@ -449,8 +450,19 @@ int server_open_kernel_seqnum(Server *s) { | ||
69 | log_error("Failed to open /run/systemd/journal/kernel-seqnum, ignoring: %m"); | ||
70 | return 0; | ||
71 | } | ||
72 | - | ||
73 | - if (posix_fallocate(fd, 0, sizeof(uint64_t)) < 0) { | ||
74 | +#ifdef HAVE_POSIX_FALLOCATE | ||
75 | + r = posix_fallocate(fd, 0, sizeof(uint64_t)); | ||
76 | +#else | ||
77 | + /* Use good old method to write zeros into the journal file | ||
78 | + perhaps very inefficient yet working. */ | ||
79 | + char *buf = alloca(sizeof(uint64_t)); | ||
80 | + off_t oldpos = lseek(fd, 0, SEEK_CUR); | ||
81 | + bzero(buf, sizeof(uint64_t)); | ||
82 | + lseek(fd, 0, SEEK_SET); | ||
83 | + r = write(fd, buf, sizeof(uint64_t)); | ||
84 | + lseek(fd, oldpos, SEEK_SET); | ||
85 | +#endif /* HAVE_POSIX_FALLOCATE */ | ||
86 | + if (r < 0) { | ||
87 | log_error("Failed to allocate sequential number file, ignoring: %m"); | ||
88 | return 0; | ||
89 | } | ||
90 | -- | ||
91 | 1.7.9.5 | ||
92 | |||
diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-fix-getty-unit.patch b/meta/recipes-core/systemd/systemd/systemd-pam-fix-getty-unit.patch new file mode 100644 index 0000000000..9b4c940984 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-getty-unit.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | Prefer getty to agetty in console setup systemd units | ||
2 | |||
3 | Upstream-Status: Inappropriate [configuration specific] | ||
4 | Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> | ||
5 | --- | ||
6 | units/getty@.service.m4 | 2 +- | ||
7 | units/serial-getty@.service.m4 | 2 +- | ||
8 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
9 | |||
10 | Index: git/units/getty@.service.m4 | ||
11 | =================================================================== | ||
12 | --- git.orig/units/getty@.service.m4 2014-03-15 08:16:17.000000000 -0700 | ||
13 | +++ git/units/getty@.service.m4 2014-03-15 08:21:11.007695825 -0700 | ||
14 | @@ -27,7 +27,7 @@ | ||
15 | |||
16 | [Service] | ||
17 | # the VT is cleared by TTYVTDisallocate | ||
18 | -ExecStart=-/sbin/agetty --noclear %I $TERM | ||
19 | +ExecStart=-/sbin/getty -L %I $TERM | ||
20 | Type=idle | ||
21 | Restart=always | ||
22 | RestartSec=0 | ||
23 | Index: git/units/serial-getty@.service.m4 | ||
24 | =================================================================== | ||
25 | --- git.orig/units/serial-getty@.service.m4 2014-03-15 08:16:17.000000000 -0700 | ||
26 | +++ git/units/serial-getty@.service.m4 2014-03-15 08:22:31.291697331 -0700 | ||
27 | @@ -22,7 +22,7 @@ | ||
28 | IgnoreOnIsolate=yes | ||
29 | |||
30 | [Service] | ||
31 | -ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 %I $TERM | ||
32 | +ExecStart=-/sbin/getty -L 115200 %I $TERM | ||
33 | Type=idle | ||
34 | Restart=always | ||
35 | RestartSec=0 | ||
diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch b/meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch new file mode 100644 index 0000000000..8c7aa072da --- /dev/null +++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | Upstream-Status: Denied [no desire for uclibc support] | ||
2 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
3 | |||
4 | Index: git/src/shared/util.c | ||
5 | =================================================================== | ||
6 | --- git.orig/src/shared/util.c 2014-03-15 15:14:21.368160908 -0700 | ||
7 | +++ git/src/shared/util.c 2014-03-15 15:44:21.988194688 -0700 | ||
8 | @@ -85,6 +85,8 @@ | ||
9 | #include "def.h" | ||
10 | #include "missing.h" | ||
11 | |||
12 | +#include "config.h" | ||
13 | + | ||
14 | int saved_argc = 0; | ||
15 | char **saved_argv = NULL; | ||
16 | |||
17 | @@ -6222,7 +6224,13 @@ | ||
18 | |||
19 | u = umask(077); | ||
20 | |||
21 | +#ifdef HAVE_MKOSTEMP | ||
22 | fd = mkostemp(pattern, flags); | ||
23 | +#else | ||
24 | + fd = mkstemp(pattern); | ||
25 | + if (fd >= 0) fcntl(fd, F_SETFD, flags); | ||
26 | +#endif /* HAVE_MKOSTEMP */ | ||
27 | + | ||
28 | if (fd < 0) | ||
29 | return -errno; | ||
30 | |||
diff --git a/meta/recipes-core/systemd/systemd/touchscreen.rules b/meta/recipes-core/systemd/systemd/touchscreen.rules new file mode 100644 index 0000000000..d83fd1673d --- /dev/null +++ b/meta/recipes-core/systemd/systemd/touchscreen.rules | |||
@@ -0,0 +1,18 @@ | |||
1 | # There are a number of modifiers that are allowed to be used in some | ||
2 | # of the different fields. They provide the following subsitutions: | ||
3 | # | ||
4 | # %n the "kernel number" of the device. | ||
5 | # For example, 'sda3' has a "kernel number" of '3' | ||
6 | # %e the smallest number for that name which does not matches an existing node | ||
7 | # %k the kernel name for the device | ||
8 | # %M the kernel major number for the device | ||
9 | # %m the kernel minor number for the device | ||
10 | # %b the bus id for the device | ||
11 | # %c the string returned by the PROGRAM | ||
12 | # %s{filename} the content of a sysfs attribute | ||
13 | # %% the '%' char itself | ||
14 | # | ||
15 | |||
16 | # Create a symlink to any touchscreen input device | ||
17 | SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0*,3,*a0,1,*18,*", SYMLINK+="input/touchscreen0" | ||
18 | SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="ads7846", SYMLINK+="input/touchscreen0" | ||
diff --git a/meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch b/meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch new file mode 100644 index 0000000000..39dfc9e2ea --- /dev/null +++ b/meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | bypass unimplemented _SC_PHYS_PAGES system configuration API in uclibc | ||
2 | |||
3 | Upstream-Status: Inappropriate [uclibc-specific] | ||
4 | |||
5 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
6 | |||
7 | Index: git/src/shared/util.c | ||
8 | =================================================================== | ||
9 | --- git.orig/src/shared/util.c 2014-03-15 18:09:34.796358146 -0700 | ||
10 | +++ git/src/shared/util.c 2014-03-15 20:16:33.836501084 -0700 | ||
11 | @@ -6332,11 +6332,24 @@ | ||
12 | |||
13 | /* We return this as uint64_t in case we are running as 32bit | ||
14 | * process on a 64bit kernel with huge amounts of memory */ | ||
15 | - | ||
16 | +#ifdef __UCLIBC__ | ||
17 | + char line[128]; | ||
18 | + FILE *f = fopen("/proc/meminfo", "r"); | ||
19 | + if (f == NULL) | ||
20 | + return 0; | ||
21 | + while (!feof(f) && fgets(line, sizeof(line)-1, f)) { | ||
22 | + if (sscanf(line, "MemTotal: %l kB", &mem) == 1) { | ||
23 | + mem *= 1024; | ||
24 | + break; | ||
25 | + } | ||
26 | + } | ||
27 | + fclose(f); | ||
28 | + return (uint64_t) mem; | ||
29 | +#else | ||
30 | mem = sysconf(_SC_PHYS_PAGES); | ||
31 | assert(mem > 0); | ||
32 | - | ||
33 | return (uint64_t) mem * (uint64_t) page_size(); | ||
34 | +#endif | ||
35 | } | ||
36 | |||
37 | char* mount_test_option(const char *haystack, const char *needle) { | ||
diff --git a/meta/recipes-core/systemd/systemd/uclibc-sysinfo_h.patch b/meta/recipes-core/systemd/systemd/uclibc-sysinfo_h.patch new file mode 100644 index 0000000000..15645dee11 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/uclibc-sysinfo_h.patch | |||
@@ -0,0 +1,19 @@ | |||
1 | Dont include sys/sysinfo.h on uclibc it conflicts with linux/sysinfo.h | ||
2 | |||
3 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
4 | Upstream-Status: Inappropriate [uclibc specific] | ||
5 | |||
6 | Index: systemd-209/src/readahead/readahead-common.c | ||
7 | =================================================================== | ||
8 | --- systemd-209.orig/src/readahead/readahead-common.c 2014-02-12 18:42:33.810685053 -0800 | ||
9 | +++ systemd-209/src/readahead/readahead-common.c 2014-02-19 23:49:31.856661142 -0800 | ||
10 | @@ -22,7 +22,9 @@ | ||
11 | #include <errno.h> | ||
12 | #include <stdlib.h> | ||
13 | #include <string.h> | ||
14 | +#ifndef __UCLIBC__ | ||
15 | #include <sys/sysinfo.h> | ||
16 | +#endif | ||
17 | #include <sys/inotify.h> | ||
18 | #include <fcntl.h> | ||
19 | #include <sys/mman.h> | ||
diff --git a/meta/recipes-core/systemd/systemd_216.bb b/meta/recipes-core/systemd/systemd_216.bb new file mode 100644 index 0000000000..1eb401988e --- /dev/null +++ b/meta/recipes-core/systemd/systemd_216.bb | |||
@@ -0,0 +1,392 @@ | |||
1 | SUMMARY = "System and service manager for Linux, replacing SysVinit" | ||
2 | HOMEPAGE = "http://www.freedesktop.org/wiki/Software/systemd" | ||
3 | |||
4 | LICENSE = "GPLv2 & LGPLv2.1 & MIT" | ||
5 | LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe \ | ||
6 | file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c \ | ||
7 | file://LICENSE.MIT;md5=544799d0b492f119fa04641d1b8868ed" | ||
8 | |||
9 | PROVIDES = "udev" | ||
10 | |||
11 | PE = "1" | ||
12 | |||
13 | DEPENDS = "kmod docbook-sgml-dtd-4.1-native intltool-native gperf-native acl readline dbus libcap libcgroup glib-2.0 qemu-native util-linux" | ||
14 | DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" | ||
15 | |||
16 | SECTION = "base/shell" | ||
17 | |||
18 | inherit gtk-doc useradd pkgconfig autotools perlnative update-rc.d update-alternatives qemu systemd ptest gettext | ||
19 | |||
20 | SRCREV = "5d0ae62c665262c4c55536457e84e278c252cc0b" | ||
21 | |||
22 | PV = "216+git${SRCPV}" | ||
23 | |||
24 | SRC_URI = "git://anongit.freedesktop.org/systemd/systemd;branch=master;protocol=git \ | ||
25 | file://binfmt-install.patch \ | ||
26 | file://systemd-pam-configure-check-uclibc.patch \ | ||
27 | file://systemd-pam-fix-execvpe.patch \ | ||
28 | file://systemd-pam-fix-fallocate.patch \ | ||
29 | file://systemd-pam-fix-mkostemp.patch \ | ||
30 | file://optional_secure_getenv.patch \ | ||
31 | file://uclibc-sysinfo_h.patch \ | ||
32 | file://uclibc-get-physmem.patch \ | ||
33 | file://0001-add-support-for-executing-scripts-under-etc-rcS.d.patch \ | ||
34 | file://0001-missing.h-add-fake-__NR_memfd_create-for-MIPS.patch \ | ||
35 | file://0001-Make-root-s-home-directory-configurable.patch \ | ||
36 | file://0001-systemd-user-avoid-using-system-auth.patch \ | ||
37 | file://0001-journal-Fix-navigating-backwards-missing-entries.patch \ | ||
38 | file://0001-tmpfiles-make-resolv.conf-entry-conditional-on-resol.patch \ | ||
39 | file://0001-build-sys-do-not-install-tmpfiles-and-sysusers-files.patch \ | ||
40 | file://0001-build-sys-configure-the-list-of-system-users-files-a.patch \ | ||
41 | file://touchscreen.rules \ | ||
42 | file://00-create-volatile.conf \ | ||
43 | file://init \ | ||
44 | file://run-ptest \ | ||
45 | " | ||
46 | |||
47 | S = "${WORKDIR}/git" | ||
48 | |||
49 | SRC_URI_append_libc-uclibc = "\ | ||
50 | file://systemd-pam-fix-getty-unit.patch \ | ||
51 | " | ||
52 | LDFLAGS_append_libc-uclibc = " -lrt" | ||
53 | |||
54 | GTKDOC_DOCDIR = "${S}/docs/" | ||
55 | |||
56 | PACKAGECONFIG ??= "xz" | ||
57 | PACKAGECONFIG[journal-upload] = "--enable-libcurl,--disable-libcurl,curl" | ||
58 | # Sign the journal for anti-tampering | ||
59 | PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt" | ||
60 | # regardless of PACKAGECONFIG, libgcrypt is always required to expand | ||
61 | # the AM_PATH_LIBGCRYPT autoconf macro | ||
62 | DEPENDS += "libgcrypt" | ||
63 | # Compress the journal | ||
64 | PACKAGECONFIG[xz] = "--enable-xz,--disable-xz,xz" | ||
65 | PACKAGECONFIG[cryptsetup] = "--enable-libcryptsetup,--disable-libcryptsetup,cryptsetup" | ||
66 | PACKAGECONFIG[microhttpd] = "--enable-microhttpd,--disable-microhttpd,libmicrohttpd" | ||
67 | PACKAGECONFIG[elfutils] = "--enable-elfutils,--disable-elfutils,elfutils" | ||
68 | PACKAGECONFIG[resolved] = "--enable-resolved,--disable-resolved" | ||
69 | PACKAGECONFIG[networkd] = "--enable-networkd,--disable-networkd" | ||
70 | PACKAGECONFIG[libidn] = "--enable-libidn,--disable-libidn,libidn" | ||
71 | PACKAGECONFIG[audit] = "--enable-audit,--disable-audit,audit" | ||
72 | |||
73 | CACHED_CONFIGUREVARS = "ac_cv_path_KILL=${base_bindir}/kill" | ||
74 | |||
75 | # Helper variables to clarify locations. This mirrors the logic in systemd's | ||
76 | # build system. | ||
77 | rootprefix ?= "${base_prefix}" | ||
78 | rootlibdir ?= "${base_libdir}" | ||
79 | rootlibexecdir = "${rootprefix}/lib" | ||
80 | |||
81 | # The gtk+ tools should get built as a separate recipe e.g. systemd-tools | ||
82 | EXTRA_OECONF = " --with-rootprefix=${rootprefix} \ | ||
83 | --with-rootlibdir=${rootlibdir} \ | ||
84 | --with-roothomedir=${ROOT_HOME} \ | ||
85 | ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)} \ | ||
86 | --disable-manpages \ | ||
87 | --disable-coredump \ | ||
88 | --disable-introspection \ | ||
89 | --disable-kdbus \ | ||
90 | --enable-split-usr \ | ||
91 | --without-python \ | ||
92 | --with-sysvrcnd-path=${sysconfdir} \ | ||
93 | --with-firmware-path=/lib/firmware \ | ||
94 | ac_cv_path_KILL=${base_bindir}/kill \ | ||
95 | " | ||
96 | # uclibc does not have NSS | ||
97 | EXTRA_OECONF_append_libc-uclibc = " --disable-myhostname " | ||
98 | |||
99 | do_configure_prepend() { | ||
100 | export CPP="${HOST_PREFIX}cpp ${TOOLCHAIN_OPTIONS} ${HOST_CC_ARCH}" | ||
101 | export NM="${HOST_PREFIX}gcc-nm" | ||
102 | export AR="${HOST_PREFIX}gcc-ar" | ||
103 | export RANLIB="${HOST_PREFIX}gcc-ranlib" | ||
104 | export KMOD="${base_bindir}/kmod" | ||
105 | if [ -d ${S}/units.pre_sed ] ; then | ||
106 | cp -r ${S}/units.pre_sed ${S}/units | ||
107 | else | ||
108 | cp -r ${S}/units ${S}/units.pre_sed | ||
109 | fi | ||
110 | sed -i '/ln --relative --help/d' ${S}/configure.ac | ||
111 | sed -i -e 's:\$(LN_S) --relative -f:lnr:g' ${S}/Makefile.am | ||
112 | sed -i -e 's:\$(LN_S) --relative:lnr:g' ${S}/Makefile.am | ||
113 | } | ||
114 | |||
115 | do_install() { | ||
116 | autotools_do_install | ||
117 | install -d ${D}/${base_sbindir} | ||
118 | # Provided by a separate recipe | ||
119 | rm ${D}${systemd_unitdir}/system/serial-getty* -f | ||
120 | |||
121 | # Provide support for initramfs | ||
122 | [ ! -e ${D}/init ] && ln -s ${rootlibexecdir}/systemd/systemd ${D}/init | ||
123 | [ ! -e ${D}/${base_sbindir}/udevd ] && ln -s ${rootlibexecdir}/systemd/systemd-udevd ${D}/${base_sbindir}/udevd | ||
124 | |||
125 | # Create machine-id | ||
126 | # 20:12 < mezcalero> koen: you have three options: a) run systemd-machine-id-setup at install time, b) have / read-only and an empty file there (for stateless) and c) boot with / writable | ||
127 | touch ${D}${sysconfdir}/machine-id | ||
128 | |||
129 | install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/ | ||
130 | |||
131 | install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/ | ||
132 | |||
133 | if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then | ||
134 | install -d ${D}${sysconfdir}/init.d | ||
135 | install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd | ||
136 | sed -i s%@UDEVD@%${rootlibexecdir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd | ||
137 | fi | ||
138 | |||
139 | chown root:systemd-journal ${D}/${localstatedir}/log/journal | ||
140 | |||
141 | # Delete journal README, as log can be symlinked inside volatile. | ||
142 | rm -f ${D}/${localstatedir}/log/README | ||
143 | |||
144 | # Create symlinks for systemd-update-utmp-runlevel.service | ||
145 | install -d ${D}${systemd_unitdir}/system/graphical.target.wants | ||
146 | install -d ${D}${systemd_unitdir}/system/multi-user.target.wants | ||
147 | install -d ${D}${systemd_unitdir}/system/poweroff.target.wants | ||
148 | install -d ${D}${systemd_unitdir}/system/reboot.target.wants | ||
149 | install -d ${D}${systemd_unitdir}/system/rescue.target.wants | ||
150 | ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/graphical.target.wants/systemd-update-utmp-runlevel.service | ||
151 | ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/multi-user.target.wants/systemd-update-utmp-runlevel.service | ||
152 | ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/poweroff.target.wants/systemd-update-utmp-runlevel.service | ||
153 | ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/reboot.target.wants/systemd-update-utmp-runlevel.service | ||
154 | ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/rescue.target.wants/systemd-update-utmp-runlevel.service | ||
155 | |||
156 | # Enable journal to forward message to syslog daemon | ||
157 | sed -i -e 's/.*ForwardToSyslog.*/ForwardToSyslog=yes/' ${D}${sysconfdir}/systemd/journald.conf | ||
158 | # its needed in 216 upstream has fixed it with 919699ec301ea507edce4a619141ed22e789ac0d | ||
159 | # don't order journal flushing afte remote-fs.target | ||
160 | sed -i -e 's/ remote-fs.target$//' ${D}${systemd_unitdir}/system/systemd-journal-flush.service | ||
161 | # this file is needed to exist if networkd is disabled but timesyncd is still in use since timesyncd checks it | ||
162 | # for existence else it fails | ||
163 | ${@bb.utils.contains('PACKAGECONFIG', 'networkd', '', 'sed -i -e "\$ad /run/systemd/netif/links 0755 root root -" ${D}${libdir}/tmpfiles.d/systemd.conf', d)} | ||
164 | } | ||
165 | |||
166 | do_install_ptest () { | ||
167 | install -d ${D}${PTEST_PATH}/test | ||
168 | cp -rf ${S}/test/* ${D}${PTEST_PATH}/test | ||
169 | install -m 0755 ${B}/test-udev ${D}${PTEST_PATH}/ | ||
170 | install -d ${D}${PTEST_PATH}/build-aux | ||
171 | cp ${S}/build-aux/test-driver ${D}${PTEST_PATH}/build-aux/ | ||
172 | cp -rf ${B}/rules ${D}${PTEST_PATH}/ | ||
173 | # This directory needs to be there for udev-test.pl to work. | ||
174 | install -d ${D}${libdir}/udev/rules.d | ||
175 | cp ${B}/Makefile ${D}${PTEST_PATH}/ | ||
176 | cp ${S}/test/sys.tar.xz ${D}${PTEST_PATH}/test | ||
177 | sed -i 's/"tree"/"ls"/' ${D}${PTEST_PATH}/test/udev-test.pl | ||
178 | sed -i 's#${S}#${PTEST_PATH}#g' ${D}${PTEST_PATH}/Makefile | ||
179 | sed -i 's#${B}#${PTEST_PATH}#g' ${D}${PTEST_PATH}/Makefile | ||
180 | } | ||
181 | |||
182 | python populate_packages_prepend (){ | ||
183 | systemdlibdir = d.getVar("rootlibdir", True) | ||
184 | do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True) | ||
185 | } | ||
186 | PACKAGES_DYNAMIC += "^lib(udev|systemd).*" | ||
187 | |||
188 | PACKAGES =+ "${PN}-gui ${PN}-vconsole-setup ${PN}-initramfs ${PN}-analyze ${PN}-kernel-install \ | ||
189 | ${PN}-rpm-macros ${PN}-binfmt ${PN}-pam ${PN}-zsh libgudev" | ||
190 | |||
191 | SYSTEMD_PACKAGES = "${PN}-binfmt" | ||
192 | SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service" | ||
193 | |||
194 | USERADD_PACKAGES = "${PN}" | ||
195 | USERADD_PARAM_${PN} += "--system systemd-journal-gateway; --system systemd-timesync" | ||
196 | GROUPADD_PARAM_${PN} = "-r lock; -r systemd-journal" | ||
197 | |||
198 | FILES_${PN}-analyze = "${bindir}/systemd-analyze" | ||
199 | |||
200 | FILES_${PN}-initramfs = "/init" | ||
201 | RDEPENDS_${PN}-initramfs = "${PN}" | ||
202 | |||
203 | FILES_libgudev = "${libdir}/libgudev*${SOLIBS}" | ||
204 | |||
205 | RDEPENDS_${PN}-ptest += "perl python bash" | ||
206 | FILES_${PN}-ptest += "${libdir}/udev/rules.d" | ||
207 | |||
208 | FILES_${PN}-dbg += "${libdir}/systemd/ptest/.debug" | ||
209 | |||
210 | FILES_${PN}-gui = "${bindir}/systemadm" | ||
211 | |||
212 | FILES_${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \ | ||
213 | ${systemd_unitdir}/system/systemd-vconsole-setup.service \ | ||
214 | ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service" | ||
215 | |||
216 | RDEPENDS_${PN}-kernel-install += "bash" | ||
217 | FILES_${PN}-kernel-install = "${bindir}/kernel-install \ | ||
218 | ${sysconfdir}/kernel/ \ | ||
219 | ${exec_prefix}/lib/kernel \ | ||
220 | " | ||
221 | FILES_${PN}-rpm-macros = "${exec_prefix}/lib/rpm \ | ||
222 | " | ||
223 | |||
224 | FILES_${PN}-zsh = "${datadir}/zsh/site-functions" | ||
225 | |||
226 | FILES_${PN}-binfmt = "${sysconfdir}/binfmt.d/ \ | ||
227 | ${exec_prefix}/lib/binfmt.d \ | ||
228 | ${rootlibexecdir}/systemd/systemd-binfmt \ | ||
229 | ${systemd_unitdir}/system/proc-sys-fs-binfmt_misc.* \ | ||
230 | ${systemd_unitdir}/system/systemd-binfmt.service" | ||
231 | RRECOMMENDS_${PN}-binfmt = "kernel-module-binfmt-misc" | ||
232 | |||
233 | RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts kbd-keymaps" | ||
234 | |||
235 | CONFFILES_${PN} = "${sysconfdir}/systemd/journald.conf \ | ||
236 | ${sysconfdir}/systemd/logind.conf \ | ||
237 | ${sysconfdir}/systemd/system.conf \ | ||
238 | ${sysconfdir}/systemd/user.conf" | ||
239 | |||
240 | FILES_${PN} = " ${base_bindir}/* \ | ||
241 | ${datadir}/bash-completion \ | ||
242 | ${datadir}/dbus-1/services \ | ||
243 | ${datadir}/dbus-1/system-services \ | ||
244 | ${datadir}/polkit-1 \ | ||
245 | ${datadir}/${BPN} \ | ||
246 | ${datadir}/factory \ | ||
247 | ${sysconfdir}/bash_completion.d/ \ | ||
248 | ${sysconfdir}/dbus-1/ \ | ||
249 | ${sysconfdir}/machine-id \ | ||
250 | ${sysconfdir}/modules-load.d/ \ | ||
251 | ${sysconfdir}/sysctl.d/ \ | ||
252 | ${sysconfdir}/systemd/ \ | ||
253 | ${sysconfdir}/tmpfiles.d/ \ | ||
254 | ${sysconfdir}/xdg/ \ | ||
255 | ${sysconfdir}/init.d/README \ | ||
256 | ${rootlibexecdir}/systemd/* \ | ||
257 | ${systemd_unitdir}/* \ | ||
258 | ${base_libdir}/security/*.so \ | ||
259 | ${libdir}/libnss_* \ | ||
260 | /cgroup \ | ||
261 | ${bindir}/systemd* \ | ||
262 | ${bindir}/busctl \ | ||
263 | ${bindir}/localectl \ | ||
264 | ${bindir}/hostnamectl \ | ||
265 | ${bindir}/timedatectl \ | ||
266 | ${bindir}/bootctl \ | ||
267 | ${bindir}/kernel-install \ | ||
268 | ${exec_prefix}/lib/tmpfiles.d/*.conf \ | ||
269 | ${exec_prefix}/lib/systemd \ | ||
270 | ${exec_prefix}/lib/modules-load.d \ | ||
271 | ${exec_prefix}/lib/sysctl.d \ | ||
272 | ${exec_prefix}/lib/sysusers.d \ | ||
273 | ${localstatedir} \ | ||
274 | /lib/udev/rules.d/70-uaccess.rules \ | ||
275 | /lib/udev/rules.d/71-seat.rules \ | ||
276 | /lib/udev/rules.d/73-seat-late.rules \ | ||
277 | /lib/udev/rules.d/99-systemd.rules \ | ||
278 | ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${sysconfdir}/pam.d', '', d)} \ | ||
279 | " | ||
280 | |||
281 | FILES_${PN}-dbg += "${rootlibdir}/.debug ${systemd_unitdir}/.debug ${systemd_unitdir}/*/.debug ${base_libdir}/security/.debug/" | ||
282 | FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd" | ||
283 | |||
284 | RDEPENDS_${PN} += "kmod dbus util-linux-mount udev (= ${EXTENDPKGV})" | ||
285 | RDEPENDS_${PN} += "volatile-binds" | ||
286 | |||
287 | RRECOMMENDS_${PN} += "systemd-serialgetty systemd-compat-units udev-hwdb\ | ||
288 | util-linux-agetty \ | ||
289 | util-linux-fsck e2fsprogs-e2fsck \ | ||
290 | kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 os-release \ | ||
291 | " | ||
292 | |||
293 | PACKAGES =+ "udev-dbg udev udev-hwdb" | ||
294 | |||
295 | FILES_udev-dbg += "/lib/udev/.debug" | ||
296 | |||
297 | RPROVIDES_udev = "hotplug" | ||
298 | |||
299 | RDEPENDS_udev-hwdb += "udev" | ||
300 | |||
301 | FILES_udev += "${base_sbindir}/udevd \ | ||
302 | ${rootlibexecdir}/systemd/systemd-udevd \ | ||
303 | ${rootlibexecdir}/udev/accelerometer \ | ||
304 | ${rootlibexecdir}/udev/ata_id \ | ||
305 | ${rootlibexecdir}/udev/cdrom_id \ | ||
306 | ${rootlibexecdir}/udev/collect \ | ||
307 | ${rootlibexecdir}/udev/findkeyboards \ | ||
308 | ${rootlibexecdir}/udev/keyboard-force-release.sh \ | ||
309 | ${rootlibexecdir}/udev/keymap \ | ||
310 | ${rootlibexecdir}/udev/mtd_probe \ | ||
311 | ${rootlibexecdir}/udev/scsi_id \ | ||
312 | ${rootlibexecdir}/udev/v4l_id \ | ||
313 | ${rootlibexecdir}/udev/keymaps \ | ||
314 | ${rootlibexecdir}/udev/rules.d/4*.rules \ | ||
315 | ${rootlibexecdir}/udev/rules.d/5*.rules \ | ||
316 | ${rootlibexecdir}/udev/rules.d/6*.rules \ | ||
317 | ${rootlibexecdir}/udev/rules.d/70-power-switch.rules \ | ||
318 | ${rootlibexecdir}/udev/rules.d/75*.rules \ | ||
319 | ${rootlibexecdir}/udev/rules.d/78*.rules \ | ||
320 | ${rootlibexecdir}/udev/rules.d/8*.rules \ | ||
321 | ${rootlibexecdir}/udev/rules.d/95*.rules \ | ||
322 | ${sysconfdir}/udev \ | ||
323 | ${sysconfdir}/init.d/systemd-udevd \ | ||
324 | ${systemd_unitdir}/system/*udev* \ | ||
325 | ${systemd_unitdir}/system/*.wants/*udev* \ | ||
326 | ${base_bindir}/udevadm \ | ||
327 | ${datadir}/bash-completion/completions/udevadm \ | ||
328 | " | ||
329 | |||
330 | FILES_udev-hwdb = "${rootlibexecdir}/udev/hwdb.d" | ||
331 | |||
332 | INITSCRIPT_PACKAGES = "udev" | ||
333 | INITSCRIPT_NAME_udev = "systemd-udevd" | ||
334 | INITSCRIPT_PARAMS_udev = "start 03 S ." | ||
335 | |||
336 | python __anonymous() { | ||
337 | if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): | ||
338 | d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") | ||
339 | } | ||
340 | |||
341 | # TODO: | ||
342 | # u-a for runlevel and telinit | ||
343 | |||
344 | ALTERNATIVE_${PN} = "init halt reboot shutdown poweroff runlevel" | ||
345 | |||
346 | ALTERNATIVE_TARGET[init] = "${rootlibexecdir}/systemd/systemd" | ||
347 | ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init" | ||
348 | ALTERNATIVE_PRIORITY[init] ?= "300" | ||
349 | |||
350 | ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl" | ||
351 | ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt" | ||
352 | ALTERNATIVE_PRIORITY[halt] ?= "300" | ||
353 | |||
354 | ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl" | ||
355 | ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot" | ||
356 | ALTERNATIVE_PRIORITY[reboot] ?= "300" | ||
357 | |||
358 | ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl" | ||
359 | ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown" | ||
360 | ALTERNATIVE_PRIORITY[shutdown] ?= "300" | ||
361 | |||
362 | ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl" | ||
363 | ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff" | ||
364 | ALTERNATIVE_PRIORITY[poweroff] ?= "300" | ||
365 | |||
366 | ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl" | ||
367 | ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel" | ||
368 | ALTERNATIVE_PRIORITY[runlevel] ?= "300" | ||
369 | |||
370 | pkg_postinst_udev-hwdb () { | ||
371 | if test -n "$D"; then | ||
372 | ${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')} hwdb --update \ | ||
373 | --root $D | ||
374 | else | ||
375 | udevadm hwdb --update | ||
376 | fi | ||
377 | } | ||
378 | |||
379 | pkg_prerm_udev-hwdb () { | ||
380 | if test -n "$D"; then | ||
381 | exit 1 | ||
382 | fi | ||
383 | |||
384 | rm -f ${sysconfdir}/udev/hwdb.bin | ||
385 | } | ||
386 | |||
387 | # As this recipe builds udev, respect systemd being in DISTRO_FEATURES so | ||
388 | # that we don't build both udev and systemd in world builds. | ||
389 | python () { | ||
390 | if not bb.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d): | ||
391 | raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES") | ||
392 | } | ||