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