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