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