summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd_243.4.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/systemd/systemd_243.4.bb')
-rw-r--r--meta/recipes-core/systemd/systemd_243.4.bb680
1 files changed, 680 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd_243.4.bb b/meta/recipes-core/systemd/systemd_243.4.bb
new file mode 100644
index 0000000000..a0d10e03be
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd_243.4.bb
@@ -0,0 +1,680 @@
1require systemd.inc
2
3PROVIDES = "udev"
4
5PE = "1"
6
7DEPENDS = "intltool-native gperf-native libcap util-linux"
8
9SECTION = "base/shell"
10
11inherit useradd pkgconfig meson perlnative update-rc.d update-alternatives qemu systemd gettext bash-completion manpages features_check
12
13# As this recipe builds udev, respect systemd being in DISTRO_FEATURES so
14# that we don't build both udev and systemd in world builds.
15REQUIRED_DISTRO_FEATURES = "systemd"
16
17SRC_URI += "file://touchscreen.rules \
18 file://00-create-volatile.conf \
19 file://init \
20 file://0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch \
21 file://0002-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch \
22 file://0003-implment-systemd-sysv-install-for-OE.patch \
23 file://99-default.preset \
24 "
25
26# patches needed by musl
27SRC_URI_append_libc-musl = " ${SRC_URI_MUSL}"
28SRC_URI_MUSL = "\
29 file://0002-don-t-use-glibc-specific-qsort_r.patch \
30 file://0003-missing_type.h-add-__compare_fn_t-and-comparison_fn_.patch \
31 file://0004-add-fallback-parse_printf_format-implementation.patch \
32 file://0005-src-basic-missing.h-check-for-missing-strndupa.patch \
33 file://0006-Include-netinet-if_ether.h.patch \
34 file://0007-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not.patch \
35 file://0008-add-missing-FTW_-macros-for-musl.patch \
36 file://0010-fix-missing-of-__register_atfork-for-non-glibc-build.patch \
37 file://0011-Use-uintmax_t-for-handling-rlim_t.patch \
38 file://0014-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch \
39 file://0015-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch \
40 file://0016-Define-glibc-compatible-basename-for-non-glibc-syste.patch \
41 file://0017-Do-not-disable-buffering-when-writing-to-oom_score_a.patch \
42 file://0018-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch \
43 file://0019-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch \
44 file://0020-missing_type.h-add-__compar_d_fn_t-definition.patch \
45 file://0021-avoid-redefinition-of-prctl_mm_map-structure.patch \
46 file://0022-Use-INT_MAX-instead-of-TIME_T_MAX-for-timerfd_settim.patch \
47 file://0024-test-json.c-define-M_PIl.patch \
48 file://0001-do-not-disable-buffer-in-writing-files.patch \
49 file://0002-src-login-brightness.c-include-sys-wait.h.patch \
50 file://0003-src-basic-copy.c-include-signal.h.patch \
51 file://0004-src-shared-cpu-set-util.h-add-__cpu_mask-definition.patch \
52 "
53
54PAM_PLUGINS = " \
55 pam-plugin-unix \
56 pam-plugin-loginuid \
57 pam-plugin-keyinit \
58"
59
60PACKAGECONFIG ??= " \
61 ${@bb.utils.filter('DISTRO_FEATURES', 'efi ldconfig pam selinux usrmerge polkit', d)} \
62 ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \
63 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \
64 acl \
65 backlight \
66 binfmt \
67 gshadow \
68 hibernate \
69 hostnamed \
70 idn \
71 ima \
72 kmod \
73 localed \
74 logind \
75 machined \
76 myhostname \
77 networkd \
78 nss \
79 nss-mymachines \
80 nss-resolve \
81 quotacheck \
82 randomseed \
83 resolved \
84 set-time-epoch \
85 smack \
86 sysusers \
87 timedated \
88 timesyncd \
89 utmp \
90 vconsole \
91 xz \
92"
93
94PACKAGECONFIG_remove_libc-musl = " \
95 gshadow \
96 idn \
97 localed \
98 myhostname \
99 nss \
100 nss-mymachines \
101 nss-resolve \
102 resolved \
103 smack \
104 sysusers \
105 utmp \
106"
107
108# Use the upstream systemd serial-getty@.service and rely on
109# systemd-getty-generator instead of using the OE-core specific
110# systemd-serialgetty.bb - not enabled by default.
111PACKAGECONFIG[serial-getty-generator] = ""
112
113PACKAGECONFIG[acl] = "-Dacl=true,-Dacl=false,acl"
114PACKAGECONFIG[audit] = "-Daudit=true,-Daudit=false,audit"
115PACKAGECONFIG[backlight] = "-Dbacklight=true,-Dbacklight=false"
116PACKAGECONFIG[binfmt] = "-Dbinfmt=true,-Dbinfmt=false"
117PACKAGECONFIG[bzip2] = "-Dbzip2=true,-Dbzip2=false,bzip2"
118PACKAGECONFIG[cgroupv2] = "-Ddefault-hierarchy=unified,-Ddefault-hierarchy=hybrid"
119PACKAGECONFIG[coredump] = "-Dcoredump=true,-Dcoredump=false"
120PACKAGECONFIG[cryptsetup] = "-Dlibcryptsetup=true,-Dlibcryptsetup=false,cryptsetup"
121PACKAGECONFIG[dbus] = "-Ddbus=true,-Ddbus=false,dbus"
122PACKAGECONFIG[efi] = "-Defi=true,-Defi=false"
123PACKAGECONFIG[gnu-efi] = "-Dgnu-efi=true -Defi-libdir=${STAGING_LIBDIR} -Defi-includedir=${STAGING_INCDIR}/efi,-Dgnu-efi=false,gnu-efi"
124PACKAGECONFIG[elfutils] = "-Delfutils=true,-Delfutils=false,elfutils"
125PACKAGECONFIG[firstboot] = "-Dfirstboot=true,-Dfirstboot=false"
126# Sign the journal for anti-tampering
127PACKAGECONFIG[gcrypt] = "-Dgcrypt=true,-Dgcrypt=false,libgcrypt"
128PACKAGECONFIG[gnutls] = "-Dgnutls=true,-Dgnutls=false,gnutls"
129PACKAGECONFIG[gshadow] = "-Dgshadow=true,-Dgshadow=false"
130PACKAGECONFIG[hibernate] = "-Dhibernate=true,-Dhibernate=false"
131PACKAGECONFIG[hostnamed] = "-Dhostnamed=true,-Dhostnamed=false"
132PACKAGECONFIG[idn] = "-Didn=true,-Didn=false"
133PACKAGECONFIG[ima] = "-Dima=true,-Dima=false"
134# importd requires curl/xz/zlib/bzip2/gcrypt
135PACKAGECONFIG[importd] = "-Dimportd=true,-Dimportd=false"
136# Update NAT firewall rules
137PACKAGECONFIG[iptc] = "-Dlibiptc=true,-Dlibiptc=false,iptables"
138PACKAGECONFIG[journal-upload] = "-Dlibcurl=true,-Dlibcurl=false,curl"
139PACKAGECONFIG[kmod] = "-Dkmod=true,-Dkmod=false,kmod"
140PACKAGECONFIG[ldconfig] = "-Dldconfig=true,-Dldconfig=false,,ldconfig"
141PACKAGECONFIG[libidn] = "-Dlibidn=true,-Dlibidn=false,libidn"
142PACKAGECONFIG[localed] = "-Dlocaled=true,-Dlocaled=false"
143PACKAGECONFIG[logind] = "-Dlogind=true,-Dlogind=false"
144PACKAGECONFIG[lz4] = "-Dlz4=true,-Dlz4=false,lz4"
145PACKAGECONFIG[machined] = "-Dmachined=true,-Dmachined=false"
146PACKAGECONFIG[manpages] = "-Dman=true,-Dman=false,libxslt-native xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
147PACKAGECONFIG[microhttpd] = "-Dmicrohttpd=true,-Dmicrohttpd=false,libmicrohttpd"
148PACKAGECONFIG[myhostname] = "-Dnss-myhostname=true,-Dnss-myhostname=false,,libnss-myhostname"
149PACKAGECONFIG[networkd] = "-Dnetworkd=true,-Dnetworkd=false"
150PACKAGECONFIG[nss] = "-Dnss-systemd=true,-Dnss-systemd=false"
151PACKAGECONFIG[nss-mymachines] = "-Dnss-mymachines=true,-Dnss-mymachines=false"
152PACKAGECONFIG[nss-resolve] = "-Dnss-resolve=true,-Dnss-resolve=false"
153PACKAGECONFIG[openssl] = "-Dopenssl=true,-Dopenssl=false,openssl"
154PACKAGECONFIG[pam] = "-Dpam=true,-Dpam=false,libpam,${PAM_PLUGINS}"
155PACKAGECONFIG[pcre2] = "-Dpcre2=true,-Dpcre2=false,libpcre2"
156PACKAGECONFIG[polkit] = "-Dpolkit=true,-Dpolkit=false"
157PACKAGECONFIG[portabled] = "-Dportabled=true,-Dportabled=false"
158PACKAGECONFIG[qrencode] = "-Dqrencode=true,-Dqrencode=false,qrencode"
159PACKAGECONFIG[quotacheck] = "-Dquotacheck=true,-Dquotacheck=false"
160PACKAGECONFIG[randomseed] = "-Drandomseed=true,-Drandomseed=false"
161PACKAGECONFIG[resolved] = "-Dresolve=true,-Dresolve=false"
162PACKAGECONFIG[rfkill] = "-Drfkill=true,-Drfkill=false"
163# libseccomp is found in meta-security
164PACKAGECONFIG[seccomp] = "-Dseccomp=true,-Dseccomp=false,libseccomp"
165PACKAGECONFIG[selinux] = "-Dselinux=true,-Dselinux=false,libselinux,initscripts-sushell"
166PACKAGECONFIG[smack] = "-Dsmack=true,-Dsmack=false"
167PACKAGECONFIG[sysusers] = "-Dsysusers=true,-Dsysusers=false"
168# When enabled use reproducble build timestamp if set as time epoch,
169# or build time if not. When disabled, time epoch is unset.
170def build_epoch(d):
171 epoch = d.getVar('SOURCE_DATE_EPOCH') or "-1"
172 return '-Dtime-epoch=%d' % int(epoch)
173PACKAGECONFIG[set-time-epoch] = "${@build_epoch(d)},-Dtime-epoch=0"
174PACKAGECONFIG[timedated] = "-Dtimedated=true,-Dtimedated=false"
175PACKAGECONFIG[timesyncd] = "-Dtimesyncd=true,-Dtimesyncd=false"
176PACKAGECONFIG[usrmerge] = "-Dsplit-usr=false,-Dsplit-usr=true"
177PACKAGECONFIG[sbinmerge] = "-Dsplit-bin=false,-Dsplit-bin=true"
178PACKAGECONFIG[utmp] = "-Dutmp=true,-Dutmp=false"
179PACKAGECONFIG[valgrind] = "-DVALGRIND=1,,valgrind"
180PACKAGECONFIG[vconsole] = "-Dvconsole=true,-Dvconsole=false,,${PN}-vconsole-setup"
181# Verify keymaps on locale change
182PACKAGECONFIG[xkbcommon] = "-Dxkbcommon=true,-Dxkbcommon=false,libxkbcommon"
183PACKAGECONFIG[xz] = "-Dxz=true,-Dxz=false,xz"
184PACKAGECONFIG[zlib] = "-Dzlib=true,-Dzlib=false,zlib"
185
186# Helper variables to clarify locations. This mirrors the logic in systemd's
187# build system.
188rootprefix ?= "${root_prefix}"
189rootlibdir ?= "${base_libdir}"
190rootlibexecdir = "${rootprefix}/lib"
191
192# This links udev statically with systemd helper library.
193# Otherwise udev package would depend on systemd package (which has the needed shared library),
194# and always pull it into images.
195EXTRA_OEMESON += "-Dlink-udev-shared=false"
196
197EXTRA_OEMESON += "-Dnobody-user=nobody \
198 -Dnobody-group=nobody \
199 -Drootlibdir=${rootlibdir} \
200 -Drootprefix=${rootprefix} \
201 -Dsysvrcnd-path=${sysconfdir} \
202 -Ddefault-locale=C \
203 "
204
205# Hardcode target binary paths to avoid using paths from sysroot
206EXTRA_OEMESON += "-Dkexec-path=${sbindir}/kexec \
207 -Dkmod-path=${base_bindir}/kmod \
208 -Dmount-path=${base_bindir}/mount \
209 -Dquotacheck-path=${sbindir}/quotacheck \
210 -Dquotaon-path=${sbindir}/quotaon \
211 -Dsulogin-path=${base_sbindir}/sulogin \
212 -Dnologin-path=${base_sbindir}/nologin \
213 -Dumount-path=${base_bindir}/umount"
214
215do_install() {
216 meson_do_install
217 install -d ${D}/${base_sbindir}
218 if ${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', 'false', 'true', d)}; then
219 # Provided by a separate recipe
220 rm ${D}${systemd_unitdir}/system/serial-getty* -f
221 fi
222
223 # Provide support for initramfs
224 [ ! -e ${D}/init ] && ln -s ${rootlibexecdir}/systemd/systemd ${D}/init
225 [ ! -e ${D}/${base_sbindir}/udevd ] && ln -s ${rootlibexecdir}/systemd/systemd-udevd ${D}/${base_sbindir}/udevd
226
227 install -d ${D}${sysconfdir}/udev/rules.d/
228 install -d ${D}${sysconfdir}/tmpfiles.d
229 install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/
230
231 install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
232
233 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
234 install -d ${D}${sysconfdir}/init.d
235 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd
236 sed -i s%@UDEVD@%${rootlibexecdir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd
237 fi
238
239 chown root:systemd-journal ${D}/${localstatedir}/log/journal
240
241 # Delete journal README, as log can be symlinked inside volatile.
242 rm -f ${D}/${localstatedir}/log/README
243
244 # journal-remote creates this at start
245 rm -rf ${D}/${localstatedir}/log/journal/remote
246
247 install -d ${D}${systemd_unitdir}/system/graphical.target.wants
248 install -d ${D}${systemd_unitdir}/system/multi-user.target.wants
249 install -d ${D}${systemd_unitdir}/system/poweroff.target.wants
250 install -d ${D}${systemd_unitdir}/system/reboot.target.wants
251 install -d ${D}${systemd_unitdir}/system/rescue.target.wants
252
253 # Create symlinks for systemd-update-utmp-runlevel.service
254 if ${@bb.utils.contains('PACKAGECONFIG', 'utmp', 'true', 'false', d)}; then
255 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/graphical.target.wants/systemd-update-utmp-runlevel.service
256 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/multi-user.target.wants/systemd-update-utmp-runlevel.service
257 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/poweroff.target.wants/systemd-update-utmp-runlevel.service
258 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/reboot.target.wants/systemd-update-utmp-runlevel.service
259 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/rescue.target.wants/systemd-update-utmp-runlevel.service
260 fi
261
262 # this file is needed to exist if networkd is disabled but timesyncd is still in use since timesyncd checks it
263 # for existence else it fails
264 if [ -s ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf ]; then
265 ${@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)}
266 fi
267 if ! ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'true', 'false', d)}; then
268 echo 'L! ${sysconfdir}/resolv.conf - - - - ../run/systemd/resolve/resolv.conf' >>${D}${exec_prefix}/lib/tmpfiles.d/etc.conf
269 echo 'd /run/systemd/resolve 0755 root root -' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
270 echo 'f /run/systemd/resolve/resolv.conf 0644 root root' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
271 ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd
272 else
273 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
274 ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd
275 fi
276 install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${systemd_unitdir}/systemd-sysv-install
277
278 # If polkit is setup fixup permissions and ownership
279 if ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'true', 'false', d)}; then
280 if [ -d ${D}${datadir}/polkit-1/rules.d ]; then
281 chmod 700 ${D}${datadir}/polkit-1/rules.d
282 chown polkitd:root ${D}${datadir}/polkit-1/rules.d
283 fi
284 fi
285
286 # create link for existing udev rules
287 ln -s ${base_bindir}/udevadm ${D}${base_sbindir}/udevadm
288
289 # duplicate udevadm for postinst script
290 install -d ${D}${libexecdir}
291 ln ${D}${base_bindir}/udevadm ${D}${libexecdir}/${MLPREFIX}udevadm
292
293 # install default policy for presets
294 # https://www.freedesktop.org/wiki/Software/systemd/Preset/#howto
295 install -Dm 0644 ${WORKDIR}/99-default.preset ${D}${systemd_unitdir}/system-preset/99-default.preset
296
297 # We use package postinsts for the hwdb update, as the update service is
298 # easily triggered for no reason and will slow down boots.
299 find ${D} -name systemd-hwdb-update.service -delete
300}
301
302python populate_packages_prepend (){
303 systemdlibdir = d.getVar("rootlibdir")
304 do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True)
305}
306PACKAGES_DYNAMIC += "^lib(udev|systemd|nss).*"
307
308PACKAGES =+ "\
309 ${PN}-gui \
310 ${PN}-vconsole-setup \
311 ${PN}-initramfs \
312 ${PN}-analyze \
313 ${PN}-kernel-install \
314 ${PN}-rpm-macros \
315 ${PN}-binfmt \
316 ${PN}-zsh-completion \
317 ${PN}-container \
318 ${PN}-journal-gatewayd \
319 ${PN}-journal-upload \
320 ${PN}-journal-remote \
321 ${PN}-extra-utils \
322"
323
324SUMMARY_${PN}-container = "Tools for containers and VMs"
325DESCRIPTION_${PN}-container = "Systemd tools to spawn and manage containers and virtual machines."
326
327SUMMARY_${PN}-journal-gatewayd = "HTTP server for journal events"
328DESCRIPTION_${PN}-journal-gatewayd = "systemd-journal-gatewayd serves journal events over the network. Clients must connect using HTTP. The server listens on port 19531 by default."
329
330SUMMARY_${PN}-journal-upload = "Send journal messages over the network"
331DESCRIPTION_${PN}-journal-upload = "systemd-journal-upload uploads journal entries to a specified URL."
332
333SUMMARY_${PN}-journal-remote = "Receive journal messages over the network"
334DESCRIPTION_${PN}-journal-remote = "systemd-journal-remote is a command to receive serialized journal events and store them to journal files."
335
336SYSTEMD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'binfmt', '${PN}-binfmt', '', d)} \
337 ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-gatewayd', '', d)} \
338 ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-remote', '', d)} \
339 ${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '${PN}-journal-upload', '', d)} \
340"
341SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service"
342
343USERADD_PACKAGES = "${PN} ${PN}-extra-utils \
344 ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-gateway', '', d)} \
345 ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-remote', '', d)} \
346 ${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '${PN}-journal-upload', '', d)} \
347"
348GROUPADD_PARAM_${PN} = "-r systemd-journal"
349USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'coredump', '--system -d / -M --shell /bin/nologin systemd-coredump;', '', d)}"
350USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'networkd', '--system -d / -M --shell /bin/nologin systemd-network;', '', d)}"
351USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'polkit', '--system --no-create-home --user-group --home-dir ${sysconfdir}/polkit-1 polkitd;', '', d)}"
352USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'resolved', '--system -d / -M --shell /bin/nologin systemd-resolve;', '', d)}"
353USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'timesyncd', '--system -d / -M --shell /bin/nologin systemd-timesync;', '', d)}"
354USERADD_PARAM_${PN}-extra-utils = "--system -d / -M --shell /bin/nologin systemd-bus-proxy"
355USERADD_PARAM_${PN}-journal-gateway = "--system -d / -M --shell /bin/nologin systemd-journal-gateway"
356USERADD_PARAM_${PN}-journal-remote = "--system -d / -M --shell /bin/nologin systemd-journal-remote"
357USERADD_PARAM_${PN}-journal-upload = "--system -d / -M --shell /bin/nologin systemd-journal-upload"
358
359FILES_${PN}-analyze = "${bindir}/systemd-analyze"
360
361FILES_${PN}-initramfs = "/init"
362RDEPENDS_${PN}-initramfs = "${PN}"
363
364FILES_${PN}-gui = "${bindir}/systemadm"
365
366FILES_${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \
367 ${systemd_unitdir}/system/systemd-vconsole-setup.service \
368 ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service"
369
370RDEPENDS_${PN}-kernel-install += "bash"
371FILES_${PN}-kernel-install = "${bindir}/kernel-install \
372 ${sysconfdir}/kernel/ \
373 ${exec_prefix}/lib/kernel \
374 "
375FILES_${PN}-rpm-macros = "${exec_prefix}/lib/rpm \
376 "
377
378FILES_${PN}-zsh-completion = "${datadir}/zsh/site-functions"
379
380FILES_${PN}-binfmt = "${sysconfdir}/binfmt.d/ \
381 ${exec_prefix}/lib/binfmt.d \
382 ${rootlibexecdir}/systemd/systemd-binfmt \
383 ${systemd_unitdir}/system/proc-sys-fs-binfmt_misc.* \
384 ${systemd_unitdir}/system/systemd-binfmt.service"
385RRECOMMENDS_${PN}-binfmt = "kernel-module-binfmt-misc"
386
387RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts kbd-keymaps"
388
389
390FILES_${PN}-journal-gatewayd = "${rootlibexecdir}/systemd/systemd-journal-gatewayd \
391 ${systemd_system_unitdir}/systemd-journal-gatewayd.service \
392 ${systemd_system_unitdir}/systemd-journal-gatewayd.socket \
393 ${systemd_system_unitdir}/sockets.target.wants/systemd-journal-gatewayd.socket \
394 ${datadir}/systemd/gatewayd/browse.html \
395 "
396SYSTEMD_SERVICE_${PN}-journal-gatewayd = "systemd-journal-gatewayd.socket"
397
398FILES_${PN}-journal-upload = "${rootlibexecdir}/systemd/systemd-journal-upload \
399 ${systemd_system_unitdir}/systemd-journal-upload.service \
400 ${sysconfdir}/systemd/journal-upload.conf \
401 "
402SYSTEMD_SERVICE_${PN}-journal-upload = "systemd-journal-upload.service"
403
404FILES_${PN}-journal-remote = "${rootlibexecdir}/systemd/systemd-journal-remote \
405 ${sysconfdir}/systemd/journal-remote.conf \
406 ${systemd_system_unitdir}/systemd-journal-remote.service \
407 ${systemd_system_unitdir}/systemd-journal-remote.socket \
408 "
409SYSTEMD_SERVICE_${PN}-journal-remote = "systemd-journal-remote.socket"
410
411
412FILES_${PN}-container = "${sysconfdir}/dbus-1/system.d/org.freedesktop.import1.conf \
413 ${sysconfdir}/dbus-1/system.d/org.freedesktop.machine1.conf \
414 ${sysconfdir}/systemd/system/multi-user.target.wants/machines.target \
415 ${base_bindir}/machinectl \
416 ${bindir}/systemd-nspawn \
417 ${nonarch_libdir}/systemd/import-pubring.gpg \
418 ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.import1.busname \
419 ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.machine1.busname \
420 ${systemd_system_unitdir}/local-fs.target.wants/var-lib-machines.mount \
421 ${systemd_system_unitdir}/machines.target.wants/var-lib-machines.mount \
422 ${systemd_system_unitdir}/remote-fs.target.wants/var-lib-machines.mount \
423 ${systemd_system_unitdir}/machine.slice \
424 ${systemd_system_unitdir}/machines.target \
425 ${systemd_system_unitdir}/org.freedesktop.import1.busname \
426 ${systemd_system_unitdir}/org.freedesktop.machine1.busname \
427 ${systemd_system_unitdir}/systemd-importd.service \
428 ${systemd_system_unitdir}/systemd-machined.service \
429 ${systemd_system_unitdir}/dbus-org.freedesktop.machine1.service \
430 ${systemd_system_unitdir}/var-lib-machines.mount \
431 ${rootlibexecdir}/systemd/systemd-import \
432 ${rootlibexecdir}/systemd/systemd-importd \
433 ${rootlibexecdir}/systemd/systemd-machined \
434 ${rootlibexecdir}/systemd/systemd-pull \
435 ${exec_prefix}/lib/tmpfiles.d/systemd-nspawn.conf \
436 ${systemd_system_unitdir}/systemd-nspawn@.service \
437 ${libdir}/libnss_mymachines.so.2 \
438 ${datadir}/dbus-1/system-services/org.freedesktop.import1.service \
439 ${datadir}/dbus-1/system-services/org.freedesktop.machine1.service \
440 ${datadir}/dbus-1/system.d/org.freedesktop.import1.conf \
441 ${datadir}/dbus-1/system.d/org.freedesktop.machine1.conf \
442 ${datadir}/polkit-1/actions/org.freedesktop.import1.policy \
443 ${datadir}/polkit-1/actions/org.freedesktop.machine1.policy \
444 "
445
446RRECOMMENDS_${PN}-container += "\
447 ${PN}-journal-upload \
448 ${PN}-journal-remote \
449 ${PN}-journal-gatewayd \
450 "
451
452FILES_${PN}-extra-utils = "\
453 ${base_bindir}/systemd-escape \
454 ${base_bindir}/systemd-inhibit \
455 ${bindir}/systemd-detect-virt \
456 ${bindir}/systemd-path \
457 ${bindir}/systemd-run \
458 ${bindir}/systemd-cat \
459 ${bindir}/systemd-delta \
460 ${bindir}/systemd-cgls \
461 ${bindir}/systemd-cgtop \
462 ${bindir}/systemd-stdio-bridge \
463 ${base_bindir}/systemd-ask-password \
464 ${base_bindir}/systemd-tty-ask-password-agent \
465 ${systemd_unitdir}/system/systemd-ask-password-console.path \
466 ${systemd_unitdir}/system/systemd-ask-password-console.service \
467 ${systemd_unitdir}/system/systemd-ask-password-wall.path \
468 ${systemd_unitdir}/system/systemd-ask-password-wall.service \
469 ${systemd_unitdir}/system/sysinit.target.wants/systemd-ask-password-console.path \
470 ${systemd_unitdir}/system/sysinit.target.wants/systemd-ask-password-wall.path \
471 ${systemd_unitdir}/system/multi-user.target.wants/systemd-ask-password-wall.path \
472 ${rootlibexecdir}/systemd/systemd-resolve-host \
473 ${rootlibexecdir}/systemd/systemd-ac-power \
474 ${rootlibexecdir}/systemd/systemd-activate \
475 ${rootlibexecdir}/systemd/systemd-bus-proxyd \
476 ${systemd_unitdir}/system/systemd-bus-proxyd.service \
477 ${systemd_unitdir}/system/systemd-bus-proxyd.socket \
478 ${rootlibexecdir}/systemd/systemd-socket-proxyd \
479 ${rootlibexecdir}/systemd/systemd-reply-password \
480 ${rootlibexecdir}/systemd/systemd-sleep \
481 ${rootlibexecdir}/systemd/system-sleep \
482 ${systemd_unitdir}/system/systemd-hibernate.service \
483 ${systemd_unitdir}/system/systemd-hybrid-sleep.service \
484 ${systemd_unitdir}/system/systemd-suspend.service \
485 ${systemd_unitdir}/system/sleep.target \
486 ${rootlibexecdir}/systemd/systemd-initctl \
487 ${systemd_unitdir}/system/systemd-initctl.service \
488 ${systemd_unitdir}/system/systemd-initctl.socket \
489 ${systemd_unitdir}/system/sockets.target.wants/systemd-initctl.socket \
490 ${rootlibexecdir}/systemd/system-generators/systemd-gpt-auto-generator \
491 ${rootlibexecdir}/systemd/systemd-cgroups-agent \
492"
493
494CONFFILES_${PN} = "${sysconfdir}/systemd/coredump.conf \
495 ${sysconfdir}/systemd/journald.conf \
496 ${sysconfdir}/systemd/logind.conf \
497 ${sysconfdir}/systemd/system.conf \
498 ${sysconfdir}/systemd/user.conf \
499 ${sysconfdir}/systemd/resolved.conf \
500 ${sysconfdir}/systemd/timesyncd.conf \
501"
502
503FILES_${PN} = " ${base_bindir}/* \
504 ${base_sbindir}/shutdown \
505 ${base_sbindir}/halt \
506 ${base_sbindir}/poweroff \
507 ${base_sbindir}/runlevel \
508 ${base_sbindir}/telinit \
509 ${base_sbindir}/resolvconf \
510 ${base_sbindir}/reboot \
511 ${base_sbindir}/init \
512 ${datadir}/dbus-1/services \
513 ${datadir}/dbus-1/system-services \
514 ${datadir}/polkit-1 \
515 ${datadir}/${BPN} \
516 ${datadir}/factory \
517 ${sysconfdir}/dbus-1/ \
518 ${sysconfdir}/modules-load.d/ \
519 ${sysconfdir}/pam.d/ \
520 ${sysconfdir}/sysctl.d/ \
521 ${sysconfdir}/systemd/ \
522 ${sysconfdir}/tmpfiles.d/ \
523 ${sysconfdir}/xdg/ \
524 ${sysconfdir}/init.d/README \
525 ${sysconfdir}/resolv-conf.systemd \
526 ${sysconfdir}/X11/xinit/xinitrc.d/* \
527 ${rootlibexecdir}/systemd/* \
528 ${systemd_unitdir}/* \
529 ${base_libdir}/security/*.so \
530 /cgroup \
531 ${bindir}/systemd* \
532 ${bindir}/busctl \
533 ${bindir}/coredumpctl \
534 ${bindir}/localectl \
535 ${bindir}/hostnamectl \
536 ${bindir}/resolvectl \
537 ${bindir}/timedatectl \
538 ${bindir}/bootctl \
539 ${bindir}/kernel-install \
540 ${exec_prefix}/lib/tmpfiles.d/*.conf \
541 ${exec_prefix}/lib/systemd \
542 ${exec_prefix}/lib/modules-load.d \
543 ${exec_prefix}/lib/sysctl.d \
544 ${exec_prefix}/lib/sysusers.d \
545 ${exec_prefix}/lib/environment.d \
546 ${localstatedir} \
547 ${nonarch_base_libdir}/udev/rules.d/70-uaccess.rules \
548 ${nonarch_base_libdir}/udev/rules.d/71-seat.rules \
549 ${nonarch_base_libdir}/udev/rules.d/73-seat-late.rules \
550 ${nonarch_base_libdir}/udev/rules.d/99-systemd.rules \
551 ${nonarch_base_libdir}/modprobe.d/systemd.conf \
552 ${datadir}/dbus-1/system.d/org.freedesktop.timedate1.conf \
553 ${datadir}/dbus-1/system.d/org.freedesktop.locale1.conf \
554 ${datadir}/dbus-1/system.d/org.freedesktop.network1.conf \
555 ${datadir}/dbus-1/system.d/org.freedesktop.resolve1.conf \
556 ${datadir}/dbus-1/system.d/org.freedesktop.systemd1.conf \
557 ${datadir}/dbus-1/system.d/org.freedesktop.hostname1.conf \
558 ${datadir}/dbus-1/system.d/org.freedesktop.login1.conf \
559 ${datadir}/dbus-1/system.d/org.freedesktop.timesync1.conf \
560 ${datadir}/dbus-1/system.d/org.freedesktop.portable1.conf \
561 "
562
563FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
564
565RDEPENDS_${PN} += "kmod dbus util-linux-mount util-linux-umount udev (= ${EXTENDPKGV}) util-linux-agetty util-linux-fsck"
566RDEPENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', '', 'systemd-serialgetty', d)}"
567RDEPENDS_${PN} += "volatile-binds update-rc.d"
568
569RRECOMMENDS_${PN} += "systemd-extra-utils \
570 systemd-compat-units udev-hwdb \
571 e2fsprogs-e2fsck \
572 kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \
573 os-release \
574 systemd-conf \
575"
576
577INSANE_SKIP_${PN} += "dev-so libdir"
578INSANE_SKIP_${PN}-dbg += "libdir"
579INSANE_SKIP_${PN}-doc += " libdir"
580
581PACKAGES =+ "udev udev-hwdb"
582
583RPROVIDES_udev = "hotplug"
584
585RDEPENDS_udev-hwdb += "udev"
586
587FILES_udev += "${base_sbindir}/udevd \
588 ${rootlibexecdir}/systemd/network/99-default.link \
589 ${rootlibexecdir}/systemd/systemd-udevd \
590 ${rootlibexecdir}/udev/accelerometer \
591 ${rootlibexecdir}/udev/ata_id \
592 ${rootlibexecdir}/udev/cdrom_id \
593 ${rootlibexecdir}/udev/collect \
594 ${rootlibexecdir}/udev/findkeyboards \
595 ${rootlibexecdir}/udev/keyboard-force-release.sh \
596 ${rootlibexecdir}/udev/keymap \
597 ${rootlibexecdir}/udev/mtd_probe \
598 ${rootlibexecdir}/udev/scsi_id \
599 ${rootlibexecdir}/udev/v4l_id \
600 ${rootlibexecdir}/udev/keymaps \
601 ${rootlibexecdir}/udev/rules.d/*.rules \
602 ${sysconfdir}/udev \
603 ${sysconfdir}/init.d/systemd-udevd \
604 ${systemd_unitdir}/system/*udev* \
605 ${systemd_unitdir}/system/*.wants/*udev* \
606 ${base_bindir}/udevadm \
607 ${base_sbindir}/udevadm \
608 ${libexecdir}/${MLPREFIX}udevadm \
609 ${datadir}/bash-completion/completions/udevadm \
610 "
611
612FILES_udev-hwdb = "${rootlibexecdir}/udev/hwdb.d"
613
614RCONFLICTS_${PN} = "tiny-init ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'resolvconf', '', d)}"
615
616INITSCRIPT_PACKAGES = "udev"
617INITSCRIPT_NAME_udev = "systemd-udevd"
618INITSCRIPT_PARAMS_udev = "start 03 S ."
619
620python __anonymous() {
621 if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
622 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
623}
624
625python do_warn_musl() {
626 if d.getVar('TCLIBC') == "musl":
627 bb.warn("Using systemd with musl is not recommended since it is not supported upstream and some patches are known to be problematic.")
628}
629addtask warn_musl before do_configure
630
631ALTERNATIVE_${PN} = "halt reboot shutdown poweroff runlevel ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'resolv-conf', '', d)}"
632
633ALTERNATIVE_TARGET[resolv-conf] = "${sysconfdir}/resolv-conf.systemd"
634ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/resolv.conf"
635ALTERNATIVE_PRIORITY[resolv-conf] ?= "50"
636
637ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl"
638ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt"
639ALTERNATIVE_PRIORITY[halt] ?= "300"
640
641ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl"
642ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
643ALTERNATIVE_PRIORITY[reboot] ?= "300"
644
645ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl"
646ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown"
647ALTERNATIVE_PRIORITY[shutdown] ?= "300"
648
649ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl"
650ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
651ALTERNATIVE_PRIORITY[poweroff] ?= "300"
652
653ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"
654ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
655ALTERNATIVE_PRIORITY[runlevel] ?= "300"
656
657pkg_postinst_${PN}_libc-glibc () {
658 sed -e '/^hosts:/s/\s*\<myhostname\>//' \
659 -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \
660 -i $D${sysconfdir}/nsswitch.conf
661}
662
663pkg_prerm_${PN}_libc-glibc () {
664 sed -e '/^hosts:/s/\s*\<myhostname\>//' \
665 -e '/^hosts:/s/\s*myhostname//' \
666 -i $D${sysconfdir}/nsswitch.conf
667}
668
669PACKAGE_WRITE_DEPS += "qemu-native"
670pkg_postinst_udev-hwdb () {
671 if test -n "$D"; then
672 $INTERCEPT_DIR/postinst_intercept update_udev_hwdb ${PKG} mlprefix=${MLPREFIX} binprefix=${MLPREFIX}
673 else
674 udevadm hwdb --update
675 fi
676}
677
678pkg_prerm_udev-hwdb () {
679 rm -f $D${sysconfdir}/udev/hwdb.bin
680}