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