blob: 704a36e75d6d8865078d87293718b2d887330c94 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001require 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 \
Andrew Geissler635e0e42020-08-21 15:58:33 -050023 file://0001-Use-PREFIX-ROOTPREFIX-correctly.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050024 "
25
26# patches needed by musl
27SRC_URI_append_libc-musl = " ${SRC_URI_MUSL}"
28SRC_URI_MUSL = "\
29 file://0002-don-t-use-glibc-specific-qsort_r.patch \
30 file://0003-missing_type.h-add-__compare_fn_t-and-comparison_fn_.patch \
31 file://0004-add-fallback-parse_printf_format-implementation.patch \
32 file://0005-src-basic-missing.h-check-for-missing-strndupa.patch \
33 file://0006-Include-netinet-if_ether.h.patch \
34 file://0007-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not.patch \
35 file://0008-add-missing-FTW_-macros-for-musl.patch \
36 file://0010-fix-missing-of-__register_atfork-for-non-glibc-build.patch \
37 file://0011-Use-uintmax_t-for-handling-rlim_t.patch \
38 file://0014-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch \
39 file://0015-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch \
40 file://0016-Define-glibc-compatible-basename-for-non-glibc-syste.patch \
41 file://0017-Do-not-disable-buffering-when-writing-to-oom_score_a.patch \
42 file://0018-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch \
43 file://0019-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch \
44 file://0020-missing_type.h-add-__compar_d_fn_t-definition.patch \
45 file://0021-avoid-redefinition-of-prctl_mm_map-structure.patch \
Andrew Geissler635e0e42020-08-21 15:58:33 -050046 file://0021-Handle-missing-LOCK_EX.patch \
47 file://0022-Fix-incompatible-pointer-type-struct-sockaddr_un.patch \
48 file://0023-Fix-field-efi_loader_entry_one_shot_stat-has-incompl.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050049 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 curl/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"
188# Verify keymaps on locale change
189PACKAGECONFIG[xkbcommon] = "-Dxkbcommon=true,-Dxkbcommon=false,libxkbcommon"
190PACKAGECONFIG[xz] = "-Dxz=true,-Dxz=false,xz"
191PACKAGECONFIG[zlib] = "-Dzlib=true,-Dzlib=false,zlib"
192
193# Helper variables to clarify locations. This mirrors the logic in systemd's
194# build system.
195rootprefix ?= "${root_prefix}"
196rootlibdir ?= "${base_libdir}"
197rootlibexecdir = "${rootprefix}/lib"
198
199# This links udev statically with systemd helper library.
200# Otherwise udev package would depend on systemd package (which has the needed shared library),
201# and always pull it into images.
202EXTRA_OEMESON += "-Dlink-udev-shared=false"
203
204EXTRA_OEMESON += "-Dnobody-user=nobody \
205 -Dnobody-group=nobody \
206 -Drootlibdir=${rootlibdir} \
207 -Drootprefix=${rootprefix} \
208 -Ddefault-locale=C \
209 "
210
211# Hardcode target binary paths to avoid using paths from sysroot
212EXTRA_OEMESON += "-Dkexec-path=${sbindir}/kexec \
213 -Dkmod-path=${base_bindir}/kmod \
214 -Dmount-path=${base_bindir}/mount \
215 -Dquotacheck-path=${sbindir}/quotacheck \
216 -Dquotaon-path=${sbindir}/quotaon \
217 -Dsulogin-path=${base_sbindir}/sulogin \
218 -Dnologin-path=${base_sbindir}/nologin \
219 -Dumount-path=${base_bindir}/umount"
220
221do_install() {
222 meson_do_install
223 install -d ${D}/${base_sbindir}
224 if ${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', 'false', 'true', d)}; then
225 # Provided by a separate recipe
226 rm ${D}${systemd_unitdir}/system/serial-getty* -f
227 fi
228
229 # Provide support for initramfs
230 [ ! -e ${D}/init ] && ln -s ${rootlibexecdir}/systemd/systemd ${D}/init
231 [ ! -e ${D}/${base_sbindir}/udevd ] && ln -s ${rootlibexecdir}/systemd/systemd-udevd ${D}/${base_sbindir}/udevd
232
233 install -d ${D}${sysconfdir}/udev/rules.d/
234 install -d ${D}${sysconfdir}/tmpfiles.d
235 install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/
236
237 install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
238
239 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
240 install -d ${D}${sysconfdir}/init.d
241 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd
242 sed -i s%@UDEVD@%${rootlibexecdir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd
243 install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${systemd_unitdir}/systemd-sysv-install
244 fi
245
246 chown root:systemd-journal ${D}/${localstatedir}/log/journal
247
248 # Delete journal README, as log can be symlinked inside volatile.
249 rm -f ${D}/${localstatedir}/log/README
250
251 # journal-remote creates this at start
252 rm -rf ${D}/${localstatedir}/log/journal/remote
253
254 install -d ${D}${systemd_unitdir}/system/graphical.target.wants
255 install -d ${D}${systemd_unitdir}/system/multi-user.target.wants
256 install -d ${D}${systemd_unitdir}/system/poweroff.target.wants
257 install -d ${D}${systemd_unitdir}/system/reboot.target.wants
258 install -d ${D}${systemd_unitdir}/system/rescue.target.wants
259
260 # Create symlinks for systemd-update-utmp-runlevel.service
261 if ${@bb.utils.contains('PACKAGECONFIG', 'utmp', 'true', 'false', d)}; then
262 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/graphical.target.wants/systemd-update-utmp-runlevel.service
263 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/multi-user.target.wants/systemd-update-utmp-runlevel.service
264 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/poweroff.target.wants/systemd-update-utmp-runlevel.service
265 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/reboot.target.wants/systemd-update-utmp-runlevel.service
266 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/rescue.target.wants/systemd-update-utmp-runlevel.service
267 fi
268
269 # this file is needed to exist if networkd is disabled but timesyncd is still in use since timesyncd checks it
270 # for existence else it fails
271 if [ -s ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf ]; then
272 ${@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)}
273 fi
274 if ! ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'true', 'false', d)}; then
275 echo 'L! ${sysconfdir}/resolv.conf - - - - ../run/systemd/resolve/resolv.conf' >>${D}${exec_prefix}/lib/tmpfiles.d/etc.conf
276 echo 'd /run/systemd/resolve 0755 root root -' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
277 echo 'f /run/systemd/resolve/resolv.conf 0644 root root' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
278 ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd
279 else
280 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
281 ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd
282 fi
283 if ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'false', 'true', d)}; then
284 rm ${D}${exec_prefix}/lib/tmpfiles.d/x11.conf
285 rm -r ${D}${sysconfdir}/X11
286 fi
287
288 # If polkit is setup fixup permissions and ownership
289 if ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'true', 'false', d)}; then
290 if [ -d ${D}${datadir}/polkit-1/rules.d ]; then
291 chmod 700 ${D}${datadir}/polkit-1/rules.d
292 chown polkitd:root ${D}${datadir}/polkit-1/rules.d
293 fi
294 fi
295
296 # create link for existing udev rules
297 ln -s ${base_bindir}/udevadm ${D}${base_sbindir}/udevadm
298
299 # duplicate udevadm for postinst script
300 install -d ${D}${libexecdir}
301 ln ${D}${base_bindir}/udevadm ${D}${libexecdir}/${MLPREFIX}udevadm
302
303 # install default policy for presets
304 # https://www.freedesktop.org/wiki/Software/systemd/Preset/#howto
305 install -Dm 0644 ${WORKDIR}/99-default.preset ${D}${systemd_unitdir}/system-preset/99-default.preset
306}
307
308python populate_packages_prepend (){
309 systemdlibdir = d.getVar("rootlibdir")
310 do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True)
311}
312PACKAGES_DYNAMIC += "^lib(udev|systemd|nss).*"
313
314PACKAGE_BEFORE_PN = "\
315 ${PN}-gui \
316 ${PN}-vconsole-setup \
317 ${PN}-initramfs \
318 ${PN}-analyze \
319 ${PN}-kernel-install \
320 ${PN}-rpm-macros \
321 ${PN}-binfmt \
322 ${PN}-zsh-completion \
323 ${PN}-container \
324 ${PN}-journal-gatewayd \
325 ${PN}-journal-upload \
326 ${PN}-journal-remote \
327 ${PN}-extra-utils \
328 udev \
329 udev-hwdb \
330"
331
332SUMMARY_${PN}-container = "Tools for containers and VMs"
333DESCRIPTION_${PN}-container = "Systemd tools to spawn and manage containers and virtual machines."
334
335SUMMARY_${PN}-journal-gatewayd = "HTTP server for journal events"
336DESCRIPTION_${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."
337
338SUMMARY_${PN}-journal-upload = "Send journal messages over the network"
339DESCRIPTION_${PN}-journal-upload = "systemd-journal-upload uploads journal entries to a specified URL."
340
341SUMMARY_${PN}-journal-remote = "Receive journal messages over the network"
342DESCRIPTION_${PN}-journal-remote = "systemd-journal-remote is a command to receive serialized journal events and store them to journal files."
343
344SYSTEMD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'binfmt', '${PN}-binfmt', '', d)} \
345 ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-gatewayd', '', d)} \
346 ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-remote', '', d)} \
347 ${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '${PN}-journal-upload', '', d)} \
348"
349SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service"
350
351USERADD_PACKAGES = "${PN} ${PN}-extra-utils \
352 ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-gateway', '', d)} \
353 ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-remote', '', d)} \
354 ${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '${PN}-journal-upload', '', d)} \
355"
356GROUPADD_PARAM_${PN} = "-r systemd-journal"
357USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'coredump', '--system -d / -M --shell /bin/nologin systemd-coredump;', '', d)}"
358USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'networkd', '--system -d / -M --shell /bin/nologin systemd-network;', '', d)}"
359USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'polkit', '--system --no-create-home --user-group --home-dir ${sysconfdir}/polkit-1 polkitd;', '', d)}"
360USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'resolved', '--system -d / -M --shell /bin/nologin systemd-resolve;', '', d)}"
361USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'timesyncd', '--system -d / -M --shell /bin/nologin systemd-timesync;', '', d)}"
362USERADD_PARAM_${PN}-extra-utils = "--system -d / -M --shell /bin/nologin systemd-bus-proxy"
363USERADD_PARAM_${PN}-journal-gateway = "--system -d / -M --shell /bin/nologin systemd-journal-gateway"
364USERADD_PARAM_${PN}-journal-remote = "--system -d / -M --shell /bin/nologin systemd-journal-remote"
365USERADD_PARAM_${PN}-journal-upload = "--system -d / -M --shell /bin/nologin systemd-journal-upload"
366
367FILES_${PN}-analyze = "${bindir}/systemd-analyze"
368
369FILES_${PN}-initramfs = "/init"
370RDEPENDS_${PN}-initramfs = "${PN}"
371
372FILES_${PN}-gui = "${bindir}/systemadm"
373
374FILES_${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \
375 ${systemd_unitdir}/system/systemd-vconsole-setup.service \
376 ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service"
377
378RDEPENDS_${PN}-kernel-install += "bash"
379FILES_${PN}-kernel-install = "${bindir}/kernel-install \
380 ${sysconfdir}/kernel/ \
381 ${exec_prefix}/lib/kernel \
382 "
383FILES_${PN}-rpm-macros = "${exec_prefix}/lib/rpm \
384 "
385
386FILES_${PN}-zsh-completion = "${datadir}/zsh/site-functions"
387
388FILES_${PN}-binfmt = "${sysconfdir}/binfmt.d/ \
389 ${exec_prefix}/lib/binfmt.d \
390 ${rootlibexecdir}/systemd/systemd-binfmt \
391 ${systemd_unitdir}/system/proc-sys-fs-binfmt_misc.* \
392 ${systemd_unitdir}/system/systemd-binfmt.service"
393RRECOMMENDS_${PN}-binfmt = "kernel-module-binfmt-misc"
394
395RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts kbd-keymaps"
396
397
398FILES_${PN}-journal-gatewayd = "${rootlibexecdir}/systemd/systemd-journal-gatewayd \
399 ${systemd_system_unitdir}/systemd-journal-gatewayd.service \
400 ${systemd_system_unitdir}/systemd-journal-gatewayd.socket \
401 ${systemd_system_unitdir}/sockets.target.wants/systemd-journal-gatewayd.socket \
402 ${datadir}/systemd/gatewayd/browse.html \
403 "
404SYSTEMD_SERVICE_${PN}-journal-gatewayd = "systemd-journal-gatewayd.socket"
405
406FILES_${PN}-journal-upload = "${rootlibexecdir}/systemd/systemd-journal-upload \
407 ${systemd_system_unitdir}/systemd-journal-upload.service \
408 ${sysconfdir}/systemd/journal-upload.conf \
409 "
410SYSTEMD_SERVICE_${PN}-journal-upload = "systemd-journal-upload.service"
411
412FILES_${PN}-journal-remote = "${rootlibexecdir}/systemd/systemd-journal-remote \
413 ${sysconfdir}/systemd/journal-remote.conf \
414 ${systemd_system_unitdir}/systemd-journal-remote.service \
415 ${systemd_system_unitdir}/systemd-journal-remote.socket \
416 "
417SYSTEMD_SERVICE_${PN}-journal-remote = "systemd-journal-remote.socket"
418
419
420FILES_${PN}-container = "${sysconfdir}/dbus-1/system.d/org.freedesktop.import1.conf \
421 ${sysconfdir}/dbus-1/system.d/org.freedesktop.machine1.conf \
422 ${sysconfdir}/systemd/system/multi-user.target.wants/machines.target \
423 ${base_bindir}/machinectl \
424 ${bindir}/systemd-nspawn \
425 ${nonarch_libdir}/systemd/import-pubring.gpg \
426 ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.import1.busname \
427 ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.machine1.busname \
428 ${systemd_system_unitdir}/local-fs.target.wants/var-lib-machines.mount \
429 ${systemd_system_unitdir}/machines.target.wants/var-lib-machines.mount \
430 ${systemd_system_unitdir}/remote-fs.target.wants/var-lib-machines.mount \
431 ${systemd_system_unitdir}/machine.slice \
432 ${systemd_system_unitdir}/machines.target \
433 ${systemd_system_unitdir}/org.freedesktop.import1.busname \
434 ${systemd_system_unitdir}/org.freedesktop.machine1.busname \
435 ${systemd_system_unitdir}/systemd-importd.service \
436 ${systemd_system_unitdir}/systemd-machined.service \
437 ${systemd_system_unitdir}/dbus-org.freedesktop.machine1.service \
438 ${systemd_system_unitdir}/var-lib-machines.mount \
439 ${rootlibexecdir}/systemd/systemd-import \
440 ${rootlibexecdir}/systemd/systemd-importd \
441 ${rootlibexecdir}/systemd/systemd-machined \
442 ${rootlibexecdir}/systemd/systemd-pull \
443 ${exec_prefix}/lib/tmpfiles.d/systemd-nspawn.conf \
444 ${systemd_system_unitdir}/systemd-nspawn@.service \
445 ${libdir}/libnss_mymachines.so.2 \
446 ${datadir}/dbus-1/system-services/org.freedesktop.import1.service \
447 ${datadir}/dbus-1/system-services/org.freedesktop.machine1.service \
448 ${datadir}/dbus-1/system.d/org.freedesktop.import1.conf \
449 ${datadir}/dbus-1/system.d/org.freedesktop.machine1.conf \
450 ${datadir}/polkit-1/actions/org.freedesktop.import1.policy \
451 ${datadir}/polkit-1/actions/org.freedesktop.machine1.policy \
452 "
453
454RRECOMMENDS_${PN}-container += "\
455 ${PN}-journal-upload \
456 ${PN}-journal-remote \
457 ${PN}-journal-gatewayd \
458 "
459
460FILES_${PN}-extra-utils = "\
461 ${base_bindir}/systemd-escape \
462 ${base_bindir}/systemd-inhibit \
463 ${bindir}/systemd-detect-virt \
464 ${bindir}/systemd-path \
465 ${bindir}/systemd-run \
466 ${bindir}/systemd-cat \
467 ${bindir}/systemd-delta \
468 ${bindir}/systemd-cgls \
469 ${bindir}/systemd-cgtop \
470 ${bindir}/systemd-stdio-bridge \
471 ${base_bindir}/systemd-ask-password \
472 ${base_bindir}/systemd-tty-ask-password-agent \
473 ${systemd_unitdir}/system/systemd-ask-password-console.path \
474 ${systemd_unitdir}/system/systemd-ask-password-console.service \
475 ${systemd_unitdir}/system/systemd-ask-password-wall.path \
476 ${systemd_unitdir}/system/systemd-ask-password-wall.service \
477 ${systemd_unitdir}/system/sysinit.target.wants/systemd-ask-password-console.path \
478 ${systemd_unitdir}/system/sysinit.target.wants/systemd-ask-password-wall.path \
479 ${systemd_unitdir}/system/multi-user.target.wants/systemd-ask-password-wall.path \
480 ${rootlibexecdir}/systemd/systemd-resolve-host \
481 ${rootlibexecdir}/systemd/systemd-ac-power \
482 ${rootlibexecdir}/systemd/systemd-activate \
483 ${rootlibexecdir}/systemd/systemd-bus-proxyd \
484 ${systemd_unitdir}/system/systemd-bus-proxyd.service \
485 ${systemd_unitdir}/system/systemd-bus-proxyd.socket \
486 ${rootlibexecdir}/systemd/systemd-socket-proxyd \
487 ${rootlibexecdir}/systemd/systemd-reply-password \
488 ${rootlibexecdir}/systemd/systemd-sleep \
489 ${rootlibexecdir}/systemd/system-sleep \
490 ${systemd_unitdir}/system/systemd-hibernate.service \
491 ${systemd_unitdir}/system/systemd-hybrid-sleep.service \
492 ${systemd_unitdir}/system/systemd-suspend.service \
493 ${systemd_unitdir}/system/sleep.target \
494 ${rootlibexecdir}/systemd/systemd-initctl \
495 ${systemd_unitdir}/system/systemd-initctl.service \
496 ${systemd_unitdir}/system/systemd-initctl.socket \
497 ${systemd_unitdir}/system/sockets.target.wants/systemd-initctl.socket \
498 ${rootlibexecdir}/systemd/system-generators/systemd-gpt-auto-generator \
499 ${rootlibexecdir}/systemd/systemd-cgroups-agent \
500"
501
502CONFFILES_${PN} = "${sysconfdir}/systemd/coredump.conf \
503 ${sysconfdir}/systemd/journald.conf \
504 ${sysconfdir}/systemd/logind.conf \
505 ${sysconfdir}/systemd/networkd.conf \
506 ${sysconfdir}/systemd/pstore.conf \
507 ${sysconfdir}/systemd/resolved.conf \
508 ${sysconfdir}/systemd/sleep.conf \
509 ${sysconfdir}/systemd/system.conf \
510 ${sysconfdir}/systemd/timesyncd.conf \
511 ${sysconfdir}/systemd/user.conf \
512"
513
514FILES_${PN} = " ${base_bindir}/* \
515 ${base_sbindir}/shutdown \
516 ${base_sbindir}/halt \
517 ${base_sbindir}/poweroff \
518 ${base_sbindir}/runlevel \
519 ${base_sbindir}/telinit \
520 ${base_sbindir}/resolvconf \
521 ${base_sbindir}/reboot \
522 ${base_sbindir}/init \
523 ${datadir}/dbus-1/services \
524 ${datadir}/dbus-1/system-services \
525 ${datadir}/polkit-1 \
526 ${datadir}/${BPN} \
527 ${datadir}/factory \
528 ${sysconfdir}/dbus-1/ \
529 ${sysconfdir}/modules-load.d/ \
530 ${sysconfdir}/pam.d/ \
531 ${sysconfdir}/sysctl.d/ \
532 ${sysconfdir}/systemd/ \
533 ${sysconfdir}/tmpfiles.d/ \
534 ${sysconfdir}/xdg/ \
535 ${sysconfdir}/init.d/README \
536 ${sysconfdir}/resolv-conf.systemd \
537 ${sysconfdir}/X11/xinit/xinitrc.d/* \
538 ${rootlibexecdir}/systemd/* \
539 ${systemd_unitdir}/* \
540 ${base_libdir}/security/*.so \
541 /cgroup \
542 ${bindir}/systemd* \
543 ${bindir}/busctl \
544 ${bindir}/coredumpctl \
545 ${bindir}/localectl \
546 ${bindir}/hostnamectl \
547 ${bindir}/resolvectl \
548 ${bindir}/timedatectl \
549 ${bindir}/bootctl \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500550 ${exec_prefix}/lib/tmpfiles.d/*.conf \
551 ${exec_prefix}/lib/systemd \
552 ${exec_prefix}/lib/modules-load.d \
553 ${exec_prefix}/lib/sysctl.d \
554 ${exec_prefix}/lib/sysusers.d \
555 ${exec_prefix}/lib/environment.d \
556 ${localstatedir} \
557 ${rootlibexecdir}/udev/rules.d/70-uaccess.rules \
558 ${rootlibexecdir}/udev/rules.d/71-seat.rules \
559 ${rootlibexecdir}/udev/rules.d/73-seat-late.rules \
560 ${rootlibexecdir}/udev/rules.d/99-systemd.rules \
561 ${rootlibexecdir}/modprobe.d/systemd.conf \
562 ${datadir}/dbus-1/system.d/org.freedesktop.timedate1.conf \
563 ${datadir}/dbus-1/system.d/org.freedesktop.locale1.conf \
564 ${datadir}/dbus-1/system.d/org.freedesktop.network1.conf \
565 ${datadir}/dbus-1/system.d/org.freedesktop.resolve1.conf \
566 ${datadir}/dbus-1/system.d/org.freedesktop.systemd1.conf \
567 ${datadir}/dbus-1/system.d/org.freedesktop.hostname1.conf \
568 ${datadir}/dbus-1/system.d/org.freedesktop.login1.conf \
569 ${datadir}/dbus-1/system.d/org.freedesktop.timesync1.conf \
570 ${datadir}/dbus-1/system.d/org.freedesktop.portable1.conf \
571 "
572
573FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
574
575RDEPENDS_${PN} += "kmod dbus util-linux-mount util-linux-umount udev (= ${EXTENDPKGV}) util-linux-agetty util-linux-fsck"
576RDEPENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', '', 'systemd-serialgetty', d)}"
577RDEPENDS_${PN} += "volatile-binds"
578
579RRECOMMENDS_${PN} += "systemd-extra-utils \
580 udev-hwdb \
581 e2fsprogs-e2fsck \
582 kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 kernel-module-sch-fq-codel \
583 os-release \
584 systemd-conf \
585"
586
587INSANE_SKIP_${PN} += "dev-so libdir"
588INSANE_SKIP_${PN}-dbg += "libdir"
589INSANE_SKIP_${PN}-doc += " libdir"
590
591RPROVIDES_udev = "hotplug"
592
593RDEPENDS_udev-hwdb += "udev"
594
595FILES_udev += "${base_sbindir}/udevd \
596 ${rootlibexecdir}/systemd/network/99-default.link \
597 ${rootlibexecdir}/systemd/systemd-udevd \
598 ${rootlibexecdir}/udev/accelerometer \
599 ${rootlibexecdir}/udev/ata_id \
600 ${rootlibexecdir}/udev/cdrom_id \
601 ${rootlibexecdir}/udev/collect \
602 ${rootlibexecdir}/udev/fido_id \
603 ${rootlibexecdir}/udev/findkeyboards \
604 ${rootlibexecdir}/udev/keyboard-force-release.sh \
605 ${rootlibexecdir}/udev/keymap \
606 ${rootlibexecdir}/udev/mtd_probe \
607 ${rootlibexecdir}/udev/scsi_id \
608 ${rootlibexecdir}/udev/v4l_id \
609 ${rootlibexecdir}/udev/keymaps \
610 ${rootlibexecdir}/udev/rules.d/50-udev-default.rules \
Andrew Geissler635e0e42020-08-21 15:58:33 -0500611 ${rootlibexecdir}/udev/rules.d/60-autosuspend.rules \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500612 ${rootlibexecdir}/udev/rules.d/60-autosuspend-chromiumos.rules \
613 ${rootlibexecdir}/udev/rules.d/60-block.rules \
614 ${rootlibexecdir}/udev/rules.d/60-cdrom_id.rules \
615 ${rootlibexecdir}/udev/rules.d/60-drm.rules \
616 ${rootlibexecdir}/udev/rules.d/60-evdev.rules \
617 ${rootlibexecdir}/udev/rules.d/60-fido-id.rules \
618 ${rootlibexecdir}/udev/rules.d/60-input-id.rules \
619 ${rootlibexecdir}/udev/rules.d/60-persistent-alsa.rules \
620 ${rootlibexecdir}/udev/rules.d/60-persistent-input.rules \
621 ${rootlibexecdir}/udev/rules.d/60-persistent-storage.rules \
622 ${rootlibexecdir}/udev/rules.d/60-persistent-storage-tape.rules \
623 ${rootlibexecdir}/udev/rules.d/60-persistent-v4l.rules \
624 ${rootlibexecdir}/udev/rules.d/60-sensor.rules \
625 ${rootlibexecdir}/udev/rules.d/60-serial.rules \
626 ${rootlibexecdir}/udev/rules.d/61-autosuspend-manual.rules \
627 ${rootlibexecdir}/udev/rules.d/64-btrfs.rules \
628 ${rootlibexecdir}/udev/rules.d/70-joystick.rules \
629 ${rootlibexecdir}/udev/rules.d/70-mouse.rules \
630 ${rootlibexecdir}/udev/rules.d/70-power-switch.rules \
631 ${rootlibexecdir}/udev/rules.d/70-touchpad.rules \
632 ${rootlibexecdir}/udev/rules.d/75-net-description.rules \
633 ${rootlibexecdir}/udev/rules.d/75-probe_mtd.rules \
634 ${rootlibexecdir}/udev/rules.d/78-sound-card.rules \
635 ${rootlibexecdir}/udev/rules.d/80-drivers.rules \
636 ${rootlibexecdir}/udev/rules.d/80-net-setup-link.rules \
637 ${rootlibexecdir}/udev/rules.d/90-vconsole.rules \
638 ${sysconfdir}/udev \
639 ${sysconfdir}/init.d/systemd-udevd \
640 ${systemd_unitdir}/system/*udev* \
641 ${systemd_unitdir}/system/*.wants/*udev* \
642 ${base_bindir}/systemd-hwdb \
643 ${base_bindir}/udevadm \
644 ${base_sbindir}/udevadm \
645 ${libexecdir}/${MLPREFIX}udevadm \
646 ${datadir}/bash-completion/completions/udevadm \
647 ${systemd_unitdir}/system/systemd-hwdb-update.service \
648 "
649
650FILES_udev-hwdb = "${rootlibexecdir}/udev/hwdb.d \
651 "
652
653RCONFLICTS_${PN} = "tiny-init ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'resolvconf', '', d)}"
654
655INITSCRIPT_PACKAGES = "udev"
656INITSCRIPT_NAME_udev = "systemd-udevd"
657INITSCRIPT_PARAMS_udev = "start 03 S ."
658
659python __anonymous() {
660 if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
661 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
662}
663
664python do_warn_musl() {
665 if d.getVar('TCLIBC') == "musl":
666 bb.warn("Using systemd with musl is not recommended since it is not supported upstream and some patches are known to be problematic.")
667}
668addtask warn_musl before do_configure
669
670ALTERNATIVE_${PN} = "halt reboot shutdown poweroff runlevel ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'resolv-conf', '', d)}"
671
672ALTERNATIVE_TARGET[resolv-conf] = "${sysconfdir}/resolv-conf.systemd"
673ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/resolv.conf"
674ALTERNATIVE_PRIORITY[resolv-conf] ?= "50"
675
676ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl"
677ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt"
678ALTERNATIVE_PRIORITY[halt] ?= "300"
679
680ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl"
681ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
682ALTERNATIVE_PRIORITY[reboot] ?= "300"
683
684ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl"
685ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown"
686ALTERNATIVE_PRIORITY[shutdown] ?= "300"
687
688ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl"
689ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
690ALTERNATIVE_PRIORITY[poweroff] ?= "300"
691
692ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"
693ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
694ALTERNATIVE_PRIORITY[runlevel] ?= "300"
695
696pkg_postinst_${PN}_libc-glibc () {
697 sed -e '/^hosts:/s/\s*\<myhostname\>//' \
698 -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \
699 -i $D${sysconfdir}/nsswitch.conf
700}
701
702pkg_prerm_${PN}_libc-glibc () {
703 sed -e '/^hosts:/s/\s*\<myhostname\>//' \
704 -e '/^hosts:/s/\s*myhostname//' \
705 -i $D${sysconfdir}/nsswitch.conf
706}
707
708PACKAGE_WRITE_DEPS += "qemu-native"
709pkg_postinst_udev-hwdb () {
710 if test -n "$D"; then
711 $INTERCEPT_DIR/postinst_intercept update_udev_hwdb ${PKG} mlprefix=${MLPREFIX} binprefix=${MLPREFIX} rootlibexecdir="${rootlibexecdir}" PREFERRED_PROVIDER_udev="${PREFERRED_PROVIDER_udev}"
712 else
713 udevadm hwdb --update
714 fi
715}
716
717pkg_prerm_udev-hwdb () {
718 rm -f $D${sysconfdir}/udev/hwdb.bin
719}