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