summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd_234.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/systemd/systemd_234.bb')
-rw-r--r--meta/recipes-core/systemd/systemd_234.bb609
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 @@
1require systemd.inc
2
3PROVIDES = "udev"
4
5PE = "1"
6
7DEPENDS = "kmod intltool-native gperf-native acl readline libcap libcgroup util-linux"
8
9SECTION = "base/shell"
10
11inherit useradd pkgconfig autotools perlnative update-rc.d update-alternatives qemu systemd ptest gettext bash-completion manpages
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://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 "
32SRC_URI_append_qemuall = " file://0001-core-device.c-Change-the-default-device-timeout-to-2.patch"
33
34PACKAGECONFIG ??= "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"
59PACKAGECONFIG_remove_libc-musl = "selinux"
60PACKAGECONFIG_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.
65PACKAGECONFIG[serial-getty-generator] = ""
66
67PACKAGECONFIG[journal-upload] = "--enable-libcurl,--disable-libcurl,curl"
68# Sign the journal for anti-tampering
69PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt"
70PACKAGECONFIG[cryptsetup] = "--enable-libcryptsetup,--disable-libcryptsetup,cryptsetup"
71PACKAGECONFIG[microhttpd] = "--enable-microhttpd,--disable-microhttpd,libmicrohttpd"
72PACKAGECONFIG[elfutils] = "--enable-elfutils,--disable-elfutils,elfutils"
73PACKAGECONFIG[resolved] = "--enable-resolved,--disable-resolved"
74PACKAGECONFIG[networkd] = "--enable-networkd,--disable-networkd"
75PACKAGECONFIG[machined] = "--enable-machined,--disable-machined"
76PACKAGECONFIG[backlight] = "--enable-backlight,--disable-backlight"
77PACKAGECONFIG[vconsole] = "--enable-vconsole,--disable-vconsole,,${PN}-vconsole-setup"
78PACKAGECONFIG[quotacheck] = "--enable-quotacheck,--disable-quotacheck"
79PACKAGECONFIG[hostnamed] = "--enable-hostnamed,--disable-hostnamed"
80PACKAGECONFIG[myhostname] = "--enable-myhostname,--disable-myhostname"
81PACKAGECONFIG[rfkill] = "--enable-rfkill,--disable-rfkill"
82PACKAGECONFIG[hibernate] = "--enable-hibernate,--disable-hibernate"
83PACKAGECONFIG[timedated] = "--enable-timedated,--disable-timedated"
84PACKAGECONFIG[timesyncd] = "--enable-timesyncd,--disable-timesyncd"
85PACKAGECONFIG[localed] = "--enable-localed,--disable-localed"
86PACKAGECONFIG[efi] = "--enable-efi,--disable-efi"
87PACKAGECONFIG[ima] = "--enable-ima,--disable-ima"
88PACKAGECONFIG[smack] = "--enable-smack,--disable-smack"
89# libseccomp is found in meta-security
90PACKAGECONFIG[seccomp] = "--enable-seccomp,--disable-seccomp,libseccomp"
91PACKAGECONFIG[logind] = "--enable-logind,--disable-logind"
92PACKAGECONFIG[sysusers] = "--enable-sysusers,--disable-sysusers"
93PACKAGECONFIG[firstboot] = "--enable-firstboot,--disable-firstboot"
94PACKAGECONFIG[randomseed] = "--enable-randomseed,--disable-randomseed"
95PACKAGECONFIG[binfmt] = "--enable-binfmt,--disable-binfmt"
96PACKAGECONFIG[utmp] = "--enable-utmp,--disable-utmp"
97PACKAGECONFIG[polkit] = "--enable-polkit,--disable-polkit"
98# importd requires curl/xz/zlib/bzip2/gcrypt
99PACKAGECONFIG[importd] = "--enable-importd,--disable-importd"
100PACKAGECONFIG[libidn] = "--enable-libidn,--disable-libidn,libidn"
101PACKAGECONFIG[audit] = "--enable-audit,--disable-audit,audit"
102PACKAGECONFIG[manpages] = "--enable-manpages,--disable-manpages,libxslt-native xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
103PACKAGECONFIG[pam] = "--enable-pam,--disable-pam,libpam"
104# Verify keymaps on locale change
105PACKAGECONFIG[xkbcommon] = "--enable-xkbcommon,--disable-xkbcommon,libxkbcommon"
106# Update NAT firewall rules
107PACKAGECONFIG[iptc] = "--enable-libiptc,--disable-libiptc,iptables"
108PACKAGECONFIG[ldconfig] = "--enable-ldconfig,--disable-ldconfig,,"
109PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux"
110PACKAGECONFIG[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"
111PACKAGECONFIG[qrencode] = "--enable-qrencode,--disable-qrencode,qrencode"
112PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus"
113PACKAGECONFIG[coredump] = "--enable-coredump,--disable-coredump"
114PACKAGECONFIG[bzip2] = "--enable-bzip2,--disable-bzip2,bzip2"
115PACKAGECONFIG[lz4] = "--enable-lz4,--disable-lz4,lz4"
116PACKAGECONFIG[xz] = "--enable-xz,--disable-xz,xz"
117PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib"
118PACKAGECONFIG[usrmerge] = "--disable-split-usr, --enable-split-usr"
119
120CACHED_CONFIGUREVARS += "ac_cv_path_KILL=${base_bindir}/kill"
121CACHED_CONFIGUREVARS += "ac_cv_path_KMOD=${base_bindir}/kmod"
122CACHED_CONFIGUREVARS += "ac_cv_path_QUOTACHECK=${sbindir}/quotacheck"
123CACHED_CONFIGUREVARS += "ac_cv_path_QUOTAON=${sbindir}/quotaon"
124CACHED_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.
128rootprefix ?= "${root_prefix}"
129rootlibdir ?= "${base_libdir}"
130rootlibexecdir = "${rootprefix}/lib"
131
132CACHED_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
143EXTRA_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
151CFLAGS .= "${@bb.utils.contains('PACKAGECONFIG', 'valgrind', ' -DVALGRIND=1', '', d)}"
152
153# disable problematic GCC 5.2 optimizations [YOCTO #8291]
154FULL_OPTIMIZATION_append_arm = " -fno-schedule-insns -fno-schedule-insns2"
155
156# Avoid login failure on qemumips64 when pam is enabled
157FULL_OPTIMIZATION_append_mips64 = " -fno-tree-switch-conversion -fno-tree-tail-merge"
158
159COMPILER_NM ?= "${HOST_PREFIX}gcc-nm"
160COMPILER_AR ?= "${HOST_PREFIX}gcc-ar"
161COMPILER_RANLIB ?= "${HOST_PREFIX}gcc-ranlib"
162
163do_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
177do_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
250do_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
276python 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}
280PACKAGES_DYNAMIC += "^lib(udev|systemd|nss).*"
281
282PACKAGES =+ "\
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
297SUMMARY_${PN}-container = "Tools for containers and VMs"
298DESCRIPTION_${PN}-container = "Systemd tools to spawn and manage containers and virtual machines."
299
300SYSTEMD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'binfmt', '${PN}-binfmt', '', d)}"
301SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service"
302
303USERADD_PACKAGES = "${PN} ${PN}-extra-utils"
304USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '--system -d / -M --shell /bin/nologin systemd-journal-gateway;', '', d)}"
305USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '--system -d / -M --shell /bin/nologin systemd-journal-remote;', '', d)}"
306USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '--system -d / -M --shell /bin/nologin systemd-journal-upload;', '', d)}"
307USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'timesyncd', '--system -d / -M --shell /bin/nologin systemd-timesync;', '', d)}"
308USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'networkd', '--system -d / -M --shell /bin/nologin systemd-network;', '', d)}"
309USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'coredump', '--system -d / -M --shell /bin/nologin systemd-coredump;', '', d)}"
310USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'resolved', '--system -d / -M --shell /bin/nologin systemd-resolve;', '', d)}"
311GROUPADD_PARAM_${PN} = "-r lock; -r systemd-journal"
312USERADD_PARAM_${PN}-extra-utils += "--system -d / -M --shell /bin/nologin systemd-bus-proxy;"
313
314FILES_${PN}-analyze = "${bindir}/systemd-analyze"
315
316FILES_${PN}-initramfs = "/init"
317RDEPENDS_${PN}-initramfs = "${PN}"
318
319RDEPENDS_${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
325FILES_${PN}-ptest += "${libdir}/udev/rules.d"
326
327FILES_${PN}-gui = "${bindir}/systemadm"
328
329FILES_${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
333RDEPENDS_${PN}-kernel-install += "bash"
334FILES_${PN}-kernel-install = "${bindir}/kernel-install \
335 ${sysconfdir}/kernel/ \
336 ${exec_prefix}/lib/kernel \
337 "
338FILES_${PN}-rpm-macros = "${exec_prefix}/lib/rpm \
339 "
340
341FILES_${PN}-xorg-xinitrc = "${sysconfdir}/X11/xinit/xinitrc.d/*"
342
343FILES_${PN}-zsh-completion = "${datadir}/zsh/site-functions"
344
345FILES_${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"
350RRECOMMENDS_${PN}-binfmt = "kernel-module-binfmt-misc"
351
352RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts kbd-keymaps"
353
354FILES_${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
386FILES_${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
428CONFFILES_${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
435FILES_${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
484FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
485
486RDEPENDS_${PN} += "kmod dbus util-linux-mount udev (= ${EXTENDPKGV})"
487RDEPENDS_${PN} += "volatile-binds update-rc.d"
488
489RRECOMMENDS_${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
497INSANE_SKIP_${PN} += "dev-so libdir"
498INSANE_SKIP_${PN}-dbg += "libdir"
499INSANE_SKIP_${PN}-doc += " libdir"
500
501PACKAGES =+ "udev udev-hwdb"
502
503RPROVIDES_udev = "hotplug"
504
505RDEPENDS_udev-hwdb += "udev"
506
507FILES_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
529FILES_udev-hwdb = "${rootlibexecdir}/udev/hwdb.d"
530
531INITSCRIPT_PACKAGES = "udev"
532INITSCRIPT_NAME_udev = "systemd-udevd"
533INITSCRIPT_PARAMS_udev = "start 03 S ."
534
535python __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
543ALTERNATIVE_${PN} = "init halt reboot shutdown poweroff runlevel resolv-conf"
544
545ALTERNATIVE_TARGET[init] = "${rootlibexecdir}/systemd/systemd"
546ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init"
547ALTERNATIVE_PRIORITY[init] ?= "300"
548
549ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl"
550ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt"
551ALTERNATIVE_PRIORITY[halt] ?= "300"
552
553ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl"
554ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
555ALTERNATIVE_PRIORITY[reboot] ?= "300"
556
557ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl"
558ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown"
559ALTERNATIVE_PRIORITY[shutdown] ?= "300"
560
561ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl"
562ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
563ALTERNATIVE_PRIORITY[poweroff] ?= "300"
564
565ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"
566ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
567ALTERNATIVE_PRIORITY[runlevel] ?= "300"
568
569ALTERNATIVE_TARGET[resolv-conf] = "${sysconfdir}/resolv-conf.systemd"
570ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/resolv.conf"
571ALTERNATIVE_PRIORITY[resolv-conf] ?= "50"
572
573pkg_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
579pkg_prerm_${PN} () {
580 sed -e '/^hosts:/s/\s*\<myhostname\>//' \
581 -e '/^hosts:/s/\s*myhostname//' \
582 -i $D${sysconfdir}/nsswitch.conf
583}
584
585PACKAGE_WRITE_DEPS += "qemu-native"
586pkg_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
596pkg_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.
602python () {
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}