blob: 29f64b995a04787a5a225b7de692a55d8aaccc66 [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -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://0006-network-remove-redunant-link-name-in-message.patch \
26 file://99-default.preset \
Brad Bishop15ae2502019-06-18 21:44:24 -040027 file://0001-resolved-Fix-incorrect-use-of-OpenSSL-BUF_MEM.patch \
Brad Bishopc342db32019-05-15 21:57:59 -040028 "
29
30# patches needed by musl
Brad Bishop15ae2502019-06-18 21:44:24 -040031SRC_URI_append_libc-musl = " ${SRC_URI_MUSL}"
Brad Bishopc342db32019-05-15 21:57:59 -040032SRC_URI_MUSL = "file://0001-Use-getenv-when-secure-versions-are-not-available.patch \
33 file://0002-don-t-use-glibc-specific-qsort_r.patch \
34 file://0003-missing_type.h-add-__compare_fn_t-and-comparison_fn_.patch \
35 file://0004-add-fallback-parse_printf_format-implementation.patch \
36 file://0005-src-basic-missing.h-check-for-missing-strndupa.patch \
37 file://0006-Include-netinet-if_ether.h.patch \
38 file://0007-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not.patch \
39 file://0008-add-missing-FTW_-macros-for-musl.patch \
Brad Bishopc342db32019-05-15 21:57:59 -040040 file://0010-fix-missing-of-__register_atfork-for-non-glibc-build.patch \
41 file://0011-Use-uintmax_t-for-handling-rlim_t.patch \
Brad Bishop15ae2502019-06-18 21:44:24 -040042 file://0001-Replace-the-legacy-ULONG_LONG_MAX-with-the-C99-ULLON.patch \
Brad Bishopc342db32019-05-15 21:57:59 -040043 file://0014-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch \
44 file://0015-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch \
45 file://0016-Define-glibc-compatible-basename-for-non-glibc-syste.patch \
46 file://0017-Do-not-disable-buffering-when-writing-to-oom_score_a.patch \
47 file://0018-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch \
48 file://0019-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch \
49 file://0020-missing_type.h-add-__compar_d_fn_t-definition.patch \
50 file://0021-avoid-redefinition-of-prctl_mm_map-structure.patch \
Brad Bishop15ae2502019-06-18 21:44:24 -040051 file://0001-src-udev-udev-event.c-must-include-sys-wait.h.patch \
Brad Bishopc342db32019-05-15 21:57:59 -040052 file://0023-socket-util.h-include-string.h.patch \
53 file://0024-test-json.c-define-M_PIl.patch \
54 file://0025-fs-utilh-add-missing-sys-stat-include.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 gshadow \
72 hibernate \
73 hostnamed \
Brad Bishop393846f2019-05-20 12:24:11 -040074 idn \
Brad Bishopc342db32019-05-15 21:57:59 -040075 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 \
Brad Bishop393846f2019-05-20 12:24:11 -040099 idn \
Brad Bishopc342db32019-05-15 21:57:59 -0400100 localed \
101 myhostname \
102 nss \
103 nss-mymachines \
104 nss-resolve \
105 resolved \
106 smack \
107 sysusers \
108 utmp \
109"
110
111# Use the upstream systemd serial-getty@.service and rely on
112# systemd-getty-generator instead of using the OE-core specific
113# systemd-serialgetty.bb - not enabled by default.
114PACKAGECONFIG[serial-getty-generator] = ""
115
116PACKAGECONFIG[acl] = "-Dacl=true,-Dacl=false,acl"
117PACKAGECONFIG[audit] = "-Daudit=true,-Daudit=false,audit"
118PACKAGECONFIG[backlight] = "-Dbacklight=true,-Dbacklight=false"
119PACKAGECONFIG[binfmt] = "-Dbinfmt=true,-Dbinfmt=false"
120PACKAGECONFIG[bzip2] = "-Dbzip2=true,-Dbzip2=false,bzip2"
121PACKAGECONFIG[cgroupv2] = "-Ddefault-hierarchy=unified,-Ddefault-hierarchy=hybrid"
122PACKAGECONFIG[coredump] = "-Dcoredump=true,-Dcoredump=false"
123PACKAGECONFIG[cryptsetup] = "-Dlibcryptsetup=true,-Dlibcryptsetup=false,cryptsetup"
124PACKAGECONFIG[dbus] = "-Ddbus=true,-Ddbus=false,dbus"
125PACKAGECONFIG[efi] = "-Defi=true,-Defi=false"
126PACKAGECONFIG[elfutils] = "-Delfutils=true,-Delfutils=false,elfutils"
127PACKAGECONFIG[firstboot] = "-Dfirstboot=true,-Dfirstboot=false"
128# Sign the journal for anti-tampering
129PACKAGECONFIG[gcrypt] = "-Dgcrypt=true,-Dgcrypt=false,libgcrypt"
130PACKAGECONFIG[gnutls] = "-Dgnutls=true,-Dgnutls=false,gnutls"
131PACKAGECONFIG[gshadow] = "-Dgshadow=true,-Dgshadow=false"
132PACKAGECONFIG[hibernate] = "-Dhibernate=true,-Dhibernate=false"
133PACKAGECONFIG[hostnamed] = "-Dhostnamed=true,-Dhostnamed=false"
Brad Bishop393846f2019-05-20 12:24:11 -0400134PACKAGECONFIG[idn] = "-Didn=true,-Didn=false"
Brad Bishopc342db32019-05-15 21:57:59 -0400135PACKAGECONFIG[ima] = "-Dima=true,-Dima=false"
136# importd requires curl/xz/zlib/bzip2/gcrypt
137PACKAGECONFIG[importd] = "-Dimportd=true,-Dimportd=false"
138# Update NAT firewall rules
139PACKAGECONFIG[iptc] = "-Dlibiptc=true,-Dlibiptc=false,iptables"
140PACKAGECONFIG[journal-upload] = "-Dlibcurl=true,-Dlibcurl=false,curl"
141PACKAGECONFIG[kmod] = "-Dkmod=true,-Dkmod=false,kmod"
142PACKAGECONFIG[ldconfig] = "-Dldconfig=true,-Dldconfig=false"
143PACKAGECONFIG[libidn] = "-Dlibidn=true,-Dlibidn=false,libidn"
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[time-epoch] = "-Dtime-epoch=0,,"
171PACKAGECONFIG[timedated] = "-Dtimedated=true,-Dtimedated=false"
172PACKAGECONFIG[timesyncd] = "-Dtimesyncd=true,-Dtimesyncd=false"
173PACKAGECONFIG[usrmerge] = "-Dsplit-usr=false,-Dsplit-usr=true"
174PACKAGECONFIG[sbinmerge] = "-Dsplit-bin=false,-Dsplit-bin=true"
175PACKAGECONFIG[utmp] = "-Dutmp=true,-Dutmp=false"
176PACKAGECONFIG[valgrind] = "-DVALGRIND=1,,valgrind"
177PACKAGECONFIG[vconsole] = "-Dvconsole=true,-Dvconsole=false,,${PN}-vconsole-setup"
178# Verify keymaps on locale change
179PACKAGECONFIG[xkbcommon] = "-Dxkbcommon=true,-Dxkbcommon=false,libxkbcommon"
180PACKAGECONFIG[xz] = "-Dxz=true,-Dxz=false,xz"
181PACKAGECONFIG[zlib] = "-Dzlib=true,-Dzlib=false,zlib"
182
183# Helper variables to clarify locations. This mirrors the logic in systemd's
184# build system.
185rootprefix ?= "${root_prefix}"
186rootlibdir ?= "${base_libdir}"
187rootlibexecdir = "${rootprefix}/lib"
188
189# This links udev statically with systemd helper library.
190# Otherwise udev package would depend on systemd package (which has the needed shared library),
191# and always pull it into images.
192EXTRA_OEMESON += "-Dlink-udev-shared=false"
193
194EXTRA_OEMESON += "-Dnobody-user=nobody \
195 -Dnobody-group=nobody \
196 -Drootlibdir=${rootlibdir} \
197 -Drootprefix=${rootprefix} \
198 -Dsysvrcnd-path=${sysconfdir} \
199 -Ddefault-locale=C \
200 "
201
202# Hardcode target binary paths to avoid using paths from sysroot
203EXTRA_OEMESON += "-Dkexec-path=${sbindir}/kexec \
204 -Dkmod-path=${base_bindir}/kmod \
205 -Dmount-path=${base_bindir}/mount \
206 -Dquotacheck-path=${sbindir}/quotacheck \
207 -Dquotaon-path=${sbindir}/quotaon \
208 -Dsulogin-path=${base_sbindir}/sulogin \
209 -Dumount-path=${base_bindir}/umount"
210
211do_install() {
212 meson_do_install
213 install -d ${D}/${base_sbindir}
214 if ${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', 'false', 'true', d)}; then
215 # Provided by a separate recipe
216 rm ${D}${systemd_unitdir}/system/serial-getty* -f
217 fi
218
219 # Provide support for initramfs
220 [ ! -e ${D}/init ] && ln -s ${rootlibexecdir}/systemd/systemd ${D}/init
221 [ ! -e ${D}/${base_sbindir}/udevd ] && ln -s ${rootlibexecdir}/systemd/systemd-udevd ${D}/${base_sbindir}/udevd
222
223 install -d ${D}${sysconfdir}/udev/rules.d/
224 install -d ${D}${sysconfdir}/tmpfiles.d
225 install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/
226 install -d ${D}${libdir}/pkgconfig
227 install -m 0644 ${B}/src/udev/udev.pc ${D}${libdir}/pkgconfig/
228
229 install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
230
231 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
232 install -d ${D}${sysconfdir}/init.d
233 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd
234 sed -i s%@UDEVD@%${rootlibexecdir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd
235 fi
236
237 chown root:systemd-journal ${D}/${localstatedir}/log/journal
238
239 # Delete journal README, as log can be symlinked inside volatile.
240 rm -f ${D}/${localstatedir}/log/README
241
242 # journal-remote creates this at start
243 rm -rf ${D}/${localstatedir}/log/journal/remote
244
245 install -d ${D}${systemd_unitdir}/system/graphical.target.wants
246 install -d ${D}${systemd_unitdir}/system/multi-user.target.wants
247 install -d ${D}${systemd_unitdir}/system/poweroff.target.wants
248 install -d ${D}${systemd_unitdir}/system/reboot.target.wants
249 install -d ${D}${systemd_unitdir}/system/rescue.target.wants
250
251 # Create symlinks for systemd-update-utmp-runlevel.service
252 if ${@bb.utils.contains('PACKAGECONFIG', 'utmp', 'true', 'false', d)}; then
253 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/graphical.target.wants/systemd-update-utmp-runlevel.service
254 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/multi-user.target.wants/systemd-update-utmp-runlevel.service
255 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/poweroff.target.wants/systemd-update-utmp-runlevel.service
256 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/reboot.target.wants/systemd-update-utmp-runlevel.service
257 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/rescue.target.wants/systemd-update-utmp-runlevel.service
258 fi
259
260 # this file is needed to exist if networkd is disabled but timesyncd is still in use since timesyncd checks it
261 # for existence else it fails
262 if [ -s ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf ]; then
263 ${@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)}
264 fi
265 if ! ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'true', 'false', d)}; then
266 echo 'L! ${sysconfdir}/resolv.conf - - - - ../run/systemd/resolve/resolv.conf' >>${D}${exec_prefix}/lib/tmpfiles.d/etc.conf
267 echo 'd /run/systemd/resolve 0755 root root -' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
268 echo 'f /run/systemd/resolve/resolv.conf 0644 root root' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
269 ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd
270 else
271 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
272 ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd
273 fi
274 install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${systemd_unitdir}/systemd-sysv-install
275
276 # If polkit is setup fixup permissions and ownership
277 if ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'true', 'false', d)}; then
278 if [ -d ${D}${datadir}/polkit-1/rules.d ]; then
279 chmod 700 ${D}${datadir}/polkit-1/rules.d
280 chown polkitd:root ${D}${datadir}/polkit-1/rules.d
281 fi
282 fi
283
284 # duplicate udevadm for postinst script
285 install -d ${D}${libexecdir}
286 ln ${D}${base_bindir}/udevadm ${D}${libexecdir}/${MLPREFIX}udevadm
287
288 # install default policy for presets
289 # https://www.freedesktop.org/wiki/Software/systemd/Preset/#howto
290 install -Dm 0644 ${WORKDIR}/99-default.preset ${D}${systemd_unitdir}/system-preset/99-default.preset
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 ${sysconfdir}/systemd/system/multi-user.target.wants/machines.target \
410 ${base_bindir}/machinectl \
411 ${bindir}/systemd-nspawn \
412 ${nonarch_libdir}/systemd/import-pubring.gpg \
413 ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.import1.busname \
414 ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.machine1.busname \
415 ${systemd_system_unitdir}/local-fs.target.wants/var-lib-machines.mount \
416 ${systemd_system_unitdir}/machines.target.wants/var-lib-machines.mount \
417 ${systemd_system_unitdir}/remote-fs.target.wants/var-lib-machines.mount \
418 ${systemd_system_unitdir}/machine.slice \
419 ${systemd_system_unitdir}/machines.target \
420 ${systemd_system_unitdir}/org.freedesktop.import1.busname \
421 ${systemd_system_unitdir}/org.freedesktop.machine1.busname \
422 ${systemd_system_unitdir}/systemd-importd.service \
423 ${systemd_system_unitdir}/systemd-machined.service \
424 ${systemd_system_unitdir}/dbus-org.freedesktop.machine1.service \
425 ${systemd_system_unitdir}/var-lib-machines.mount \
426 ${rootlibexecdir}/systemd/systemd-import \
427 ${rootlibexecdir}/systemd/systemd-importd \
428 ${rootlibexecdir}/systemd/systemd-machined \
429 ${rootlibexecdir}/systemd/systemd-pull \
430 ${exec_prefix}/lib/tmpfiles.d/systemd-nspawn.conf \
431 ${systemd_system_unitdir}/systemd-nspawn@.service \
432 ${libdir}/libnss_mymachines.so.2 \
433 ${datadir}/dbus-1/system-services/org.freedesktop.import1.service \
434 ${datadir}/dbus-1/system-services/org.freedesktop.machine1.service \
435 ${datadir}/dbus-1/system.d/org.freedesktop.import1.conf \
436 ${datadir}/dbus-1/system.d/org.freedesktop.machine1.conf \
437 ${datadir}/polkit-1/actions/org.freedesktop.import1.policy \
438 ${datadir}/polkit-1/actions/org.freedesktop.machine1.policy \
439 "
440
441RRECOMMENDS_${PN}-container += "\
442 ${PN}-journal-upload \
443 ${PN}-journal-remote \
444 ${PN}-journal-gatewayd \
445 "
446
447FILES_${PN}-extra-utils = "\
448 ${base_bindir}/systemd-escape \
449 ${base_bindir}/systemd-inhibit \
450 ${bindir}/systemd-detect-virt \
451 ${bindir}/systemd-path \
452 ${bindir}/systemd-run \
453 ${bindir}/systemd-cat \
454 ${bindir}/systemd-delta \
455 ${bindir}/systemd-cgls \
456 ${bindir}/systemd-cgtop \
457 ${bindir}/systemd-stdio-bridge \
458 ${base_bindir}/systemd-ask-password \
459 ${base_bindir}/systemd-tty-ask-password-agent \
460 ${systemd_unitdir}/system/systemd-ask-password-console.path \
461 ${systemd_unitdir}/system/systemd-ask-password-console.service \
462 ${systemd_unitdir}/system/systemd-ask-password-wall.path \
463 ${systemd_unitdir}/system/systemd-ask-password-wall.service \
464 ${systemd_unitdir}/system/sysinit.target.wants/systemd-ask-password-console.path \
465 ${systemd_unitdir}/system/sysinit.target.wants/systemd-ask-password-wall.path \
466 ${systemd_unitdir}/system/multi-user.target.wants/systemd-ask-password-wall.path \
467 ${rootlibexecdir}/systemd/systemd-resolve-host \
468 ${rootlibexecdir}/systemd/systemd-ac-power \
469 ${rootlibexecdir}/systemd/systemd-activate \
470 ${rootlibexecdir}/systemd/systemd-bus-proxyd \
471 ${systemd_unitdir}/system/systemd-bus-proxyd.service \
472 ${systemd_unitdir}/system/systemd-bus-proxyd.socket \
473 ${rootlibexecdir}/systemd/systemd-socket-proxyd \
474 ${rootlibexecdir}/systemd/systemd-reply-password \
475 ${rootlibexecdir}/systemd/systemd-sleep \
476 ${rootlibexecdir}/systemd/system-sleep \
477 ${systemd_unitdir}/system/systemd-hibernate.service \
478 ${systemd_unitdir}/system/systemd-hybrid-sleep.service \
479 ${systemd_unitdir}/system/systemd-suspend.service \
480 ${systemd_unitdir}/system/sleep.target \
481 ${rootlibexecdir}/systemd/systemd-initctl \
482 ${systemd_unitdir}/system/systemd-initctl.service \
483 ${systemd_unitdir}/system/systemd-initctl.socket \
484 ${systemd_unitdir}/system/sockets.target.wants/systemd-initctl.socket \
485 ${rootlibexecdir}/systemd/system-generators/systemd-gpt-auto-generator \
486 ${rootlibexecdir}/systemd/systemd-cgroups-agent \
487"
488
489CONFFILES_${PN} = "${sysconfdir}/systemd/coredump.conf \
490 ${sysconfdir}/systemd/journald.conf \
491 ${sysconfdir}/systemd/logind.conf \
492 ${sysconfdir}/systemd/system.conf \
493 ${sysconfdir}/systemd/user.conf \
494 ${sysconfdir}/systemd/resolved.conf \
495 ${sysconfdir}/systemd/timesyncd.conf \
496"
497
498FILES_${PN} = " ${base_bindir}/* \
499 ${base_sbindir}/shutdown \
500 ${base_sbindir}/halt \
501 ${base_sbindir}/poweroff \
502 ${base_sbindir}/runlevel \
503 ${base_sbindir}/telinit \
504 ${base_sbindir}/resolvconf \
505 ${base_sbindir}/reboot \
506 ${base_sbindir}/init \
507 ${datadir}/dbus-1/services \
508 ${datadir}/dbus-1/system-services \
509 ${datadir}/polkit-1 \
510 ${datadir}/${BPN} \
511 ${datadir}/factory \
512 ${sysconfdir}/dbus-1/ \
513 ${sysconfdir}/modules-load.d/ \
514 ${sysconfdir}/pam.d/ \
515 ${sysconfdir}/sysctl.d/ \
516 ${sysconfdir}/systemd/ \
517 ${sysconfdir}/tmpfiles.d/ \
518 ${sysconfdir}/xdg/ \
519 ${sysconfdir}/init.d/README \
520 ${sysconfdir}/resolv-conf.systemd \
521 ${rootlibexecdir}/systemd/* \
522 ${systemd_unitdir}/* \
523 ${base_libdir}/security/*.so \
524 /cgroup \
525 ${bindir}/systemd* \
526 ${bindir}/busctl \
527 ${bindir}/coredumpctl \
528 ${bindir}/localectl \
529 ${bindir}/hostnamectl \
530 ${bindir}/resolvectl \
531 ${bindir}/timedatectl \
532 ${bindir}/bootctl \
533 ${bindir}/kernel-install \
534 ${exec_prefix}/lib/tmpfiles.d/*.conf \
535 ${exec_prefix}/lib/systemd \
536 ${exec_prefix}/lib/modules-load.d \
537 ${exec_prefix}/lib/sysctl.d \
538 ${exec_prefix}/lib/sysusers.d \
539 ${exec_prefix}/lib/environment.d \
540 ${localstatedir} \
541 ${nonarch_base_libdir}/udev/rules.d/70-uaccess.rules \
542 ${nonarch_base_libdir}/udev/rules.d/71-seat.rules \
543 ${nonarch_base_libdir}/udev/rules.d/73-seat-late.rules \
544 ${nonarch_base_libdir}/udev/rules.d/99-systemd.rules \
545 ${nonarch_base_libdir}/modprobe.d/systemd.conf \
546 ${datadir}/dbus-1/system.d/org.freedesktop.timedate1.conf \
547 ${datadir}/dbus-1/system.d/org.freedesktop.locale1.conf \
548 ${datadir}/dbus-1/system.d/org.freedesktop.network1.conf \
549 ${datadir}/dbus-1/system.d/org.freedesktop.resolve1.conf \
550 ${datadir}/dbus-1/system.d/org.freedesktop.systemd1.conf \
551 ${datadir}/dbus-1/system.d/org.freedesktop.hostname1.conf \
552 ${datadir}/dbus-1/system.d/org.freedesktop.login1.conf \
553 ${datadir}/dbus-1/system.d/org.freedesktop.timesync1.conf \
554 ${datadir}/dbus-1/system.d/org.freedesktop.portable1.conf \
555 "
556
557FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
558
559RDEPENDS_${PN} += "kmod dbus util-linux-mount util-linux-umount udev (= ${EXTENDPKGV}) util-linux-agetty util-linux-fsck"
560RDEPENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', '', 'systemd-serialgetty', d)}"
561RDEPENDS_${PN} += "volatile-binds update-rc.d"
562
563RRECOMMENDS_${PN} += "systemd-extra-utils \
564 systemd-compat-units udev-hwdb \
565 e2fsprogs-e2fsck \
566 kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \
567 os-release \
568 systemd-conf \
569"
570
571INSANE_SKIP_${PN} += "dev-so libdir"
572INSANE_SKIP_${PN}-dbg += "libdir"
573INSANE_SKIP_${PN}-doc += " libdir"
574
575PACKAGES =+ "udev udev-hwdb"
576
577RPROVIDES_udev = "hotplug"
578
579RDEPENDS_udev-hwdb += "udev"
580
581FILES_udev += "${base_sbindir}/udevd \
582 ${rootlibexecdir}/systemd/network/99-default.link \
583 ${rootlibexecdir}/systemd/systemd-udevd \
584 ${rootlibexecdir}/udev/accelerometer \
585 ${rootlibexecdir}/udev/ata_id \
586 ${rootlibexecdir}/udev/cdrom_id \
587 ${rootlibexecdir}/udev/collect \
588 ${rootlibexecdir}/udev/findkeyboards \
589 ${rootlibexecdir}/udev/keyboard-force-release.sh \
590 ${rootlibexecdir}/udev/keymap \
591 ${rootlibexecdir}/udev/mtd_probe \
592 ${rootlibexecdir}/udev/scsi_id \
593 ${rootlibexecdir}/udev/v4l_id \
594 ${rootlibexecdir}/udev/keymaps \
595 ${rootlibexecdir}/udev/rules.d/*.rules \
596 ${sysconfdir}/udev \
597 ${sysconfdir}/init.d/systemd-udevd \
598 ${systemd_unitdir}/system/*udev* \
599 ${systemd_unitdir}/system/*.wants/*udev* \
600 ${base_bindir}/udevadm \
601 ${libexecdir}/${MLPREFIX}udevadm \
602 ${datadir}/bash-completion/completions/udevadm \
603 "
604
605FILES_udev-hwdb = "${rootlibexecdir}/udev/hwdb.d"
606
Brad Bishop15ae2502019-06-18 21:44:24 -0400607RCONFLICTS_${PN} = "tiny-init ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'resolvconf', '', d)}"
608
Brad Bishopc342db32019-05-15 21:57:59 -0400609INITSCRIPT_PACKAGES = "udev"
610INITSCRIPT_NAME_udev = "systemd-udevd"
611INITSCRIPT_PARAMS_udev = "start 03 S ."
612
613python __anonymous() {
614 if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
615 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
616}
617
618ALTERNATIVE_${PN} = "halt reboot shutdown poweroff runlevel resolv-conf"
619
620ALTERNATIVE_TARGET[resolv-conf] = "${sysconfdir}/resolv-conf.systemd"
621ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/resolv.conf"
622ALTERNATIVE_PRIORITY[resolv-conf] ?= "50"
623
624ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl"
625ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt"
626ALTERNATIVE_PRIORITY[halt] ?= "300"
627
628ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl"
629ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
630ALTERNATIVE_PRIORITY[reboot] ?= "300"
631
632ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl"
633ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown"
634ALTERNATIVE_PRIORITY[shutdown] ?= "300"
635
636ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl"
637ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
638ALTERNATIVE_PRIORITY[poweroff] ?= "300"
639
640ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"
641ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
642ALTERNATIVE_PRIORITY[runlevel] ?= "300"
643
644pkg_postinst_${PN} () {
645 sed -e '/^hosts:/s/\s*\<myhostname\>//' \
646 -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \
647 -i $D${sysconfdir}/nsswitch.conf
648}
649
650pkg_prerm_${PN} () {
651 sed -e '/^hosts:/s/\s*\<myhostname\>//' \
652 -e '/^hosts:/s/\s*myhostname//' \
653 -i $D${sysconfdir}/nsswitch.conf
654}
655
656PACKAGE_WRITE_DEPS += "qemu-native"
657pkg_postinst_udev-hwdb () {
658 if test -n "$D"; then
659 $INTERCEPT_DIR/postinst_intercept update_udev_hwdb ${PKG} mlprefix=${MLPREFIX} binprefix=${MLPREFIX}
660 else
661 udevadm hwdb --update
662 fi
663}
664
665pkg_prerm_udev-hwdb () {
666 rm -f $D${sysconfdir}/udev/hwdb.bin
667}