diff options
author | Alexander Kanavin <alexander.kanavin@linux.intel.com> | 2017-08-02 18:27:31 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-08-13 09:27:37 +0100 |
commit | f06f9f3c893db8485bd4e6a76d4fb8cd51b38ec9 (patch) | |
tree | 4c446d468d01ce58e4799b3260d020442a6b7e38 /meta/recipes-core/systemd/systemd_234.bb | |
parent | 42ffbda12430a29f6778d6626e9defd75783f85d (diff) | |
download | poky-f06f9f3c893db8485bd4e6a76d4fb8cd51b38ec9.tar.gz |
systemd: update to 234
The new version fixes gperf 3.1 issues, so the update is included
in this patchset.
Modified patches are all rebases to the new version.
Deleted patches are backports, except 0016-make-test-dir-configurable.patch
which is obsolete in the new version (TEST_DIR define is no longer used anywhere).
--with-testdir is removed from configure for the same reason.
(From OE-Core rev: 34afb46f75d6c356f23f70c5ece96e45594e1546)
Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/systemd/systemd_234.bb')
-rw-r--r-- | meta/recipes-core/systemd/systemd_234.bb | 609 |
1 files changed, 609 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd_234.bb b/meta/recipes-core/systemd/systemd_234.bb new file mode 100644 index 0000000000..ad7fc99b90 --- /dev/null +++ b/meta/recipes-core/systemd/systemd_234.bb | |||
@@ -0,0 +1,609 @@ | |||
1 | require systemd.inc | ||
2 | |||
3 | PROVIDES = "udev" | ||
4 | |||
5 | PE = "1" | ||
6 | |||
7 | DEPENDS = "kmod intltool-native gperf-native acl readline libcap libcgroup util-linux" | ||
8 | |||
9 | SECTION = "base/shell" | ||
10 | |||
11 | inherit useradd pkgconfig autotools perlnative update-rc.d update-alternatives qemu systemd ptest gettext bash-completion manpages | ||
12 | |||
13 | SRC_URI += " \ | ||
14 | file://touchscreen.rules \ | ||
15 | file://00-create-volatile.conf \ | ||
16 | file://init \ | ||
17 | file://run-ptest \ | ||
18 | file://0003-define-exp10-if-missing.patch \ | ||
19 | file://0004-Use-getenv-when-secure-versions-are-not-available.patch \ | ||
20 | file://0005-binfmt-Don-t-install-dependency-links-at-install-tim.patch \ | ||
21 | file://0007-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch \ | ||
22 | file://0010-implment-systemd-sysv-install-for-OE.patch \ | ||
23 | file://0011-nss-mymachines-Build-conditionally-when-HAVE_MYHOSTN.patch \ | ||
24 | file://0012-rules-whitelist-hd-devices.patch \ | ||
25 | file://0013-Make-root-s-home-directory-configurable.patch \ | ||
26 | file://0014-Revert-rules-remove-firmware-loading-rules.patch \ | ||
27 | file://0015-Revert-udev-remove-userspace-firmware-loading-suppor.patch \ | ||
28 | file://0017-remove-duplicate-include-uchar.h.patch \ | ||
29 | file://0018-check-for-uchar.h-in-configure.patch \ | ||
30 | file://0019-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch \ | ||
31 | " | ||
32 | SRC_URI_append_qemuall = " file://0001-core-device.c-Change-the-default-device-timeout-to-2.patch" | ||
33 | |||
34 | PACKAGECONFIG ??= "xz \ | ||
35 | ${@bb.utils.filter('DISTRO_FEATURES', 'efi pam selinux ldconfig usrmerge', d)} \ | ||
36 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \ | ||
37 | ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \ | ||
38 | binfmt \ | ||
39 | randomseed \ | ||
40 | machined \ | ||
41 | backlight \ | ||
42 | vconsole \ | ||
43 | quotacheck \ | ||
44 | hostnamed \ | ||
45 | ${@bb.utils.contains('TCLIBC', 'glibc', 'myhostname sysusers', '', d)} \ | ||
46 | hibernate \ | ||
47 | timedated \ | ||
48 | timesyncd \ | ||
49 | localed \ | ||
50 | ima \ | ||
51 | smack \ | ||
52 | logind \ | ||
53 | firstboot \ | ||
54 | utmp \ | ||
55 | polkit \ | ||
56 | resolved \ | ||
57 | networkd \ | ||
58 | " | ||
59 | PACKAGECONFIG_remove_libc-musl = "selinux" | ||
60 | PACKAGECONFIG_remove_libc-musl = "smack" | ||
61 | |||
62 | # Use the upstream systemd serial-getty@.service and rely on | ||
63 | # systemd-getty-generator instead of using the OE-core specific | ||
64 | # systemd-serialgetty.bb - not enabled by default. | ||
65 | PACKAGECONFIG[serial-getty-generator] = "" | ||
66 | |||
67 | PACKAGECONFIG[journal-upload] = "--enable-libcurl,--disable-libcurl,curl" | ||
68 | # Sign the journal for anti-tampering | ||
69 | PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt" | ||
70 | PACKAGECONFIG[cryptsetup] = "--enable-libcryptsetup,--disable-libcryptsetup,cryptsetup" | ||
71 | PACKAGECONFIG[microhttpd] = "--enable-microhttpd,--disable-microhttpd,libmicrohttpd" | ||
72 | PACKAGECONFIG[elfutils] = "--enable-elfutils,--disable-elfutils,elfutils" | ||
73 | PACKAGECONFIG[resolved] = "--enable-resolved,--disable-resolved" | ||
74 | PACKAGECONFIG[networkd] = "--enable-networkd,--disable-networkd" | ||
75 | PACKAGECONFIG[machined] = "--enable-machined,--disable-machined" | ||
76 | PACKAGECONFIG[backlight] = "--enable-backlight,--disable-backlight" | ||
77 | PACKAGECONFIG[vconsole] = "--enable-vconsole,--disable-vconsole,,${PN}-vconsole-setup" | ||
78 | PACKAGECONFIG[quotacheck] = "--enable-quotacheck,--disable-quotacheck" | ||
79 | PACKAGECONFIG[hostnamed] = "--enable-hostnamed,--disable-hostnamed" | ||
80 | PACKAGECONFIG[myhostname] = "--enable-myhostname,--disable-myhostname" | ||
81 | PACKAGECONFIG[rfkill] = "--enable-rfkill,--disable-rfkill" | ||
82 | PACKAGECONFIG[hibernate] = "--enable-hibernate,--disable-hibernate" | ||
83 | PACKAGECONFIG[timedated] = "--enable-timedated,--disable-timedated" | ||
84 | PACKAGECONFIG[timesyncd] = "--enable-timesyncd,--disable-timesyncd" | ||
85 | PACKAGECONFIG[localed] = "--enable-localed,--disable-localed" | ||
86 | PACKAGECONFIG[efi] = "--enable-efi,--disable-efi" | ||
87 | PACKAGECONFIG[ima] = "--enable-ima,--disable-ima" | ||
88 | PACKAGECONFIG[smack] = "--enable-smack,--disable-smack" | ||
89 | # libseccomp is found in meta-security | ||
90 | PACKAGECONFIG[seccomp] = "--enable-seccomp,--disable-seccomp,libseccomp" | ||
91 | PACKAGECONFIG[logind] = "--enable-logind,--disable-logind" | ||
92 | PACKAGECONFIG[sysusers] = "--enable-sysusers,--disable-sysusers" | ||
93 | PACKAGECONFIG[firstboot] = "--enable-firstboot,--disable-firstboot" | ||
94 | PACKAGECONFIG[randomseed] = "--enable-randomseed,--disable-randomseed" | ||
95 | PACKAGECONFIG[binfmt] = "--enable-binfmt,--disable-binfmt" | ||
96 | PACKAGECONFIG[utmp] = "--enable-utmp,--disable-utmp" | ||
97 | PACKAGECONFIG[polkit] = "--enable-polkit,--disable-polkit" | ||
98 | # importd requires curl/xz/zlib/bzip2/gcrypt | ||
99 | PACKAGECONFIG[importd] = "--enable-importd,--disable-importd" | ||
100 | PACKAGECONFIG[libidn] = "--enable-libidn,--disable-libidn,libidn" | ||
101 | PACKAGECONFIG[audit] = "--enable-audit,--disable-audit,audit" | ||
102 | PACKAGECONFIG[manpages] = "--enable-manpages,--disable-manpages,libxslt-native xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native" | ||
103 | PACKAGECONFIG[pam] = "--enable-pam,--disable-pam,libpam" | ||
104 | # Verify keymaps on locale change | ||
105 | PACKAGECONFIG[xkbcommon] = "--enable-xkbcommon,--disable-xkbcommon,libxkbcommon" | ||
106 | # Update NAT firewall rules | ||
107 | PACKAGECONFIG[iptc] = "--enable-libiptc,--disable-libiptc,iptables" | ||
108 | PACKAGECONFIG[ldconfig] = "--enable-ldconfig,--disable-ldconfig,," | ||
109 | PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux" | ||
110 | PACKAGECONFIG[valgrind] = "ac_cv_header_valgrind_memcheck_h=yes ac_cv_header_valgrind_valgrind_h=yes ,ac_cv_header_valgrind_memcheck_h=no ac_cv_header_valgrind_valgrind_h=no ,valgrind" | ||
111 | PACKAGECONFIG[qrencode] = "--enable-qrencode,--disable-qrencode,qrencode" | ||
112 | PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus" | ||
113 | PACKAGECONFIG[coredump] = "--enable-coredump,--disable-coredump" | ||
114 | PACKAGECONFIG[bzip2] = "--enable-bzip2,--disable-bzip2,bzip2" | ||
115 | PACKAGECONFIG[lz4] = "--enable-lz4,--disable-lz4,lz4" | ||
116 | PACKAGECONFIG[xz] = "--enable-xz,--disable-xz,xz" | ||
117 | PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib" | ||
118 | PACKAGECONFIG[usrmerge] = "--disable-split-usr, --enable-split-usr" | ||
119 | |||
120 | CACHED_CONFIGUREVARS += "ac_cv_path_KILL=${base_bindir}/kill" | ||
121 | CACHED_CONFIGUREVARS += "ac_cv_path_KMOD=${base_bindir}/kmod" | ||
122 | CACHED_CONFIGUREVARS += "ac_cv_path_QUOTACHECK=${sbindir}/quotacheck" | ||
123 | CACHED_CONFIGUREVARS += "ac_cv_path_QUOTAON=${sbindir}/quotaon" | ||
124 | CACHED_CONFIGUREVARS += "ac_cv_path_SULOGIN=${base_sbindir}/sulogin" | ||
125 | |||
126 | # Helper variables to clarify locations. This mirrors the logic in systemd's | ||
127 | # build system. | ||
128 | rootprefix ?= "${root_prefix}" | ||
129 | rootlibdir ?= "${base_libdir}" | ||
130 | rootlibexecdir = "${rootprefix}/lib" | ||
131 | |||
132 | CACHED_CONFIGUREVARS_class-target = "\ | ||
133 | ac_cv_path_MOUNT_PATH=${base_bindir}/mount \ | ||
134 | ac_cv_path_UMOUNT_PATH=${base_bindir}/umount \ | ||
135 | ac_cv_path_KMOD=${base_bindir}/kmod \ | ||
136 | ac_cv_path_KILL=${base_bindir}/kill \ | ||
137 | ac_cv_path_SULOGIN=${base_sbindir}/sulogin \ | ||
138 | ac_cv_path_KEXEC=${sbindir}/kexec \ | ||
139 | ac_cv_path_QUOTACHECK=${sbindir}/quotacheck \ | ||
140 | ac_cv_path_QUOTAON=${sbindir}/quotaon \ | ||
141 | " | ||
142 | |||
143 | EXTRA_OECONF = " --with-rootprefix=${rootprefix} \ | ||
144 | --with-rootlibdir=${rootlibdir} \ | ||
145 | --with-roothomedir=${ROOT_HOME} \ | ||
146 | --without-python \ | ||
147 | --with-sysvrcnd-path=${sysconfdir} \ | ||
148 | --with-firmware-path=${nonarch_base_libdir}/firmware \ | ||
149 | " | ||
150 | # per the systemd README, define VALGRIND=1 to run under valgrind | ||
151 | CFLAGS .= "${@bb.utils.contains('PACKAGECONFIG', 'valgrind', ' -DVALGRIND=1', '', d)}" | ||
152 | |||
153 | # disable problematic GCC 5.2 optimizations [YOCTO #8291] | ||
154 | FULL_OPTIMIZATION_append_arm = " -fno-schedule-insns -fno-schedule-insns2" | ||
155 | |||
156 | # Avoid login failure on qemumips64 when pam is enabled | ||
157 | FULL_OPTIMIZATION_append_mips64 = " -fno-tree-switch-conversion -fno-tree-tail-merge" | ||
158 | |||
159 | COMPILER_NM ?= "${HOST_PREFIX}gcc-nm" | ||
160 | COMPILER_AR ?= "${HOST_PREFIX}gcc-ar" | ||
161 | COMPILER_RANLIB ?= "${HOST_PREFIX}gcc-ranlib" | ||
162 | |||
163 | do_configure_prepend() { | ||
164 | export NM="${COMPILER_NM}" | ||
165 | export AR="${COMPILER_AR}" | ||
166 | export RANLIB="${COMPILER_RANLIB}" | ||
167 | export KMOD="${base_bindir}/kmod" | ||
168 | if [ -d ${S}/units.pre_sed ] ; then | ||
169 | cp -r ${S}/units.pre_sed ${S}/units | ||
170 | else | ||
171 | cp -r ${S}/units ${S}/units.pre_sed | ||
172 | fi | ||
173 | sed -i -e 's:-DTEST_DIR=\\\".*\\\":-DTEST_DIR=\\\"${PTEST_PATH}/tests/test\\\":' ${S}/Makefile.am | ||
174 | sed -i -e 's:-DCATALOG_DIR=\\\".*\\\":-DCATALOG_DIR=\\\"${PTEST_PATH}/tests/catalog\\\":' ${S}/Makefile.am | ||
175 | } | ||
176 | |||
177 | do_install() { | ||
178 | autotools_do_install | ||
179 | install -d ${D}/${base_sbindir} | ||
180 | if ${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', 'false', 'true', d)}; then | ||
181 | # Provided by a separate recipe | ||
182 | rm ${D}${systemd_unitdir}/system/serial-getty* -f | ||
183 | fi | ||
184 | |||
185 | # Provide support for initramfs | ||
186 | [ ! -e ${D}/init ] && ln -s ${rootlibexecdir}/systemd/systemd ${D}/init | ||
187 | [ ! -e ${D}/${base_sbindir}/udevd ] && ln -s ${rootlibexecdir}/systemd/systemd-udevd ${D}/${base_sbindir}/udevd | ||
188 | |||
189 | # Create machine-id | ||
190 | # 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 | ||
191 | touch ${D}${sysconfdir}/machine-id | ||
192 | |||
193 | |||
194 | install -d ${D}${sysconfdir}/udev/rules.d/ | ||
195 | install -d ${D}${sysconfdir}/tmpfiles.d | ||
196 | install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/ | ||
197 | install -d ${D}${libdir}/pkgconfig | ||
198 | install -m 0644 ${B}/src/udev/udev.pc ${D}${libdir}/pkgconfig/ | ||
199 | |||
200 | install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/ | ||
201 | |||
202 | if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then | ||
203 | install -d ${D}${sysconfdir}/init.d | ||
204 | install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd | ||
205 | sed -i s%@UDEVD@%${rootlibexecdir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd | ||
206 | fi | ||
207 | |||
208 | chown root:systemd-journal ${D}/${localstatedir}/log/journal | ||
209 | |||
210 | # Delete journal README, as log can be symlinked inside volatile. | ||
211 | rm -f ${D}/${localstatedir}/log/README | ||
212 | |||
213 | install -d ${D}${systemd_unitdir}/system/graphical.target.wants | ||
214 | install -d ${D}${systemd_unitdir}/system/multi-user.target.wants | ||
215 | install -d ${D}${systemd_unitdir}/system/poweroff.target.wants | ||
216 | install -d ${D}${systemd_unitdir}/system/reboot.target.wants | ||
217 | install -d ${D}${systemd_unitdir}/system/rescue.target.wants | ||
218 | |||
219 | # Create symlinks for systemd-update-utmp-runlevel.service | ||
220 | if ${@bb.utils.contains('PACKAGECONFIG', 'utmp', 'true', 'false', d)}; then | ||
221 | ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/graphical.target.wants/systemd-update-utmp-runlevel.service | ||
222 | ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/multi-user.target.wants/systemd-update-utmp-runlevel.service | ||
223 | ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/poweroff.target.wants/systemd-update-utmp-runlevel.service | ||
224 | ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/reboot.target.wants/systemd-update-utmp-runlevel.service | ||
225 | ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/rescue.target.wants/systemd-update-utmp-runlevel.service | ||
226 | fi | ||
227 | |||
228 | # Enable journal to forward message to syslog daemon | ||
229 | sed -i -e 's/.*ForwardToSyslog.*/ForwardToSyslog=yes/' ${D}${sysconfdir}/systemd/journald.conf | ||
230 | # Set the maximium size of runtime journal to 64M as default | ||
231 | sed -i -e 's/.*RuntimeMaxUse.*/RuntimeMaxUse=64M/' ${D}${sysconfdir}/systemd/journald.conf | ||
232 | |||
233 | # this file is needed to exist if networkd is disabled but timesyncd is still in use since timesyncd checks it | ||
234 | # for existence else it fails | ||
235 | if [ -s ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf ]; then | ||
236 | ${@bb.utils.contains('PACKAGECONFIG', 'networkd', ':', 'sed -i -e "\$ad /run/systemd/netif/links 0755 root root -" ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf', d)} | ||
237 | fi | ||
238 | if ! ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'true', 'false', d)}; then | ||
239 | echo 'L! ${sysconfdir}/resolv.conf - - - - ../run/systemd/resolve/resolv.conf' >>${D}${exec_prefix}/lib/tmpfiles.d/etc.conf | ||
240 | echo 'd /run/systemd/resolve 0755 root root -' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf | ||
241 | echo 'f /run/systemd/resolve/resolv.conf 0644 root root' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf | ||
242 | ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd | ||
243 | else | ||
244 | sed -i -e "s%^L! /etc/resolv.conf.*$%L! /etc/resolv.conf - - - - ../run/systemd/resolve/resolv.conf%g" ${D}${exec_prefix}/lib/tmpfiles.d/etc.conf | ||
245 | ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd | ||
246 | fi | ||
247 | install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${systemd_unitdir}/systemd-sysv-install | ||
248 | } | ||
249 | |||
250 | do_install_ptest () { | ||
251 | # install data files needed for tests | ||
252 | install -d ${D}${PTEST_PATH}/tests/test | ||
253 | cp -rfL ${S}/test/* ${D}${PTEST_PATH}/tests/test | ||
254 | # python is disabled for systemd, thus removing these python testing scripts | ||
255 | rm ${D}${PTEST_PATH}/tests/test/*.py | ||
256 | sed -i 's/"tree"/"ls"/' ${D}${PTEST_PATH}/tests/test/udev-test.pl | ||
257 | |||
258 | install -d ${D}${PTEST_PATH}/tests/catalog | ||
259 | install ${S}/catalog/* ${D}${PTEST_PATH}/tests/catalog/ | ||
260 | |||
261 | install -D ${S}/build-aux/test-driver ${D}${PTEST_PATH}/tests/build-aux/test-driver | ||
262 | |||
263 | install -d ${D}${PTEST_PATH}/tests/rules | ||
264 | install ${B}/rules/* ${D}${PTEST_PATH}/tests/rules/ | ||
265 | |||
266 | # This directory needs to be there for udev-test.pl to work. | ||
267 | install -d ${D}${libdir}/udev/rules.d | ||
268 | |||
269 | # install actual test binaries | ||
270 | install -m 0755 ${B}/test-* ${D}${PTEST_PATH}/tests/ | ||
271 | install -m 0755 ${B}/.libs/test-* ${D}${PTEST_PATH}/tests/ | ||
272 | |||
273 | install ${B}/Makefile ${D}${PTEST_PATH}/tests/ | ||
274 | } | ||
275 | |||
276 | python populate_packages_prepend (){ | ||
277 | systemdlibdir = d.getVar("rootlibdir") | ||
278 | do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True) | ||
279 | } | ||
280 | PACKAGES_DYNAMIC += "^lib(udev|systemd|nss).*" | ||
281 | |||
282 | PACKAGES =+ "\ | ||
283 | ${PN}-gui \ | ||
284 | ${PN}-vconsole-setup \ | ||
285 | ${PN}-initramfs \ | ||
286 | ${PN}-analyze \ | ||
287 | ${PN}-kernel-install \ | ||
288 | ${PN}-rpm-macros \ | ||
289 | ${PN}-binfmt \ | ||
290 | ${PN}-pam \ | ||
291 | ${PN}-zsh-completion \ | ||
292 | ${PN}-xorg-xinitrc \ | ||
293 | ${PN}-container \ | ||
294 | ${PN}-extra-utils \ | ||
295 | " | ||
296 | |||
297 | SUMMARY_${PN}-container = "Tools for containers and VMs" | ||
298 | DESCRIPTION_${PN}-container = "Systemd tools to spawn and manage containers and virtual machines." | ||
299 | |||
300 | SYSTEMD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'binfmt', '${PN}-binfmt', '', d)}" | ||
301 | SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service" | ||
302 | |||
303 | USERADD_PACKAGES = "${PN} ${PN}-extra-utils" | ||
304 | USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '--system -d / -M --shell /bin/nologin systemd-journal-gateway;', '', d)}" | ||
305 | USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '--system -d / -M --shell /bin/nologin systemd-journal-remote;', '', d)}" | ||
306 | USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '--system -d / -M --shell /bin/nologin systemd-journal-upload;', '', d)}" | ||
307 | USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'timesyncd', '--system -d / -M --shell /bin/nologin systemd-timesync;', '', d)}" | ||
308 | USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'networkd', '--system -d / -M --shell /bin/nologin systemd-network;', '', d)}" | ||
309 | USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'coredump', '--system -d / -M --shell /bin/nologin systemd-coredump;', '', d)}" | ||
310 | USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'resolved', '--system -d / -M --shell /bin/nologin systemd-resolve;', '', d)}" | ||
311 | GROUPADD_PARAM_${PN} = "-r lock; -r systemd-journal" | ||
312 | USERADD_PARAM_${PN}-extra-utils += "--system -d / -M --shell /bin/nologin systemd-bus-proxy;" | ||
313 | |||
314 | FILES_${PN}-analyze = "${bindir}/systemd-analyze" | ||
315 | |||
316 | FILES_${PN}-initramfs = "/init" | ||
317 | RDEPENDS_${PN}-initramfs = "${PN}" | ||
318 | |||
319 | RDEPENDS_${PN}-ptest += "gawk make perl bash xz \ | ||
320 | tzdata tzdata-americas tzdata-asia \ | ||
321 | tzdata-europe tzdata-africa tzdata-antarctica \ | ||
322 | tzdata-arctic tzdata-atlantic tzdata-australia \ | ||
323 | tzdata-pacific tzdata-posix" | ||
324 | |||
325 | FILES_${PN}-ptest += "${libdir}/udev/rules.d" | ||
326 | |||
327 | FILES_${PN}-gui = "${bindir}/systemadm" | ||
328 | |||
329 | FILES_${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \ | ||
330 | ${systemd_unitdir}/system/systemd-vconsole-setup.service \ | ||
331 | ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service" | ||
332 | |||
333 | RDEPENDS_${PN}-kernel-install += "bash" | ||
334 | FILES_${PN}-kernel-install = "${bindir}/kernel-install \ | ||
335 | ${sysconfdir}/kernel/ \ | ||
336 | ${exec_prefix}/lib/kernel \ | ||
337 | " | ||
338 | FILES_${PN}-rpm-macros = "${exec_prefix}/lib/rpm \ | ||
339 | " | ||
340 | |||
341 | FILES_${PN}-xorg-xinitrc = "${sysconfdir}/X11/xinit/xinitrc.d/*" | ||
342 | |||
343 | FILES_${PN}-zsh-completion = "${datadir}/zsh/site-functions" | ||
344 | |||
345 | FILES_${PN}-binfmt = "${sysconfdir}/binfmt.d/ \ | ||
346 | ${exec_prefix}/lib/binfmt.d \ | ||
347 | ${rootlibexecdir}/systemd/systemd-binfmt \ | ||
348 | ${systemd_unitdir}/system/proc-sys-fs-binfmt_misc.* \ | ||
349 | ${systemd_unitdir}/system/systemd-binfmt.service" | ||
350 | RRECOMMENDS_${PN}-binfmt = "kernel-module-binfmt-misc" | ||
351 | |||
352 | RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts kbd-keymaps" | ||
353 | |||
354 | FILES_${PN}-container = "${sysconfdir}/dbus-1/system.d/org.freedesktop.import1.conf \ | ||
355 | ${sysconfdir}/dbus-1/system.d/org.freedesktop.machine1.conf \ | ||
356 | ${base_bindir}/machinectl \ | ||
357 | ${bindir}/systemd-nspawn \ | ||
358 | ${nonarch_libdir}/systemd/import-pubring.gpg \ | ||
359 | ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.import1.busname \ | ||
360 | ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.machine1.busname \ | ||
361 | ${systemd_system_unitdir}/local-fs.target.wants/var-lib-machines.mount \ | ||
362 | ${systemd_system_unitdir}/machine.slice \ | ||
363 | ${systemd_system_unitdir}/machines.target \ | ||
364 | ${systemd_system_unitdir}/org.freedesktop.import1.busname \ | ||
365 | ${systemd_system_unitdir}/org.freedesktop.machine1.busname \ | ||
366 | ${systemd_system_unitdir}/systemd-importd.service \ | ||
367 | ${systemd_system_unitdir}/systemd-machined.service \ | ||
368 | ${systemd_system_unitdir}/dbus-org.freedesktop.machine1.service \ | ||
369 | ${systemd_system_unitdir}/var-lib-machines.mount \ | ||
370 | ${rootlibexecdir}/systemd/systemd-import \ | ||
371 | ${rootlibexecdir}/systemd/systemd-importd \ | ||
372 | ${rootlibexecdir}/systemd/systemd-journal-gatewayd \ | ||
373 | ${rootlibexecdir}/systemd/systemd-journal-remote \ | ||
374 | ${rootlibexecdir}/systemd/systemd-journal-upload \ | ||
375 | ${rootlibexecdir}/systemd/systemd-machined \ | ||
376 | ${rootlibexecdir}/systemd/systemd-pull \ | ||
377 | ${exec_prefix}/lib/tmpfiles.d/systemd-nspawn.conf \ | ||
378 | ${systemd_system_unitdir}/systemd-nspawn@.service \ | ||
379 | ${libdir}/libnss_mymachines.so.2 \ | ||
380 | ${datadir}/dbus-1/system-services/org.freedesktop.import1.service \ | ||
381 | ${datadir}/dbus-1/system-services/org.freedesktop.machine1.service \ | ||
382 | ${datadir}/polkit-1/actions/org.freedesktop.import1.policy \ | ||
383 | ${datadir}/polkit-1/actions/org.freedesktop.machine1.policy \ | ||
384 | " | ||
385 | |||
386 | FILES_${PN}-extra-utils = "\ | ||
387 | ${base_bindir}/systemd-escape \ | ||
388 | ${base_bindir}/systemd-inhibit \ | ||
389 | ${bindir}/systemd-detect-virt \ | ||
390 | ${bindir}/systemd-path \ | ||
391 | ${bindir}/systemd-run \ | ||
392 | ${bindir}/systemd-cat \ | ||
393 | ${bindir}/systemd-delta \ | ||
394 | ${bindir}/systemd-cgls \ | ||
395 | ${bindir}/systemd-cgtop \ | ||
396 | ${bindir}/systemd-stdio-bridge \ | ||
397 | ${base_bindir}/systemd-ask-password \ | ||
398 | ${base_bindir}/systemd-tty-ask-password-agent \ | ||
399 | ${systemd_unitdir}/system/systemd-ask-password-console.path \ | ||
400 | ${systemd_unitdir}/system/systemd-ask-password-console.service \ | ||
401 | ${systemd_unitdir}/system/systemd-ask-password-wall.path \ | ||
402 | ${systemd_unitdir}/system/systemd-ask-password-wall.service \ | ||
403 | ${systemd_unitdir}/system/sysinit.target.wants/systemd-ask-password-console.path \ | ||
404 | ${systemd_unitdir}/system/sysinit.target.wants/systemd-ask-password-wall.path \ | ||
405 | ${systemd_unitdir}/system/multi-user.target.wants/systemd-ask-password-wall.path \ | ||
406 | ${rootlibexecdir}/systemd/systemd-resolve-host \ | ||
407 | ${rootlibexecdir}/systemd/systemd-ac-power \ | ||
408 | ${rootlibexecdir}/systemd/systemd-activate \ | ||
409 | ${rootlibexecdir}/systemd/systemd-bus-proxyd \ | ||
410 | ${systemd_unitdir}/system/systemd-bus-proxyd.service \ | ||
411 | ${systemd_unitdir}/system/systemd-bus-proxyd.socket \ | ||
412 | ${rootlibexecdir}/systemd/systemd-socket-proxyd \ | ||
413 | ${rootlibexecdir}/systemd/systemd-reply-password \ | ||
414 | ${rootlibexecdir}/systemd/systemd-sleep \ | ||
415 | ${rootlibexecdir}/systemd/system-sleep \ | ||
416 | ${systemd_unitdir}/system/systemd-hibernate.service \ | ||
417 | ${systemd_unitdir}/system/systemd-hybrid-sleep.service \ | ||
418 | ${systemd_unitdir}/system/systemd-suspend.service \ | ||
419 | ${systemd_unitdir}/system/sleep.target \ | ||
420 | ${rootlibexecdir}/systemd/systemd-initctl \ | ||
421 | ${systemd_unitdir}/system/systemd-initctl.service \ | ||
422 | ${systemd_unitdir}/system/systemd-initctl.socket \ | ||
423 | ${systemd_unitdir}/system/sockets.target.wants/systemd-initctl.socket \ | ||
424 | ${rootlibexecdir}/systemd/system-generators/systemd-gpt-auto-generator \ | ||
425 | ${rootlibexecdir}/systemd/systemd-cgroups-agent \ | ||
426 | " | ||
427 | |||
428 | CONFFILES_${PN} = "${sysconfdir}/machine-id \ | ||
429 | ${sysconfdir}/systemd/coredump.conf \ | ||
430 | ${sysconfdir}/systemd/journald.conf \ | ||
431 | ${sysconfdir}/systemd/logind.conf \ | ||
432 | ${sysconfdir}/systemd/system.conf \ | ||
433 | ${sysconfdir}/systemd/user.conf" | ||
434 | |||
435 | FILES_${PN} = " ${base_bindir}/* \ | ||
436 | ${datadir}/dbus-1/services \ | ||
437 | ${datadir}/dbus-1/system-services \ | ||
438 | ${datadir}/polkit-1 \ | ||
439 | ${datadir}/${BPN} \ | ||
440 | ${datadir}/factory \ | ||
441 | ${sysconfdir}/dbus-1/ \ | ||
442 | ${sysconfdir}/machine-id \ | ||
443 | ${sysconfdir}/modules-load.d/ \ | ||
444 | ${sysconfdir}/pam.d/ \ | ||
445 | ${sysconfdir}/sysctl.d/ \ | ||
446 | ${sysconfdir}/systemd/ \ | ||
447 | ${sysconfdir}/tmpfiles.d/ \ | ||
448 | ${sysconfdir}/xdg/ \ | ||
449 | ${sysconfdir}/init.d/README \ | ||
450 | ${sysconfdir}/resolv-conf.systemd \ | ||
451 | ${rootlibexecdir}/systemd/* \ | ||
452 | ${systemd_unitdir}/* \ | ||
453 | ${base_libdir}/security/*.so \ | ||
454 | /cgroup \ | ||
455 | ${bindir}/systemd* \ | ||
456 | ${bindir}/busctl \ | ||
457 | ${bindir}/coredumpctl \ | ||
458 | ${bindir}/localectl \ | ||
459 | ${bindir}/hostnamectl \ | ||
460 | ${bindir}/timedatectl \ | ||
461 | ${bindir}/bootctl \ | ||
462 | ${bindir}/kernel-install \ | ||
463 | ${exec_prefix}/lib/tmpfiles.d/*.conf \ | ||
464 | ${exec_prefix}/lib/systemd \ | ||
465 | ${exec_prefix}/lib/modules-load.d \ | ||
466 | ${exec_prefix}/lib/sysctl.d \ | ||
467 | ${exec_prefix}/lib/sysusers.d \ | ||
468 | ${exec_prefix}/lib/environment.d \ | ||
469 | ${localstatedir} \ | ||
470 | ${nonarch_base_libdir}/udev/rules.d/70-uaccess.rules \ | ||
471 | ${nonarch_base_libdir}/udev/rules.d/71-seat.rules \ | ||
472 | ${nonarch_base_libdir}/udev/rules.d/73-seat-late.rules \ | ||
473 | ${nonarch_base_libdir}/udev/rules.d/99-systemd.rules \ | ||
474 | ${datadir}/dbus-1/system.d/org.freedesktop.timedate1.conf \ | ||
475 | ${datadir}/dbus-1/system.d/org.freedesktop.locale1.conf \ | ||
476 | ${datadir}/dbus-1/system.d/org.freedesktop.network1.conf \ | ||
477 | ${datadir}/dbus-1/system.d/org.freedesktop.resolve1.conf \ | ||
478 | ${datadir}/dbus-1/system.d/org.freedesktop.systemd1.conf \ | ||
479 | ${datadir}/dbus-1/system.d/org.freedesktop.machine1.conf \ | ||
480 | ${datadir}/dbus-1/system.d/org.freedesktop.hostname1.conf \ | ||
481 | ${datadir}/dbus-1/system.d/org.freedesktop.login1.conf \ | ||
482 | " | ||
483 | |||
484 | FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd" | ||
485 | |||
486 | RDEPENDS_${PN} += "kmod dbus util-linux-mount udev (= ${EXTENDPKGV})" | ||
487 | RDEPENDS_${PN} += "volatile-binds update-rc.d" | ||
488 | |||
489 | RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', '', 'systemd-serialgetty', d)} \ | ||
490 | systemd-extra-utils \ | ||
491 | systemd-compat-units udev-hwdb \ | ||
492 | util-linux-agetty util-linux-fsck e2fsprogs-e2fsck \ | ||
493 | kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \ | ||
494 | os-release \ | ||
495 | " | ||
496 | |||
497 | INSANE_SKIP_${PN} += "dev-so libdir" | ||
498 | INSANE_SKIP_${PN}-dbg += "libdir" | ||
499 | INSANE_SKIP_${PN}-doc += " libdir" | ||
500 | |||
501 | PACKAGES =+ "udev udev-hwdb" | ||
502 | |||
503 | RPROVIDES_udev = "hotplug" | ||
504 | |||
505 | RDEPENDS_udev-hwdb += "udev" | ||
506 | |||
507 | FILES_udev += "${base_sbindir}/udevd \ | ||
508 | ${rootlibexecdir}/systemd/systemd-udevd \ | ||
509 | ${rootlibexecdir}/udev/accelerometer \ | ||
510 | ${rootlibexecdir}/udev/ata_id \ | ||
511 | ${rootlibexecdir}/udev/cdrom_id \ | ||
512 | ${rootlibexecdir}/udev/collect \ | ||
513 | ${rootlibexecdir}/udev/findkeyboards \ | ||
514 | ${rootlibexecdir}/udev/keyboard-force-release.sh \ | ||
515 | ${rootlibexecdir}/udev/keymap \ | ||
516 | ${rootlibexecdir}/udev/mtd_probe \ | ||
517 | ${rootlibexecdir}/udev/scsi_id \ | ||
518 | ${rootlibexecdir}/udev/v4l_id \ | ||
519 | ${rootlibexecdir}/udev/keymaps \ | ||
520 | ${rootlibexecdir}/udev/rules.d/*.rules \ | ||
521 | ${sysconfdir}/udev \ | ||
522 | ${sysconfdir}/init.d/systemd-udevd \ | ||
523 | ${systemd_unitdir}/system/*udev* \ | ||
524 | ${systemd_unitdir}/system/*.wants/*udev* \ | ||
525 | ${base_bindir}/udevadm \ | ||
526 | ${datadir}/bash-completion/completions/udevadm \ | ||
527 | " | ||
528 | |||
529 | FILES_udev-hwdb = "${rootlibexecdir}/udev/hwdb.d" | ||
530 | |||
531 | INITSCRIPT_PACKAGES = "udev" | ||
532 | INITSCRIPT_NAME_udev = "systemd-udevd" | ||
533 | INITSCRIPT_PARAMS_udev = "start 03 S ." | ||
534 | |||
535 | python __anonymous() { | ||
536 | if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): | ||
537 | d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") | ||
538 | } | ||
539 | |||
540 | # TODO: | ||
541 | # u-a for runlevel and telinit | ||
542 | |||
543 | ALTERNATIVE_${PN} = "init halt reboot shutdown poweroff runlevel resolv-conf" | ||
544 | |||
545 | ALTERNATIVE_TARGET[init] = "${rootlibexecdir}/systemd/systemd" | ||
546 | ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init" | ||
547 | ALTERNATIVE_PRIORITY[init] ?= "300" | ||
548 | |||
549 | ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl" | ||
550 | ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt" | ||
551 | ALTERNATIVE_PRIORITY[halt] ?= "300" | ||
552 | |||
553 | ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl" | ||
554 | ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot" | ||
555 | ALTERNATIVE_PRIORITY[reboot] ?= "300" | ||
556 | |||
557 | ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl" | ||
558 | ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown" | ||
559 | ALTERNATIVE_PRIORITY[shutdown] ?= "300" | ||
560 | |||
561 | ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl" | ||
562 | ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff" | ||
563 | ALTERNATIVE_PRIORITY[poweroff] ?= "300" | ||
564 | |||
565 | ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl" | ||
566 | ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel" | ||
567 | ALTERNATIVE_PRIORITY[runlevel] ?= "300" | ||
568 | |||
569 | ALTERNATIVE_TARGET[resolv-conf] = "${sysconfdir}/resolv-conf.systemd" | ||
570 | ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/resolv.conf" | ||
571 | ALTERNATIVE_PRIORITY[resolv-conf] ?= "50" | ||
572 | |||
573 | pkg_postinst_${PN} () { | ||
574 | sed -e '/^hosts:/s/\s*\<myhostname\>//' \ | ||
575 | -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \ | ||
576 | -i $D${sysconfdir}/nsswitch.conf | ||
577 | } | ||
578 | |||
579 | pkg_prerm_${PN} () { | ||
580 | sed -e '/^hosts:/s/\s*\<myhostname\>//' \ | ||
581 | -e '/^hosts:/s/\s*myhostname//' \ | ||
582 | -i $D${sysconfdir}/nsswitch.conf | ||
583 | } | ||
584 | |||
585 | PACKAGE_WRITE_DEPS += "qemu-native" | ||
586 | pkg_postinst_udev-hwdb () { | ||
587 | if test -n "$D"; then | ||
588 | ${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')} hwdb --update \ | ||
589 | --root $D | ||
590 | chown root:root $D${sysconfdir}/udev/hwdb.bin | ||
591 | else | ||
592 | udevadm hwdb --update | ||
593 | fi | ||
594 | } | ||
595 | |||
596 | pkg_prerm_udev-hwdb () { | ||
597 | rm -f $D${sysconfdir}/udev/hwdb.bin | ||
598 | } | ||
599 | |||
600 | # As this recipe builds udev, respect systemd being in DISTRO_FEATURES so | ||
601 | # that we don't build both udev and systemd in world builds. | ||
602 | python () { | ||
603 | if not bb.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d): | ||
604 | raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES") | ||
605 | |||
606 | import re | ||
607 | if re.match('.*musl*', d.getVar('TARGET_OS')) != None: | ||
608 | raise bb.parse.SkipPackage("Not _yet_ supported on musl based targets") | ||
609 | } | ||