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