blob: cdafb982475a81906a5dd37ce4e934ed0530f5c6 [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 Geisslerd25ed322020-06-27 00:28:28 -050023 file://CVE-2020-13776.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 \
46 file://0024-test-json.c-define-M_PIl.patch \
47 file://0001-do-not-disable-buffer-in-writing-files.patch \
48 file://0002-src-login-brightness.c-include-sys-wait.h.patch \
49 file://0003-src-basic-copy.c-include-signal.h.patch \
50 file://0004-src-shared-cpu-set-util.h-add-__cpu_mask-definition.patch \
51 file://0001-Handle-missing-gshadow.patch \
52 "
53
54PAM_PLUGINS = " \
55 pam-plugin-unix \
56 pam-plugin-loginuid \
57 pam-plugin-keyinit \
58"
59
60PACKAGECONFIG ??= " \
61 ${@bb.utils.filter('DISTRO_FEATURES', 'acl audit efi ldconfig pam selinux smack usrmerge polkit', d)} \
62 ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \
63 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \
64 backlight \
65 binfmt \
66 gshadow \
67 hibernate \
68 hostnamed \
69 idn \
70 ima \
71 kmod \
72 localed \
73 logind \
74 machined \
75 myhostname \
76 networkd \
77 nss \
78 nss-mymachines \
79 nss-resolve \
80 quotacheck \
81 randomseed \
82 resolved \
83 set-time-epoch \
84 sysusers \
85 sysvinit \
86 timedated \
87 timesyncd \
88 userdb \
89 utmp \
90 vconsole \
91 xz \
92"
93
94PACKAGECONFIG_remove_libc-musl = " \
95 gshadow \
96 idn \
97 localed \
98 myhostname \
99 nss \
100 nss-mymachines \
101 nss-resolve \
102 sysusers \
103 userdb \
104 utmp \
105"
106
107CFLAGS_append_libc-musl = " -D__UAPI_DEF_ETHHDR=0 "
108
109# Use the upstream systemd serial-getty@.service and rely on
110# systemd-getty-generator instead of using the OE-core specific
111# systemd-serialgetty.bb - not enabled by default.
112PACKAGECONFIG[serial-getty-generator] = ""
113
114PACKAGECONFIG[acl] = "-Dacl=true,-Dacl=false,acl"
115PACKAGECONFIG[audit] = "-Daudit=true,-Daudit=false,audit"
116PACKAGECONFIG[backlight] = "-Dbacklight=true,-Dbacklight=false"
117PACKAGECONFIG[binfmt] = "-Dbinfmt=true,-Dbinfmt=false"
118PACKAGECONFIG[bzip2] = "-Dbzip2=true,-Dbzip2=false,bzip2"
119PACKAGECONFIG[cgroupv2] = "-Ddefault-hierarchy=unified,-Ddefault-hierarchy=hybrid"
120PACKAGECONFIG[coredump] = "-Dcoredump=true,-Dcoredump=false"
121PACKAGECONFIG[cryptsetup] = "-Dlibcryptsetup=true,-Dlibcryptsetup=false,cryptsetup"
122PACKAGECONFIG[dbus] = "-Ddbus=true,-Ddbus=false,dbus"
123PACKAGECONFIG[efi] = "-Defi=true,-Defi=false"
124PACKAGECONFIG[gnu-efi] = "-Dgnu-efi=true -Defi-libdir=${STAGING_LIBDIR} -Defi-includedir=${STAGING_INCDIR}/efi,-Dgnu-efi=false,gnu-efi"
125PACKAGECONFIG[elfutils] = "-Delfutils=true,-Delfutils=false,elfutils"
126PACKAGECONFIG[firstboot] = "-Dfirstboot=true,-Dfirstboot=false"
127# Sign the journal for anti-tampering
128PACKAGECONFIG[gcrypt] = "-Dgcrypt=true,-Dgcrypt=false,libgcrypt"
129PACKAGECONFIG[gnutls] = "-Dgnutls=true,-Dgnutls=false,gnutls"
130PACKAGECONFIG[gshadow] = "-Dgshadow=true,-Dgshadow=false"
131PACKAGECONFIG[hibernate] = "-Dhibernate=true,-Dhibernate=false"
132PACKAGECONFIG[hostnamed] = "-Dhostnamed=true,-Dhostnamed=false"
133PACKAGECONFIG[idn] = "-Didn=true,-Didn=false"
134PACKAGECONFIG[ima] = "-Dima=true,-Dima=false"
135# importd requires curl/xz/zlib/bzip2/gcrypt
136PACKAGECONFIG[importd] = "-Dimportd=true,-Dimportd=false"
137# Update NAT firewall rules
138PACKAGECONFIG[iptc] = "-Dlibiptc=true,-Dlibiptc=false,iptables"
139PACKAGECONFIG[journal-upload] = "-Dlibcurl=true,-Dlibcurl=false,curl"
140PACKAGECONFIG[kmod] = "-Dkmod=true,-Dkmod=false,kmod"
141PACKAGECONFIG[ldconfig] = "-Dldconfig=true,-Dldconfig=false,,ldconfig"
142PACKAGECONFIG[libidn] = "-Dlibidn=true,-Dlibidn=false,libidn"
143PACKAGECONFIG[libidn2] = "-Dlibidn2=true,-Dlibidn2=false,libidn2"
144PACKAGECONFIG[localed] = "-Dlocaled=true,-Dlocaled=false"
145PACKAGECONFIG[logind] = "-Dlogind=true,-Dlogind=false"
146PACKAGECONFIG[lz4] = "-Dlz4=true,-Dlz4=false,lz4"
147PACKAGECONFIG[machined] = "-Dmachined=true,-Dmachined=false"
148PACKAGECONFIG[manpages] = "-Dman=true,-Dman=false,libxslt-native xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
149PACKAGECONFIG[microhttpd] = "-Dmicrohttpd=true,-Dmicrohttpd=false,libmicrohttpd"
150PACKAGECONFIG[myhostname] = "-Dnss-myhostname=true,-Dnss-myhostname=false,,libnss-myhostname"
151PACKAGECONFIG[networkd] = "-Dnetworkd=true,-Dnetworkd=false"
152PACKAGECONFIG[nss] = "-Dnss-systemd=true,-Dnss-systemd=false"
153PACKAGECONFIG[nss-mymachines] = "-Dnss-mymachines=true,-Dnss-mymachines=false"
154PACKAGECONFIG[nss-resolve] = "-Dnss-resolve=true,-Dnss-resolve=false"
155PACKAGECONFIG[openssl] = "-Dopenssl=true,-Dopenssl=false,openssl"
156PACKAGECONFIG[pam] = "-Dpam=true,-Dpam=false,libpam,${PAM_PLUGINS}"
157PACKAGECONFIG[pcre2] = "-Dpcre2=true,-Dpcre2=false,libpcre2"
158PACKAGECONFIG[polkit] = "-Dpolkit=true,-Dpolkit=false"
159PACKAGECONFIG[portabled] = "-Dportabled=true,-Dportabled=false"
160PACKAGECONFIG[qrencode] = "-Dqrencode=true,-Dqrencode=false,qrencode"
161PACKAGECONFIG[quotacheck] = "-Dquotacheck=true,-Dquotacheck=false"
162PACKAGECONFIG[randomseed] = "-Drandomseed=true,-Drandomseed=false"
163PACKAGECONFIG[resolved] = "-Dresolve=true,-Dresolve=false"
164PACKAGECONFIG[rfkill] = "-Drfkill=true,-Drfkill=false"
165# libseccomp is found in meta-security
166PACKAGECONFIG[seccomp] = "-Dseccomp=true,-Dseccomp=false,libseccomp"
167PACKAGECONFIG[selinux] = "-Dselinux=true,-Dselinux=false,libselinux,initscripts-sushell"
168PACKAGECONFIG[smack] = "-Dsmack=true,-Dsmack=false"
169PACKAGECONFIG[sysusers] = "-Dsysusers=true,-Dsysusers=false"
170PACKAGECONFIG[sysvinit] = "-Dsysvinit-path=${sysconfdir}/init.d -Dsysvrcnd-path=${sysconfdir},-Dsysvinit-path= -Dsysvrcnd-path=,,systemd-compat-units update-rc.d"
171# When enabled use reproducble build timestamp if set as time epoch,
172# or build time if not. When disabled, time epoch is unset.
173def build_epoch(d):
174 epoch = d.getVar('SOURCE_DATE_EPOCH') or "-1"
175 return '-Dtime-epoch=%d' % int(epoch)
176PACKAGECONFIG[set-time-epoch] = "${@build_epoch(d)},-Dtime-epoch=0"
177PACKAGECONFIG[timedated] = "-Dtimedated=true,-Dtimedated=false"
178PACKAGECONFIG[timesyncd] = "-Dtimesyncd=true,-Dtimesyncd=false"
179PACKAGECONFIG[usrmerge] = "-Dsplit-usr=false,-Dsplit-usr=true"
180PACKAGECONFIG[sbinmerge] = "-Dsplit-bin=false,-Dsplit-bin=true"
181PACKAGECONFIG[userdb] = "-Duserdb=true,-Duserdb=false"
182PACKAGECONFIG[utmp] = "-Dutmp=true,-Dutmp=false"
183PACKAGECONFIG[valgrind] = "-DVALGRIND=1,,valgrind"
184PACKAGECONFIG[vconsole] = "-Dvconsole=true,-Dvconsole=false,,${PN}-vconsole-setup"
185# Verify keymaps on locale change
186PACKAGECONFIG[xkbcommon] = "-Dxkbcommon=true,-Dxkbcommon=false,libxkbcommon"
187PACKAGECONFIG[xz] = "-Dxz=true,-Dxz=false,xz"
188PACKAGECONFIG[zlib] = "-Dzlib=true,-Dzlib=false,zlib"
189
190# Helper variables to clarify locations. This mirrors the logic in systemd's
191# build system.
192rootprefix ?= "${root_prefix}"
193rootlibdir ?= "${base_libdir}"
194rootlibexecdir = "${rootprefix}/lib"
195
196# This links udev statically with systemd helper library.
197# Otherwise udev package would depend on systemd package (which has the needed shared library),
198# and always pull it into images.
199EXTRA_OEMESON += "-Dlink-udev-shared=false"
200
201EXTRA_OEMESON += "-Dnobody-user=nobody \
202 -Dnobody-group=nobody \
203 -Drootlibdir=${rootlibdir} \
204 -Drootprefix=${rootprefix} \
205 -Ddefault-locale=C \
206 "
207
208# Hardcode target binary paths to avoid using paths from sysroot
209EXTRA_OEMESON += "-Dkexec-path=${sbindir}/kexec \
210 -Dkmod-path=${base_bindir}/kmod \
211 -Dmount-path=${base_bindir}/mount \
212 -Dquotacheck-path=${sbindir}/quotacheck \
213 -Dquotaon-path=${sbindir}/quotaon \
214 -Dsulogin-path=${base_sbindir}/sulogin \
215 -Dnologin-path=${base_sbindir}/nologin \
216 -Dumount-path=${base_bindir}/umount"
217
218do_install() {
219 meson_do_install
220 install -d ${D}/${base_sbindir}
221 if ${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', 'false', 'true', d)}; then
222 # Provided by a separate recipe
223 rm ${D}${systemd_unitdir}/system/serial-getty* -f
224 fi
225
226 # Provide support for initramfs
227 [ ! -e ${D}/init ] && ln -s ${rootlibexecdir}/systemd/systemd ${D}/init
228 [ ! -e ${D}/${base_sbindir}/udevd ] && ln -s ${rootlibexecdir}/systemd/systemd-udevd ${D}/${base_sbindir}/udevd
229
230 install -d ${D}${sysconfdir}/udev/rules.d/
231 install -d ${D}${sysconfdir}/tmpfiles.d
232 install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/
233
234 install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
235
236 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
237 install -d ${D}${sysconfdir}/init.d
238 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd
239 sed -i s%@UDEVD@%${rootlibexecdir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd
240 install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${systemd_unitdir}/systemd-sysv-install
241 fi
242
243 chown root:systemd-journal ${D}/${localstatedir}/log/journal
244
245 # Delete journal README, as log can be symlinked inside volatile.
246 rm -f ${D}/${localstatedir}/log/README
247
248 # journal-remote creates this at start
249 rm -rf ${D}/${localstatedir}/log/journal/remote
250
251 install -d ${D}${systemd_unitdir}/system/graphical.target.wants
252 install -d ${D}${systemd_unitdir}/system/multi-user.target.wants
253 install -d ${D}${systemd_unitdir}/system/poweroff.target.wants
254 install -d ${D}${systemd_unitdir}/system/reboot.target.wants
255 install -d ${D}${systemd_unitdir}/system/rescue.target.wants
256
257 # Create symlinks for systemd-update-utmp-runlevel.service
258 if ${@bb.utils.contains('PACKAGECONFIG', 'utmp', 'true', 'false', d)}; then
259 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/graphical.target.wants/systemd-update-utmp-runlevel.service
260 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/multi-user.target.wants/systemd-update-utmp-runlevel.service
261 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/poweroff.target.wants/systemd-update-utmp-runlevel.service
262 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/reboot.target.wants/systemd-update-utmp-runlevel.service
263 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/rescue.target.wants/systemd-update-utmp-runlevel.service
264 fi
265
266 # this file is needed to exist if networkd is disabled but timesyncd is still in use since timesyncd checks it
267 # for existence else it fails
268 if [ -s ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf ]; then
269 ${@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)}
270 fi
271 if ! ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'true', 'false', d)}; then
272 echo 'L! ${sysconfdir}/resolv.conf - - - - ../run/systemd/resolve/resolv.conf' >>${D}${exec_prefix}/lib/tmpfiles.d/etc.conf
273 echo 'd /run/systemd/resolve 0755 root root -' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
274 echo 'f /run/systemd/resolve/resolv.conf 0644 root root' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
275 ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd
276 else
277 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
278 ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd
279 fi
280 if ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'false', 'true', d)}; then
281 rm ${D}${exec_prefix}/lib/tmpfiles.d/x11.conf
282 rm -r ${D}${sysconfdir}/X11
283 fi
284
285 # If polkit is setup fixup permissions and ownership
286 if ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'true', 'false', d)}; then
287 if [ -d ${D}${datadir}/polkit-1/rules.d ]; then
288 chmod 700 ${D}${datadir}/polkit-1/rules.d
289 chown polkitd:root ${D}${datadir}/polkit-1/rules.d
290 fi
291 fi
292
293 # create link for existing udev rules
294 ln -s ${base_bindir}/udevadm ${D}${base_sbindir}/udevadm
295
296 # duplicate udevadm for postinst script
297 install -d ${D}${libexecdir}
298 ln ${D}${base_bindir}/udevadm ${D}${libexecdir}/${MLPREFIX}udevadm
299
300 # install default policy for presets
301 # https://www.freedesktop.org/wiki/Software/systemd/Preset/#howto
302 install -Dm 0644 ${WORKDIR}/99-default.preset ${D}${systemd_unitdir}/system-preset/99-default.preset
303}
304
305python populate_packages_prepend (){
306 systemdlibdir = d.getVar("rootlibdir")
307 do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True)
308}
309PACKAGES_DYNAMIC += "^lib(udev|systemd|nss).*"
310
311PACKAGE_BEFORE_PN = "\
312 ${PN}-gui \
313 ${PN}-vconsole-setup \
314 ${PN}-initramfs \
315 ${PN}-analyze \
316 ${PN}-kernel-install \
317 ${PN}-rpm-macros \
318 ${PN}-binfmt \
319 ${PN}-zsh-completion \
320 ${PN}-container \
321 ${PN}-journal-gatewayd \
322 ${PN}-journal-upload \
323 ${PN}-journal-remote \
324 ${PN}-extra-utils \
325 udev \
326 udev-hwdb \
327"
328
329SUMMARY_${PN}-container = "Tools for containers and VMs"
330DESCRIPTION_${PN}-container = "Systemd tools to spawn and manage containers and virtual machines."
331
332SUMMARY_${PN}-journal-gatewayd = "HTTP server for journal events"
333DESCRIPTION_${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."
334
335SUMMARY_${PN}-journal-upload = "Send journal messages over the network"
336DESCRIPTION_${PN}-journal-upload = "systemd-journal-upload uploads journal entries to a specified URL."
337
338SUMMARY_${PN}-journal-remote = "Receive journal messages over the network"
339DESCRIPTION_${PN}-journal-remote = "systemd-journal-remote is a command to receive serialized journal events and store them to journal files."
340
341SYSTEMD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'binfmt', '${PN}-binfmt', '', d)} \
342 ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-gatewayd', '', d)} \
343 ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-remote', '', d)} \
344 ${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '${PN}-journal-upload', '', d)} \
345"
346SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service"
347
348USERADD_PACKAGES = "${PN} ${PN}-extra-utils \
349 ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-gateway', '', d)} \
350 ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-remote', '', d)} \
351 ${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '${PN}-journal-upload', '', d)} \
352"
353GROUPADD_PARAM_${PN} = "-r systemd-journal"
354USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'coredump', '--system -d / -M --shell /bin/nologin systemd-coredump;', '', d)}"
355USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'networkd', '--system -d / -M --shell /bin/nologin systemd-network;', '', d)}"
356USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'polkit', '--system --no-create-home --user-group --home-dir ${sysconfdir}/polkit-1 polkitd;', '', d)}"
357USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'resolved', '--system -d / -M --shell /bin/nologin systemd-resolve;', '', d)}"
358USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'timesyncd', '--system -d / -M --shell /bin/nologin systemd-timesync;', '', d)}"
359USERADD_PARAM_${PN}-extra-utils = "--system -d / -M --shell /bin/nologin systemd-bus-proxy"
360USERADD_PARAM_${PN}-journal-gateway = "--system -d / -M --shell /bin/nologin systemd-journal-gateway"
361USERADD_PARAM_${PN}-journal-remote = "--system -d / -M --shell /bin/nologin systemd-journal-remote"
362USERADD_PARAM_${PN}-journal-upload = "--system -d / -M --shell /bin/nologin systemd-journal-upload"
363
364FILES_${PN}-analyze = "${bindir}/systemd-analyze"
365
366FILES_${PN}-initramfs = "/init"
367RDEPENDS_${PN}-initramfs = "${PN}"
368
369FILES_${PN}-gui = "${bindir}/systemadm"
370
371FILES_${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \
372 ${systemd_unitdir}/system/systemd-vconsole-setup.service \
373 ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service"
374
375RDEPENDS_${PN}-kernel-install += "bash"
376FILES_${PN}-kernel-install = "${bindir}/kernel-install \
377 ${sysconfdir}/kernel/ \
378 ${exec_prefix}/lib/kernel \
379 "
380FILES_${PN}-rpm-macros = "${exec_prefix}/lib/rpm \
381 "
382
383FILES_${PN}-zsh-completion = "${datadir}/zsh/site-functions"
384
385FILES_${PN}-binfmt = "${sysconfdir}/binfmt.d/ \
386 ${exec_prefix}/lib/binfmt.d \
387 ${rootlibexecdir}/systemd/systemd-binfmt \
388 ${systemd_unitdir}/system/proc-sys-fs-binfmt_misc.* \
389 ${systemd_unitdir}/system/systemd-binfmt.service"
390RRECOMMENDS_${PN}-binfmt = "kernel-module-binfmt-misc"
391
392RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts kbd-keymaps"
393
394
395FILES_${PN}-journal-gatewayd = "${rootlibexecdir}/systemd/systemd-journal-gatewayd \
396 ${systemd_system_unitdir}/systemd-journal-gatewayd.service \
397 ${systemd_system_unitdir}/systemd-journal-gatewayd.socket \
398 ${systemd_system_unitdir}/sockets.target.wants/systemd-journal-gatewayd.socket \
399 ${datadir}/systemd/gatewayd/browse.html \
400 "
401SYSTEMD_SERVICE_${PN}-journal-gatewayd = "systemd-journal-gatewayd.socket"
402
403FILES_${PN}-journal-upload = "${rootlibexecdir}/systemd/systemd-journal-upload \
404 ${systemd_system_unitdir}/systemd-journal-upload.service \
405 ${sysconfdir}/systemd/journal-upload.conf \
406 "
407SYSTEMD_SERVICE_${PN}-journal-upload = "systemd-journal-upload.service"
408
409FILES_${PN}-journal-remote = "${rootlibexecdir}/systemd/systemd-journal-remote \
410 ${sysconfdir}/systemd/journal-remote.conf \
411 ${systemd_system_unitdir}/systemd-journal-remote.service \
412 ${systemd_system_unitdir}/systemd-journal-remote.socket \
413 "
414SYSTEMD_SERVICE_${PN}-journal-remote = "systemd-journal-remote.socket"
415
416
417FILES_${PN}-container = "${sysconfdir}/dbus-1/system.d/org.freedesktop.import1.conf \
418 ${sysconfdir}/dbus-1/system.d/org.freedesktop.machine1.conf \
419 ${sysconfdir}/systemd/system/multi-user.target.wants/machines.target \
420 ${base_bindir}/machinectl \
421 ${bindir}/systemd-nspawn \
422 ${nonarch_libdir}/systemd/import-pubring.gpg \
423 ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.import1.busname \
424 ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.machine1.busname \
425 ${systemd_system_unitdir}/local-fs.target.wants/var-lib-machines.mount \
426 ${systemd_system_unitdir}/machines.target.wants/var-lib-machines.mount \
427 ${systemd_system_unitdir}/remote-fs.target.wants/var-lib-machines.mount \
428 ${systemd_system_unitdir}/machine.slice \
429 ${systemd_system_unitdir}/machines.target \
430 ${systemd_system_unitdir}/org.freedesktop.import1.busname \
431 ${systemd_system_unitdir}/org.freedesktop.machine1.busname \
432 ${systemd_system_unitdir}/systemd-importd.service \
433 ${systemd_system_unitdir}/systemd-machined.service \
434 ${systemd_system_unitdir}/dbus-org.freedesktop.machine1.service \
435 ${systemd_system_unitdir}/var-lib-machines.mount \
436 ${rootlibexecdir}/systemd/systemd-import \
437 ${rootlibexecdir}/systemd/systemd-importd \
438 ${rootlibexecdir}/systemd/systemd-machined \
439 ${rootlibexecdir}/systemd/systemd-pull \
440 ${exec_prefix}/lib/tmpfiles.d/systemd-nspawn.conf \
441 ${systemd_system_unitdir}/systemd-nspawn@.service \
442 ${libdir}/libnss_mymachines.so.2 \
443 ${datadir}/dbus-1/system-services/org.freedesktop.import1.service \
444 ${datadir}/dbus-1/system-services/org.freedesktop.machine1.service \
445 ${datadir}/dbus-1/system.d/org.freedesktop.import1.conf \
446 ${datadir}/dbus-1/system.d/org.freedesktop.machine1.conf \
447 ${datadir}/polkit-1/actions/org.freedesktop.import1.policy \
448 ${datadir}/polkit-1/actions/org.freedesktop.machine1.policy \
449 "
450
451RRECOMMENDS_${PN}-container += "\
452 ${PN}-journal-upload \
453 ${PN}-journal-remote \
454 ${PN}-journal-gatewayd \
455 "
456
457FILES_${PN}-extra-utils = "\
458 ${base_bindir}/systemd-escape \
459 ${base_bindir}/systemd-inhibit \
460 ${bindir}/systemd-detect-virt \
461 ${bindir}/systemd-path \
462 ${bindir}/systemd-run \
463 ${bindir}/systemd-cat \
464 ${bindir}/systemd-delta \
465 ${bindir}/systemd-cgls \
466 ${bindir}/systemd-cgtop \
467 ${bindir}/systemd-stdio-bridge \
468 ${base_bindir}/systemd-ask-password \
469 ${base_bindir}/systemd-tty-ask-password-agent \
470 ${systemd_unitdir}/system/systemd-ask-password-console.path \
471 ${systemd_unitdir}/system/systemd-ask-password-console.service \
472 ${systemd_unitdir}/system/systemd-ask-password-wall.path \
473 ${systemd_unitdir}/system/systemd-ask-password-wall.service \
474 ${systemd_unitdir}/system/sysinit.target.wants/systemd-ask-password-console.path \
475 ${systemd_unitdir}/system/sysinit.target.wants/systemd-ask-password-wall.path \
476 ${systemd_unitdir}/system/multi-user.target.wants/systemd-ask-password-wall.path \
477 ${rootlibexecdir}/systemd/systemd-resolve-host \
478 ${rootlibexecdir}/systemd/systemd-ac-power \
479 ${rootlibexecdir}/systemd/systemd-activate \
480 ${rootlibexecdir}/systemd/systemd-bus-proxyd \
481 ${systemd_unitdir}/system/systemd-bus-proxyd.service \
482 ${systemd_unitdir}/system/systemd-bus-proxyd.socket \
483 ${rootlibexecdir}/systemd/systemd-socket-proxyd \
484 ${rootlibexecdir}/systemd/systemd-reply-password \
485 ${rootlibexecdir}/systemd/systemd-sleep \
486 ${rootlibexecdir}/systemd/system-sleep \
487 ${systemd_unitdir}/system/systemd-hibernate.service \
488 ${systemd_unitdir}/system/systemd-hybrid-sleep.service \
489 ${systemd_unitdir}/system/systemd-suspend.service \
490 ${systemd_unitdir}/system/sleep.target \
491 ${rootlibexecdir}/systemd/systemd-initctl \
492 ${systemd_unitdir}/system/systemd-initctl.service \
493 ${systemd_unitdir}/system/systemd-initctl.socket \
494 ${systemd_unitdir}/system/sockets.target.wants/systemd-initctl.socket \
495 ${rootlibexecdir}/systemd/system-generators/systemd-gpt-auto-generator \
496 ${rootlibexecdir}/systemd/systemd-cgroups-agent \
497"
498
499CONFFILES_${PN} = "${sysconfdir}/systemd/coredump.conf \
500 ${sysconfdir}/systemd/journald.conf \
501 ${sysconfdir}/systemd/logind.conf \
502 ${sysconfdir}/systemd/networkd.conf \
503 ${sysconfdir}/systemd/pstore.conf \
504 ${sysconfdir}/systemd/resolved.conf \
505 ${sysconfdir}/systemd/sleep.conf \
506 ${sysconfdir}/systemd/system.conf \
507 ${sysconfdir}/systemd/timesyncd.conf \
508 ${sysconfdir}/systemd/user.conf \
509"
510
511FILES_${PN} = " ${base_bindir}/* \
512 ${base_sbindir}/shutdown \
513 ${base_sbindir}/halt \
514 ${base_sbindir}/poweroff \
515 ${base_sbindir}/runlevel \
516 ${base_sbindir}/telinit \
517 ${base_sbindir}/resolvconf \
518 ${base_sbindir}/reboot \
519 ${base_sbindir}/init \
520 ${datadir}/dbus-1/services \
521 ${datadir}/dbus-1/system-services \
522 ${datadir}/polkit-1 \
523 ${datadir}/${BPN} \
524 ${datadir}/factory \
525 ${sysconfdir}/dbus-1/ \
526 ${sysconfdir}/modules-load.d/ \
527 ${sysconfdir}/pam.d/ \
528 ${sysconfdir}/sysctl.d/ \
529 ${sysconfdir}/systemd/ \
530 ${sysconfdir}/tmpfiles.d/ \
531 ${sysconfdir}/xdg/ \
532 ${sysconfdir}/init.d/README \
533 ${sysconfdir}/resolv-conf.systemd \
534 ${sysconfdir}/X11/xinit/xinitrc.d/* \
535 ${rootlibexecdir}/systemd/* \
536 ${systemd_unitdir}/* \
537 ${base_libdir}/security/*.so \
538 /cgroup \
539 ${bindir}/systemd* \
540 ${bindir}/busctl \
541 ${bindir}/coredumpctl \
542 ${bindir}/localectl \
543 ${bindir}/hostnamectl \
544 ${bindir}/resolvectl \
545 ${bindir}/timedatectl \
546 ${bindir}/bootctl \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500547 ${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}