summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd_229.bb
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2016-02-22 21:36:52 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-26 17:16:24 +0000
commit64ab17b707dc431aaed880d6d8615971243f46f8 (patch)
tree8eaf41c6096122e95c83e0ee42f0a346ca1455c1 /meta/recipes-core/systemd/systemd_229.bb
parent44248af1735e95dc636619200c25eb7250e77d95 (diff)
downloadpoky-64ab17b707dc431aaed880d6d8615971243f46f8.tar.gz
systemd: Upgrade to 229
Forward port all existing patches and arrange them such such uclibc-only and qemu-only patches appear first Add new patches to fix build on uclibc ( 0019-0022 ) Convert the lnr sed operation into a static patch Use PACKAGECONFIG setting to disable features for muls and uclibc instead of modifying EXTRA_OECONF manually Drop compat from PACKAGECONFIG, this options has been removed from systemd Tested/booted sato iamge on all qemus and qemux86-64 on uclibc (From OE-Core rev: 50743301bd8c0c4817d039d08c9567d15243a74d) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/systemd/systemd_229.bb')
-rw-r--r--meta/recipes-core/systemd/systemd_229.bb555
1 files changed, 555 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd_229.bb b/meta/recipes-core/systemd/systemd_229.bb
new file mode 100644
index 0000000000..16af0acc3b
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd_229.bb
@@ -0,0 +1,555 @@
1SUMMARY = "A System and service manager"
2HOMEPAGE = "http://www.freedesktop.org/wiki/Software/systemd"
3
4DESCRIPTION = "systemd is a system and service manager for Linux, compatible with \
5SysV and LSB init scripts. systemd provides aggressive parallelization \
6capabilities, uses socket and D-Bus activation for starting services, \
7offers on-demand starting of daemons, keeps track of processes using \
8Linux cgroups, supports snapshotting and restoring of the system \
9state, maintains mount and automount points and implements an \
10elaborate transactional dependency-based service control logic. It can \
11work as a drop-in replacement for sysvinit."
12
13LICENSE = "GPLv2 & LGPLv2.1"
14LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe \
15 file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c"
16
17PROVIDES = "udev"
18
19PE = "1"
20
21DEPENDS = "kmod docbook-sgml-dtd-4.1-native intltool-native gperf-native acl readline libcap libcgroup qemu-native util-linux"
22
23SECTION = "base/shell"
24
25inherit useradd pkgconfig autotools perlnative update-rc.d update-alternatives qemu systemd ptest gettext bash-completion
26
27SRCREV = "714c62b46379abb7558c544665522aca91691e10"
28
29PV = "229+git${SRCPV}"
30
31SRC_URI = "git://github.com/systemd/systemd.git;protocol=git \
32 file://touchscreen.rules \
33 file://00-create-volatile.conf \
34 file://init \
35 file://run-ptest \
36 file://0003-define-exp10-if-missing.patch \
37 file://0004-Use-getenv-when-secure-versions-are-not-available.patch \
38 file://0005-binfmt-Don-t-install-dependency-links-at-install-tim.patch \
39 file://0006-configure-Check-for-additional-features-that-uclibc-.patch \
40 file://0007-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch \
41 file://0008-nspawn-Use-execvpe-only-when-libc-supports-it.patch \
42 file://0009-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch \
43 file://0010-implment-systemd-sysv-install-for-OE.patch \
44 file://0011-nss-mymachines-Build-conditionally-when-HAVE_MYHOSTN.patch \
45 file://0012-rules-whitelist-hd-devices.patch \
46 file://0013-sysv-generator-add-support-for-executing-scripts-und.patch \
47 file://0014-Make-root-s-home-directory-configurable.patch \
48 file://0015-systemd-user-avoid-using-system-auth.patch \
49 file://0016-Revert-rules-remove-firmware-loading-rules.patch \
50 file://0017-Revert-udev-remove-userspace-firmware-loading-suppor.patch \
51 file://0018-make-test-dir-configurable.patch \
52 file://0019-remove-duplicate-include-uchar.h.patch \
53 file://0020-check-for-uchar.h-in-configure.patch \
54 file://0021-include-missing.h-for-getting-secure_getenv-definiti.patch \
55 file://0022-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch \
56"
57SRC_URI_append_libc-uclibc = "\
58 file://0002-units-Prefer-getty-to-agetty-in-console-setup-system.patch \
59"
60SRC_URI_append_qemuall = " file://0001-core-device.c-Change-the-default-device-timeout-to-2.patch"
61
62S = "${WORKDIR}/git"
63
64LDFLAGS_append_libc-uclibc = " -lrt -lssp_nonshared -lssp "
65
66GTKDOC_DOCDIR = "${S}/docs/"
67
68PACKAGECONFIG ??= "xz \
69 ldconfig \
70 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
71 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \
72 ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \
73 ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \
74 ${@bb.utils.contains('MACHINE_FEATURES', 'efi', 'efi', '', d)} \
75 binfmt \
76 randomseed \
77 machined \
78 backlight \
79 quotacheck \
80 bootchart \
81 hostnamed \
82 ${@bb.utils.contains('TCLIBC', 'glibc', 'myhostname sysusers', '', d)} \
83 hibernate \
84 timedated \
85 timesyncd \
86 localed \
87 kdbus \
88 ima \
89 smack \
90 logind \
91 firstboot \
92 utmp \
93 polkit \
94"
95PACKAGECONFIG_remove_libc-musl = "selinux"
96PACKAGECONFIG_remove_libc-musl = "smack"
97
98PACKAGECONFIG[journal-upload] = "--enable-libcurl,--disable-libcurl,curl"
99# Sign the journal for anti-tampering
100PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt"
101PACKAGECONFIG[cryptsetup] = "--enable-libcryptsetup,--disable-libcryptsetup,cryptsetup"
102PACKAGECONFIG[microhttpd] = "--enable-microhttpd,--disable-microhttpd,libmicrohttpd"
103PACKAGECONFIG[elfutils] = "--enable-elfutils,--disable-elfutils,elfutils"
104PACKAGECONFIG[resolved] = "--enable-resolved,--disable-resolved"
105PACKAGECONFIG[networkd] = "--enable-networkd,--disable-networkd"
106PACKAGECONFIG[machined] = "--enable-machined,--disable-machined"
107PACKAGECONFIG[backlight] = "--enable-backlight,--disable-backlight"
108PACKAGECONFIG[quotacheck] = "--enable-quotacheck,--disable-quotacheck"
109PACKAGECONFIG[bootchart] = "--enable-bootchart,--disable-bootchart"
110PACKAGECONFIG[hostnamed] = "--enable-hostnamed,--disable-hostnamed"
111PACKAGECONFIG[myhostname] = "--enable-myhostname,--disable-myhostname"
112PACKAGECONFIG[rfkill] = "--enable-rfkill,--disable-rfkill"
113PACKAGECONFIG[hibernate] = "--enable-hibernate,--disable-hibernate"
114PACKAGECONFIG[timedated] = "--enable-timedated,--disable-timedated"
115PACKAGECONFIG[timesyncd] = "--enable-timesyncd,--disable-timesyncd"
116PACKAGECONFIG[localed] = "--enable-localed,--disable-localed"
117PACKAGECONFIG[efi] = "--enable-efi,--disable-efi"
118PACKAGECONFIG[kdbus] = "--enable-kdbus,--disable-kdbus"
119PACKAGECONFIG[ima] = "--enable-ima,--disable-ima"
120PACKAGECONFIG[smack] = "--enable-smack,--disable-smack"
121# libseccomp is found in meta-security
122PACKAGECONFIG[seccomp] = "--enable-seccomp,--disable-seccomp,libseccomp"
123PACKAGECONFIG[logind] = "--enable-logind,--disable-logind"
124PACKAGECONFIG[sysusers] = "--enable-sysusers,--disable-sysusers"
125PACKAGECONFIG[firstboot] = "--enable-firstboot,--disable-firstboot"
126PACKAGECONFIG[randomseed] = "--enable-randomseed,--disable-randomseed"
127PACKAGECONFIG[binfmt] = "--enable-binfmt,--disable-binfmt"
128PACKAGECONFIG[utmp] = "--enable-utmp,--disable-utmp"
129PACKAGECONFIG[polkit] = "--enable-polkit,--disable-polkit"
130# importd requires curl/xz/zlib/bzip2/gcrypt
131PACKAGECONFIG[importd] = "--enable-importd,--disable-importd"
132PACKAGECONFIG[libidn] = "--enable-libidn,--disable-libidn,libidn"
133PACKAGECONFIG[audit] = "--enable-audit,--disable-audit,audit"
134PACKAGECONFIG[manpages] = "--enable-manpages,--disable-manpages,libxslt-native xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
135PACKAGECONFIG[pam] = "--enable-pam,--disable-pam,libpam"
136# Verify keymaps on locale change
137PACKAGECONFIG[xkbcommon] = "--enable-xkbcommon,--disable-xkbcommon,libxkbcommon"
138# Update NAT firewall rules
139PACKAGECONFIG[iptc] = "--enable-libiptc,--disable-libiptc,iptables"
140PACKAGECONFIG[ldconfig] = "--enable-ldconfig,--disable-ldconfig,,"
141PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux"
142PACKAGECONFIG[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"
143PACKAGECONFIG[qrencode] = "--enable-qrencode,--disable-qrencode,qrencode"
144PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus"
145PACKAGECONFIG[coredump] = "--enable-coredump,--disable-coredump"
146PACKAGECONFIG[bzip2] = "--enable-bzip2,--disable-bzip2,bzip2"
147PACKAGECONFIG[lz4] = "--enable-lz4,--disable-lz4,lz4"
148PACKAGECONFIG[xz] = "--enable-xz,--disable-xz,xz"
149PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib"
150
151CACHED_CONFIGUREVARS += "ac_cv_path_KILL=${base_bindir}/kill"
152CACHED_CONFIGUREVARS += "ac_cv_path_KMOD=${base_bindir}/kmod"
153CACHED_CONFIGUREVARS += "ac_cv_path_QUOTACHECK=${sbindir}/quotacheck"
154CACHED_CONFIGUREVARS += "ac_cv_path_QUOTAON=${sbindir}/quotaon"
155CACHED_CONFIGUREVARS += "ac_cv_path_SULOGIN=${base_sbindir}/sulogin"
156
157# Helper variables to clarify locations. This mirrors the logic in systemd's
158# build system.
159rootprefix ?= "${base_prefix}"
160rootlibdir ?= "${base_libdir}"
161rootlibexecdir = "${rootprefix}/lib"
162
163CACHED_CONFIGUREVARS_class-target = "\
164 ac_cv_path_MOUNT_PATH=${base_bindir}/mount \
165 ac_cv_path_UMOUNT_PATH=${base_bindir}/umount \
166 ac_cv_path_KMOD=${base_bindir}/kmod \
167 ac_cv_path_KILL=${base_bindir}/kill \
168 ac_cv_path_SULOGIN=${base_sbindir}/sulogin \
169 ac_cv_path_KEXEC=${sbindir}/kexec \
170 ac_cv_path_QUOTACHECK=${sbindir}/quotacheck \
171 ac_cv_path_QUOTAON=${sbindir}/quotaon \
172 "
173
174EXTRA_OECONF = " --with-rootprefix=${rootprefix} \
175 --with-rootlibdir=${rootlibdir} \
176 --with-roothomedir=${ROOT_HOME} \
177 --enable-split-usr \
178 --without-python \
179 --with-sysvrcnd-path=${sysconfdir} \
180 --with-firmware-path=/lib/firmware \
181 --with-testdir=${PTEST_PATH} \
182 "
183# per the systemd README, define VALGRIND=1 to run under valgrind
184CFLAGS .= "${@bb.utils.contains('PACKAGECONFIG', 'valgrind', ' -DVALGRIND=1', '', d)}"
185
186# disable problematic GCC 5.2 optimizations [YOCTO #8291]
187FULL_OPTIMIZATION_append_arm = " -fno-schedule-insns -fno-schedule-insns2"
188
189do_configure_prepend() {
190 export NM="${HOST_PREFIX}gcc-nm"
191 export AR="${HOST_PREFIX}gcc-ar"
192 export RANLIB="${HOST_PREFIX}gcc-ranlib"
193 export KMOD="${base_bindir}/kmod"
194 if [ -d ${S}/units.pre_sed ] ; then
195 cp -r ${S}/units.pre_sed ${S}/units
196 else
197 cp -r ${S}/units ${S}/units.pre_sed
198 fi
199}
200
201do_install() {
202 autotools_do_install
203 install -d ${D}/${base_sbindir}
204 # Provided by a separate recipe
205 rm ${D}${systemd_unitdir}/system/serial-getty* -f
206
207 # Provide support for initramfs
208 [ ! -e ${D}/init ] && ln -s ${rootlibexecdir}/systemd/systemd ${D}/init
209 [ ! -e ${D}/${base_sbindir}/udevd ] && ln -s ${rootlibexecdir}/systemd/systemd-udevd ${D}/${base_sbindir}/udevd
210
211 # Create machine-id
212 # 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
213 touch ${D}${sysconfdir}/machine-id
214
215
216 install -d ${D}${sysconfdir}/udev/rules.d/
217 install -d ${D}${sysconfdir}/tmpfiles.d
218 install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/
219
220 install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
221
222 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
223 install -d ${D}${sysconfdir}/init.d
224 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd
225 sed -i s%@UDEVD@%${rootlibexecdir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd
226 fi
227
228 chown root:systemd-journal ${D}/${localstatedir}/log/journal
229
230 # Delete journal README, as log can be symlinked inside volatile.
231 rm -f ${D}/${localstatedir}/log/README
232
233 install -d ${D}${systemd_unitdir}/system/graphical.target.wants
234 install -d ${D}${systemd_unitdir}/system/multi-user.target.wants
235 install -d ${D}${systemd_unitdir}/system/poweroff.target.wants
236 install -d ${D}${systemd_unitdir}/system/reboot.target.wants
237 install -d ${D}${systemd_unitdir}/system/rescue.target.wants
238
239 # Create symlinks for systemd-update-utmp-runlevel.service
240 if ${@bb.utils.contains('PACKAGECONFIG', 'utmp', 'true', 'false', d)}; then
241 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/graphical.target.wants/systemd-update-utmp-runlevel.service
242 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/multi-user.target.wants/systemd-update-utmp-runlevel.service
243 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/poweroff.target.wants/systemd-update-utmp-runlevel.service
244 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/reboot.target.wants/systemd-update-utmp-runlevel.service
245 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/rescue.target.wants/systemd-update-utmp-runlevel.service
246 fi
247
248 # Enable journal to forward message to syslog daemon
249 sed -i -e 's/.*ForwardToSyslog.*/ForwardToSyslog=yes/' ${D}${sysconfdir}/systemd/journald.conf
250 # this file is needed to exist if networkd is disabled but timesyncd is still in use since timesyncd checks it
251 # for existence else it fails
252 if [ -s ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf ]; then
253 ${@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)}
254 fi
255 if ! ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'true', 'false', d)}; then
256 # if resolved is disabled, it won't handle the link of resolv.conf, so
257 # set it up ourselves
258 ln -s ../run/resolv.conf ${D}${sysconfdir}/resolv.conf
259 echo 'L! ${sysconfdir}/resolv.conf - - - - ../run/resolv.conf' >>${D}${exec_prefix}/lib/tmpfiles.d/etc.conf
260 echo 'f /run/resolv.conf 0644 root root' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
261 fi
262 install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${systemd_unitdir}/systemd-sysv-install
263}
264
265do_install_ptest () {
266 install -d ${D}${PTEST_PATH}/test
267 cp -rfL ${S}/test/* ${D}${PTEST_PATH}/test
268 install -m 0755 ${B}/test-udev ${D}${PTEST_PATH}/
269 install -d ${D}${PTEST_PATH}/build-aux
270 cp ${S}/build-aux/test-driver ${D}${PTEST_PATH}/build-aux/
271 cp -rf ${B}/rules ${D}${PTEST_PATH}/
272 # This directory needs to be there for udev-test.pl to work.
273 install -d ${D}${libdir}/udev/rules.d
274 cp ${B}/Makefile ${D}${PTEST_PATH}/
275 cp ${S}/test/sys.tar.xz ${D}${PTEST_PATH}/test
276 sed -i 's/"tree"/"ls"/' ${D}${PTEST_PATH}/test/udev-test.pl
277 sed -i 's#${S}#${PTEST_PATH}#g' ${D}${PTEST_PATH}/Makefile
278 sed -i 's#${B}#${PTEST_PATH}#g' ${D}${PTEST_PATH}/Makefile
279}
280
281python populate_packages_prepend (){
282 systemdlibdir = d.getVar("rootlibdir", True)
283 do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True)
284}
285PACKAGES_DYNAMIC += "^lib(udev|systemd).*"
286
287PACKAGES =+ "\
288 ${PN}-gui \
289 ${PN}-vconsole-setup \
290 ${PN}-initramfs \
291 ${PN}-analyze \
292 ${PN}-kernel-install \
293 ${PN}-rpm-macros \
294 ${PN}-binfmt \
295 ${PN}-pam \
296 ${PN}-zsh-completion \
297 ${PN}-xorg-xinitrc \
298 ${PN}-extra-utils \
299"
300
301SYSTEMD_PACKAGES = "${PN}-binfmt"
302SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service"
303
304USERADD_PACKAGES = "${PN}"
305USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '--system -d / -M --shell /bin/nologin systemd-journal-gateway;', '', d)}"
306USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'timesyncd', '--system -d / -M --shell /bin/nologin systemd-timesync;', '', d)}"
307GROUPADD_PARAM_${PN} = "-r lock; -r systemd-journal"
308
309FILES_${PN}-analyze = "${bindir}/systemd-analyze"
310
311FILES_${PN}-initramfs = "/init"
312RDEPENDS_${PN}-initramfs = "${PN}"
313
314RDEPENDS_${PN}-ptest += "perl python bash"
315FILES_${PN}-ptest += "${libdir}/udev/rules.d"
316
317FILES_${PN}-gui = "${bindir}/systemadm"
318
319FILES_${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \
320 ${systemd_unitdir}/system/systemd-vconsole-setup.service \
321 ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service"
322
323RDEPENDS_${PN}-kernel-install += "bash"
324FILES_${PN}-kernel-install = "${bindir}/kernel-install \
325 ${sysconfdir}/kernel/ \
326 ${exec_prefix}/lib/kernel \
327 "
328FILES_${PN}-rpm-macros = "${exec_prefix}/lib/rpm \
329 "
330
331FILES_${PN}-xorg-xinitrc = "${sysconfdir}/X11/xinit/xinitrc.d/*"
332
333FILES_${PN}-zsh-completion = "${datadir}/zsh/site-functions"
334
335FILES_${PN}-binfmt = "${sysconfdir}/binfmt.d/ \
336 ${exec_prefix}/lib/binfmt.d \
337 ${rootlibexecdir}/systemd/systemd-binfmt \
338 ${systemd_unitdir}/system/proc-sys-fs-binfmt_misc.* \
339 ${systemd_unitdir}/system/systemd-binfmt.service"
340RRECOMMENDS_${PN}-binfmt = "kernel-module-binfmt-misc"
341
342RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts kbd-keymaps"
343
344FILES_${PN}-extra-utils = "\
345 ${base_bindir}/systemd-escape \
346 ${base_bindir}/systemd-inhibit \
347 ${bindir}/systemd-detect-virt \
348 ${bindir}/systemd-path \
349 ${bindir}/systemd-run \
350 ${bindir}/systemd-cat \
351 ${bindir}/systemd-delta \
352 ${bindir}/systemd-cgls \
353 ${bindir}/systemd-cgtop \
354 ${bindir}/systemd-stdio-bridge \
355 ${base_bindir}/systemd-ask-password \
356 ${base_bindir}/systemd-tty-ask-password-agent \
357 ${systemd_unitdir}/system/systemd-ask-password-console.path \
358 ${systemd_unitdir}/system/systemd-ask-password-console.service \
359 ${systemd_unitdir}/system/systemd-ask-password-wall.path \
360 ${systemd_unitdir}/system/systemd-ask-password-wall.service \
361 ${systemd_unitdir}/system/sysinit.target.wants/systemd-ask-password-console.path \
362 ${systemd_unitdir}/system/sysinit.target.wants/systemd-ask-password-wall.path \
363 ${systemd_unitdir}/system/multi-user.target.wants/systemd-ask-password-wall.path \
364 ${rootlibexecdir}/systemd/systemd-resolve-host \
365 ${rootlibexecdir}/systemd/systemd-ac-power \
366 ${rootlibexecdir}/systemd/systemd-activate \
367 ${bindir}/systemd-nspawn \
368 ${exec_prefix}/lib/tmpfiles.d/systemd-nspawn.conf \
369 ${systemd_unitdir}/system/systemd-nspawn@.service \
370 ${rootlibexecdir}/systemd/systemd-bus-proxyd \
371 ${systemd_unitdir}/system/systemd-bus-proxyd.service \
372 ${systemd_unitdir}/system/systemd-bus-proxyd.socket \
373 ${rootlibexecdir}/systemd/systemd-socket-proxyd \
374 ${rootlibexecdir}/systemd/systemd-reply-password \
375 ${rootlibexecdir}/systemd/systemd-sleep \
376 ${rootlibexecdir}/systemd/system-sleep \
377 ${systemd_unitdir}/system/systemd-hibernate.service \
378 ${systemd_unitdir}/system/systemd-hybrid-sleep.service \
379 ${systemd_unitdir}/system/systemd-suspend.service \
380 ${systemd_unitdir}/system/sleep.target \
381 ${rootlibexecdir}/systemd/systemd-initctl \
382 ${systemd_unitdir}/system/systemd-initctl.service \
383 ${systemd_unitdir}/system/systemd-initctl.socket \
384 ${systemd_unitdir}/system/sockets.target.wants/systemd-initctl.socket \
385 ${rootlibexecdir}/systemd/system-generators/systemd-gpt-auto-generator \
386 ${rootlibexecdir}/systemd/systemd-cgroups-agent \
387"
388
389CONFFILES_${PN} = "${sysconfdir}/machine-id \
390 ${sysconfdir}/systemd/coredump.conf \
391 ${sysconfdir}/systemd/journald.conf \
392 ${sysconfdir}/systemd/logind.conf \
393 ${sysconfdir}/systemd/system.conf \
394 ${sysconfdir}/systemd/user.conf"
395
396FILES_${PN} = " ${base_bindir}/* \
397 ${datadir}/dbus-1/services \
398 ${datadir}/dbus-1/system-services \
399 ${datadir}/polkit-1 \
400 ${datadir}/${BPN} \
401 ${datadir}/factory \
402 ${sysconfdir}/dbus-1/ \
403 ${sysconfdir}/machine-id \
404 ${sysconfdir}/modules-load.d/ \
405 ${sysconfdir}/pam.d/ \
406 ${sysconfdir}/sysctl.d/ \
407 ${sysconfdir}/systemd/ \
408 ${sysconfdir}/tmpfiles.d/ \
409 ${sysconfdir}/xdg/ \
410 ${sysconfdir}/init.d/README \
411 ${sysconfdir}/resolv.conf \
412 ${rootlibexecdir}/systemd/* \
413 ${systemd_unitdir}/* \
414 ${base_libdir}/security/*.so \
415 ${libdir}/libnss_* \
416 /cgroup \
417 ${bindir}/systemd* \
418 ${bindir}/busctl \
419 ${bindir}/coredumpctl \
420 ${bindir}/localectl \
421 ${bindir}/hostnamectl \
422 ${bindir}/timedatectl \
423 ${bindir}/bootctl \
424 ${bindir}/kernel-install \
425 ${exec_prefix}/lib/tmpfiles.d/*.conf \
426 ${exec_prefix}/lib/systemd \
427 ${exec_prefix}/lib/modules-load.d \
428 ${exec_prefix}/lib/sysctl.d \
429 ${exec_prefix}/lib/sysusers.d \
430 ${localstatedir} \
431 ${nonarch_base_libdir}/udev/rules.d/70-uaccess.rules \
432 ${nonarch_base_libdir}/udev/rules.d/71-seat.rules \
433 ${nonarch_base_libdir}/udev/rules.d/73-seat-late.rules \
434 ${nonarch_base_libdir}/udev/rules.d/99-systemd.rules \
435 "
436
437FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
438
439RDEPENDS_${PN} += "kmod dbus util-linux-mount udev (= ${EXTENDPKGV})"
440RDEPENDS_${PN} += "volatile-binds update-rc.d"
441
442RRECOMMENDS_${PN} += "systemd-serialgetty systemd-vconsole-setup \
443 systemd-extra-utils \
444 systemd-compat-units udev-hwdb \
445 util-linux-agetty util-linux-fsck e2fsprogs-e2fsck \
446 kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \
447 os-release \
448"
449
450INSANE_SKIP_${PN}-doc += " libdir"
451
452PACKAGES =+ "udev udev-hwdb"
453
454RPROVIDES_udev = "hotplug"
455
456RDEPENDS_udev-hwdb += "udev"
457
458FILES_udev += "${base_sbindir}/udevd \
459 ${rootlibexecdir}/systemd/systemd-udevd \
460 ${rootlibexecdir}/udev/accelerometer \
461 ${rootlibexecdir}/udev/ata_id \
462 ${rootlibexecdir}/udev/cdrom_id \
463 ${rootlibexecdir}/udev/collect \
464 ${rootlibexecdir}/udev/findkeyboards \
465 ${rootlibexecdir}/udev/keyboard-force-release.sh \
466 ${rootlibexecdir}/udev/keymap \
467 ${rootlibexecdir}/udev/mtd_probe \
468 ${rootlibexecdir}/udev/scsi_id \
469 ${rootlibexecdir}/udev/v4l_id \
470 ${rootlibexecdir}/udev/keymaps \
471 ${rootlibexecdir}/udev/rules.d/*.rules \
472 ${sysconfdir}/udev \
473 ${sysconfdir}/init.d/systemd-udevd \
474 ${systemd_unitdir}/system/*udev* \
475 ${systemd_unitdir}/system/*.wants/*udev* \
476 ${base_bindir}/udevadm \
477 ${datadir}/bash-completion/completions/udevadm \
478 "
479
480FILES_udev-hwdb = "${rootlibexecdir}/udev/hwdb.d"
481
482INITSCRIPT_PACKAGES = "udev"
483INITSCRIPT_NAME_udev = "systemd-udevd"
484INITSCRIPT_PARAMS_udev = "start 03 S ."
485
486python __anonymous() {
487 if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
488 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
489}
490
491# TODO:
492# u-a for runlevel and telinit
493
494ALTERNATIVE_${PN} = "init halt reboot shutdown poweroff runlevel"
495
496ALTERNATIVE_TARGET[init] = "${rootlibexecdir}/systemd/systemd"
497ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init"
498ALTERNATIVE_PRIORITY[init] ?= "300"
499
500ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl"
501ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt"
502ALTERNATIVE_PRIORITY[halt] ?= "300"
503
504ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl"
505ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
506ALTERNATIVE_PRIORITY[reboot] ?= "300"
507
508ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl"
509ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown"
510ALTERNATIVE_PRIORITY[shutdown] ?= "300"
511
512ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl"
513ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
514ALTERNATIVE_PRIORITY[poweroff] ?= "300"
515
516ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"
517ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
518ALTERNATIVE_PRIORITY[runlevel] ?= "300"
519
520pkg_postinst_${PN} () {
521 sed -e '/^hosts:/s/\s*\<myhostname\>//' \
522 -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \
523 -i $D${sysconfdir}/nsswitch.conf
524}
525
526pkg_prerm_${PN} () {
527 sed -e '/^hosts:/s/\s*\<myhostname\>//' \
528 -e '/^hosts:/s/\s*myhostname//' \
529 -i $D${sysconfdir}/nsswitch.conf
530}
531
532pkg_postinst_udev-hwdb () {
533 if test -n "$D"; then
534 ${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')} hwdb --update \
535 --root $D
536 chown root:root $D${sysconfdir}/udev/hwdb.bin
537 else
538 udevadm hwdb --update
539 fi
540}
541
542pkg_prerm_udev-hwdb () {
543 rm -f $D${sysconfdir}/udev/hwdb.bin
544}
545
546# As this recipe builds udev, respect systemd being in DISTRO_FEATURES so
547# that we don't build both udev and systemd in world builds.
548python () {
549 if not bb.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d):
550 raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES")
551
552 import re
553 if re.match('.*musl*', d.getVar('TARGET_OS', True)) != None:
554 raise bb.parse.SkipPackage("Not _yet_ supported on musl based targets")
555}