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