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