blob: 7fbd64ced759f5b781ce8210cdb84dafa924cc30 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001require 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-Make-root-s-home-directory-configurable.patch \
25 file://0006-remove-nobody-user-group-checking.patch \
26 file://0007-rules-watch-metadata-changes-in-ide-devices.patch \
27 file://0008-Do-not-enable-nss-tests-if-nss-systemd-is-not-enable.patch \
28 file://0009-nss-mymachines-Build-conditionally-when-ENABLE_MYHOS.patch \
29 file://0001-login-use-parse_uid-when-unmounting-user-runtime-dir.patch \
30 file://0001-sd-bus-make-BUS_DEFAULT_TIMEOUT-configurable.patch \
31 file://0022-build-sys-Detect-whether-struct-statx-is-defined-in-.patch \
32 file://0023-resolvconf-fixes-for-the-compatibility-interface.patch \
33 file://0001-core-when-deserializing-state-always-use-read_line-L.patch \
34 file://0001-chown-recursive-let-s-rework-the-recursive-logic-to-.patch \
35 file://0001-dhcp6-make-sure-we-have-enough-space-for-the-DHCP6-o.patch \
Brad Bishop977dc1a2019-02-06 16:01:43 -050036 file://0001-Revert-sysctl.d-request-ECN-on-both-in-and-outgoing-.patch \
37 file://0001-timesync-changes-type-of-drift_freq-to-int64_t.patch \
38 file://0001-sysctl-Don-t-pass-null-directive-argument-to-s.patch \
39 file://0002-core-Fix-use-after-free-case-in-load_from_path.patch \
40 file://0001-meson-rename-Ddebug-to-Ddebug-extra.patch \
41 file://0024-journald-do-not-store-the-iovec-entry-for-process-co.patch \
Brad Bishopf8caae32019-03-25 13:13:56 -040042 file://0025-journald-set-a-limit-on-the-number-of-fields.patch \
43 file://0026-journal-fix-out-of-bounds-read-CVE-2018-16866.patch \
44 file://CVE-2019-6454.patch \
45 file://sd-bus-if-we-receive-an-invalid-dbus-message-ignore-.patch \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080046 "
47
48# patches made for musl are only applied on TCLIBC is musl
49SRC_URI += "${SRC_URI_MUSL}"
50SRC_URI_MUSL = "file://0001-Use-getenv-when-secure-versions-are-not-available.patch \
51 file://0002-don-t-use-glibc-specific-qsort_r.patch \
52 file://0003-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch \
53 file://0004-add-fallback-parse_printf_format-implementation.patch \
54 file://0005-include-gshadow-only-if-ENABLE_GSHADOW-is-1.patch \
55 file://0006-src-basic-missing.h-check-for-missing-strndupa.patch \
56 file://0007-Include-netinet-if_ether.h.patch \
57 file://0008-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch \
58 file://0009-add-missing-FTW_-macros-for-musl.patch \
59 file://0010-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch \
60 file://0011-src-basic-missing.h-check-for-missing-__compar_fn_t-.patch \
61 file://0012-fix-missing-of-__register_atfork-for-non-glibc-build.patch \
62 file://0013-Use-uintmax_t-for-handling-rlim_t.patch \
63 file://0014-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch \
64 file://0015-test-hexdecoct.c-Include-missing.h-for-strndupa.patch \
65 file://0016-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch \
66 file://0017-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch \
67 file://0018-Define-glibc-compatible-basename-for-non-glibc-syste.patch \
68 file://0019-Do-not-disable-buffering-when-writing-to-oom_score_a.patch \
69 file://0020-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch \
70 file://0021-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch \
71 "
72
73# Workaround undefined reference to `__stack_chk_fail_local' on qemux86 and qemuppc for musl
74SRC_URI_append_libc-musl_qemux86 = " file://0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch"
75SRC_URI_append_libc-musl_qemuppc = " file://0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch"
76
77PAM_PLUGINS = " \
78 pam-plugin-unix \
79 pam-plugin-loginuid \
80 pam-plugin-keyinit \
81"
82
83PACKAGECONFIG ??= " \
84 ${@bb.utils.filter('DISTRO_FEATURES', 'efi ldconfig pam selinux usrmerge', d)} \
85 ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \
86 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \
87 acl \
88 backlight \
89 binfmt \
90 firstboot \
91 gshadow \
92 hibernate \
93 hostnamed \
94 ima \
95 kmod \
96 localed \
97 logind \
98 machined \
99 myhostname \
100 networkd \
101 nss \
102 polkit \
103 quotacheck \
104 randomseed \
105 resolved \
106 smack \
107 sysusers \
108 timedated \
109 timesyncd \
110 utmp \
111 vconsole \
112 xz \
113"
114
115PACKAGECONFIG_remove_libc-musl = " \
116 gshadow \
117 localed \
118 myhostname \
119 nss \
120 resolved \
121 selinux \
122 smack \
123 sysusers \
124 utmp \
125"
126
127# Use the upstream systemd serial-getty@.service and rely on
128# systemd-getty-generator instead of using the OE-core specific
129# systemd-serialgetty.bb - not enabled by default.
130PACKAGECONFIG[serial-getty-generator] = ""
131
132PACKAGECONFIG[acl] = "-Dacl=true,-Dacl=false,acl"
133PACKAGECONFIG[audit] = "-Daudit=true,-Daudit=false,audit"
134PACKAGECONFIG[backlight] = "-Dbacklight=true,-Dbacklight=false"
135PACKAGECONFIG[binfmt] = "-Dbinfmt=true,-Dbinfmt=false"
136PACKAGECONFIG[bzip2] = "-Dbzip2=true,-Dbzip2=false,bzip2"
137PACKAGECONFIG[coredump] = "-Dcoredump=true,-Dcoredump=false"
138PACKAGECONFIG[cryptsetup] = "-Dlibcryptsetup=true,-Dlibcryptsetup=false,cryptsetup"
139PACKAGECONFIG[dbus] = "-Ddbus=true,-Ddbus=false,dbus"
140PACKAGECONFIG[efi] = "-Defi=true,-Defi=false"
141PACKAGECONFIG[elfutils] = "-Delfutils=true,-Delfutils=false,elfutils"
142PACKAGECONFIG[firstboot] = "-Dfirstboot=true,-Dfirstboot=false"
143# Sign the journal for anti-tampering
144PACKAGECONFIG[gcrypt] = "-Dgcrypt=true,-Dgcrypt=false,libgcrypt"
Brad Bishop977dc1a2019-02-06 16:01:43 -0500145PACKAGECONFIG[gnutls] = "-Dgnutls=true,-Dgnutls=false,gnutls"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800146PACKAGECONFIG[gshadow] = "-Dgshadow=true,-Dgshadow=false"
147PACKAGECONFIG[hibernate] = "-Dhibernate=true,-Dhibernate=false"
148PACKAGECONFIG[hostnamed] = "-Dhostnamed=true,-Dhostnamed=false"
149PACKAGECONFIG[ima] = "-Dima=true,-Dima=false"
150# importd requires curl/xz/zlib/bzip2/gcrypt
151PACKAGECONFIG[importd] = "-Dimportd=true,-Dimportd=false"
152# Update NAT firewall rules
153PACKAGECONFIG[iptc] = "-Dlibiptc=true,-Dlibiptc=false,iptables"
154PACKAGECONFIG[journal-upload] = "-Dlibcurl=true,-Dlibcurl=false,curl"
155PACKAGECONFIG[kmod] = "-Dkmod=true,-Dkmod=false,kmod"
156PACKAGECONFIG[ldconfig] = "-Dldconfig=true,-Dldconfig=false"
157PACKAGECONFIG[libidn] = "-Dlibidn=true,-Dlibidn=false,libidn"
158PACKAGECONFIG[localed] = "-Dlocaled=true,-Dlocaled=false"
159PACKAGECONFIG[logind] = "-Dlogind=true,-Dlogind=false"
160PACKAGECONFIG[lz4] = "-Dlz4=true,-Dlz4=false,lz4"
161PACKAGECONFIG[machined] = "-Dmachined=true,-Dmachined=false"
162PACKAGECONFIG[manpages] = "-Dman=true,-Dman=false,libxslt-native xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
163PACKAGECONFIG[microhttpd] = "-Dmicrohttpd=true,-Dmicrohttpd=false,libmicrohttpd"
164PACKAGECONFIG[myhostname] = "-Dmyhostname=true,-Dmyhostname=false"
165PACKAGECONFIG[networkd] = "-Dnetworkd=true,-Dnetworkd=false"
166PACKAGECONFIG[nss] = "-Dnss-systemd=true,-Dnss-systemd=false"
167PACKAGECONFIG[pam] = "-Dpam=true,-Dpam=false,libpam,${PAM_PLUGINS}"
168PACKAGECONFIG[polkit] = "-Dpolkit=true,-Dpolkit=false"
169PACKAGECONFIG[portabled] = "-Dportabled=true,-Dportabled=false"
170PACKAGECONFIG[qrencode] = "-Dqrencode=true,-Dqrencode=false,qrencode"
171PACKAGECONFIG[quotacheck] = "-Dquotacheck=true,-Dquotacheck=false"
172PACKAGECONFIG[randomseed] = "-Drandomseed=true,-Drandomseed=false"
173PACKAGECONFIG[resolved] = "-Dresolve=true,-Dresolve=false"
174PACKAGECONFIG[rfkill] = "-Drfkill=true,-Drfkill=false"
175# libseccomp is found in meta-security
176PACKAGECONFIG[seccomp] = "-Dseccomp=true,-Dseccomp=false,libseccomp"
177PACKAGECONFIG[selinux] = "-Dselinux=true,-Dselinux=false,libselinux,initscripts-sushell"
178PACKAGECONFIG[smack] = "-Dsmack=true,-Dsmack=false"
179PACKAGECONFIG[sysusers] = "-Dsysusers=true,-Dsysusers=false"
180PACKAGECONFIG[time-epoch] = "-Dtime-epoch=0,,"
181PACKAGECONFIG[timedated] = "-Dtimedated=true,-Dtimedated=false"
182PACKAGECONFIG[timesyncd] = "-Dtimesyncd=true,-Dtimesyncd=false"
183PACKAGECONFIG[usrmerge] = "-Dsplit-usr=false,-Dsplit-usr=true"
184PACKAGECONFIG[sbinmerge] = "-Dsplit-bin=false,-Dsplit-bin=true"
185PACKAGECONFIG[utmp] = "-Dutmp=true,-Dutmp=false"
186PACKAGECONFIG[valgrind] = "-DVALGRIND=1,,valgrind"
187PACKAGECONFIG[vconsole] = "-Dvconsole=true,-Dvconsole=false,,${PN}-vconsole-setup"
188# Verify keymaps on locale change
189PACKAGECONFIG[xkbcommon] = "-Dxkbcommon=true,-Dxkbcommon=false,libxkbcommon"
190PACKAGECONFIG[xz] = "-Dxz=true,-Dxz=false,xz"
191PACKAGECONFIG[zlib] = "-Dzlib=true,-Dzlib=false,zlib"
192
193# Helper variables to clarify locations. This mirrors the logic in systemd's
194# build system.
195rootprefix ?= "${root_prefix}"
196rootlibdir ?= "${base_libdir}"
197rootlibexecdir = "${rootprefix}/lib"
198
199# This links udev statically with systemd helper library.
200# Otherwise udev package would depend on systemd package (which has the needed shared library),
201# and always pull it into images.
202EXTRA_OEMESON += "-Dlink-udev-shared=false"
203
204EXTRA_OEMESON += "-Dnobody-user=nobody \
205 -Dnobody-group=nobody \
206 -Droothomedir=${ROOT_HOME} \
207 -Drootlibdir=${rootlibdir} \
208 -Drootprefix=${rootprefix} \
209 -Dsysvrcnd-path=${sysconfdir} \
210 "
211
212# Hardcode target binary paths to avoid using paths from sysroot
213EXTRA_OEMESON += "-Dkexec-path=${sbindir}/kexec \
214 -Dkill-path=${base_bindir}/kill \
215 -Dkmod-path=${base_bindir}/kmod \
216 -Dmount-path=${base_bindir}/mount \
217 -Dquotacheck-path=${sbindir}/quotacheck \
218 -Dquotaon-path=${sbindir}/quotaon \
219 -Dsulogin-path=${base_sbindir}/sulogin \
220 -Dumount-path=${base_bindir}/umount"
221
222do_install() {
223 meson_do_install
224 install -d ${D}/${base_sbindir}
225 if ${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', 'false', 'true', d)}; then
226 # Provided by a separate recipe
227 rm ${D}${systemd_unitdir}/system/serial-getty* -f
228 fi
229
230 # Provide support for initramfs
231 [ ! -e ${D}/init ] && ln -s ${rootlibexecdir}/systemd/systemd ${D}/init
232 [ ! -e ${D}/${base_sbindir}/udevd ] && ln -s ${rootlibexecdir}/systemd/systemd-udevd ${D}/${base_sbindir}/udevd
233
234 install -d ${D}${sysconfdir}/udev/rules.d/
235 install -d ${D}${sysconfdir}/tmpfiles.d
236 install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/
237 install -d ${D}${libdir}/pkgconfig
238 install -m 0644 ${B}/src/udev/udev.pc ${D}${libdir}/pkgconfig/
239
240 install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
241
242 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
243 install -d ${D}${sysconfdir}/init.d
244 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd
245 sed -i s%@UDEVD@%${rootlibexecdir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd
246 fi
247
248 chown root:systemd-journal ${D}/${localstatedir}/log/journal
249
250 # Delete journal README, as log can be symlinked inside volatile.
251 rm -f ${D}/${localstatedir}/log/README
252
Brad Bishopa5c52ff2018-11-23 10:55:50 +1300253 # journal-remote creates this at start
254 rm -rf ${D}/${localstatedir}/log/journal/remote
255
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800256 install -d ${D}${systemd_unitdir}/system/graphical.target.wants
257 install -d ${D}${systemd_unitdir}/system/multi-user.target.wants
258 install -d ${D}${systemd_unitdir}/system/poweroff.target.wants
259 install -d ${D}${systemd_unitdir}/system/reboot.target.wants
260 install -d ${D}${systemd_unitdir}/system/rescue.target.wants
261
262 # Create symlinks for systemd-update-utmp-runlevel.service
263 if ${@bb.utils.contains('PACKAGECONFIG', 'utmp', 'true', 'false', d)}; then
264 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/graphical.target.wants/systemd-update-utmp-runlevel.service
265 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/multi-user.target.wants/systemd-update-utmp-runlevel.service
266 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/poweroff.target.wants/systemd-update-utmp-runlevel.service
267 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/reboot.target.wants/systemd-update-utmp-runlevel.service
268 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/rescue.target.wants/systemd-update-utmp-runlevel.service
269 fi
270
271 # this file is needed to exist if networkd is disabled but timesyncd is still in use since timesyncd checks it
272 # for existence else it fails
273 if [ -s ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf ]; then
274 ${@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)}
275 fi
276 if ! ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'true', 'false', d)}; then
277 echo 'L! ${sysconfdir}/resolv.conf - - - - ../run/systemd/resolve/resolv.conf' >>${D}${exec_prefix}/lib/tmpfiles.d/etc.conf
278 echo 'd /run/systemd/resolve 0755 root root -' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
279 echo 'f /run/systemd/resolve/resolv.conf 0644 root root' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
280 ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd
281 else
282 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
283 ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd
284 fi
285 install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${systemd_unitdir}/systemd-sysv-install
286
287 # If polkit is setup fixup permissions and ownership
288 if ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'true', 'false', d)}; then
289 if [ -d ${D}${datadir}/polkit-1/rules.d ]; then
290 chmod 700 ${D}${datadir}/polkit-1/rules.d
291 chown polkitd:root ${D}${datadir}/polkit-1/rules.d
292 fi
293 fi
294
295 # conf files are handled by systemd-conf
296 rm -f ${D}${sysconfdir}/machine-id
297 rm -f ${D}${sysconfdir}/systemd/coredump.conf
298 rm -f ${D}${sysconfdir}/systemd/journald.conf
299 rm -f ${D}${sysconfdir}/systemd/logind.conf
300 rm -f ${D}${sysconfdir}/systemd/system.conf
301 rm -f ${D}${sysconfdir}/systemd/user.conf
302
303 # duplicate udevadm for postinst script
304 install -d ${D}${libexecdir}
305 ln ${D}${base_bindir}/udevadm ${D}${libexecdir}/${MLPREFIX}udevadm
306}
307
308
309python populate_packages_prepend (){
310 systemdlibdir = d.getVar("rootlibdir")
311 do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True)
312}
313PACKAGES_DYNAMIC += "^lib(udev|systemd|nss).*"
314
315PACKAGES =+ "\
316 ${PN}-gui \
317 ${PN}-vconsole-setup \
318 ${PN}-initramfs \
319 ${PN}-analyze \
320 ${PN}-kernel-install \
321 ${PN}-rpm-macros \
322 ${PN}-binfmt \
323 ${PN}-zsh-completion \
324 ${PN}-xorg-xinitrc \
325 ${PN}-container \
Brad Bishopa5c52ff2018-11-23 10:55:50 +1300326 ${PN}-journal-gatewayd \
327 ${PN}-journal-upload \
328 ${PN}-journal-remote \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800329 ${PN}-extra-utils \
330"
331
332SUMMARY_${PN}-container = "Tools for containers and VMs"
333DESCRIPTION_${PN}-container = "Systemd tools to spawn and manage containers and virtual machines."
334
Brad Bishopa5c52ff2018-11-23 10:55:50 +1300335SUMMARY_${PN}-journal-gatewayd = "HTTP server for journal events"
336DESCRIPTION_${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."
337
338SUMMARY_${PN}-journal-upload = "Send journal messages over the network"
339DESCRIPTION_${PN}-journal-upload = "systemd-journal-upload uploads journal entries to a specified URL."
340
341SUMMARY_${PN}-journal-remote = "Receive journal messages over the network"
342DESCRIPTION_${PN}-journal-remote = "systemd-journal-remote is a command to receive serialized journal events and store them to journal files."
343
344SYSTEMD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'binfmt', '${PN}-binfmt', '', d)} \
345 ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-gatewayd', '', d)} \
Brad Bishop977dc1a2019-02-06 16:01:43 -0500346 ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-remote', '', d)} \
Brad Bishopa5c52ff2018-11-23 10:55:50 +1300347 ${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '${PN}-journal-upload', '', d)} \
Brad Bishopa5c52ff2018-11-23 10:55:50 +1300348"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800349SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service"
350
Brad Bishop977dc1a2019-02-06 16:01:43 -0500351USERADD_PACKAGES = "${PN} ${PN}-extra-utils \
352 ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-gateway', '', d)} \
353 ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-remote', '', d)} \
354 ${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '${PN}-journal-upload', '', d)} \
355"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800356GROUPADD_PARAM_${PN} = "-r systemd-journal"
Brad Bishop977dc1a2019-02-06 16:01:43 -0500357USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'coredump', '--system -d / -M --shell /bin/nologin systemd-coredump;', '', d)}"
358USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'networkd', '--system -d / -M --shell /bin/nologin systemd-network;', '', d)}"
359USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'polkit', '--system --no-create-home --user-group --home-dir ${sysconfdir}/polkit-1 polkitd;', '', d)}"
360USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'resolved', '--system -d / -M --shell /bin/nologin systemd-resolve;', '', d)}"
361USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'timesyncd', '--system -d / -M --shell /bin/nologin systemd-timesync;', '', d)}"
362USERADD_PARAM_${PN}-extra-utils = "--system -d / -M --shell /bin/nologin systemd-bus-proxy"
363USERADD_PARAM_${PN}-journal-gateway = "--system -d / -M --shell /bin/nologin systemd-journal-gateway"
364USERADD_PARAM_${PN}-journal-remote = "--system -d / -M --shell /bin/nologin systemd-journal-remote"
365USERADD_PARAM_${PN}-journal-upload = "--system -d / -M --shell /bin/nologin systemd-journal-upload"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800366
367FILES_${PN}-analyze = "${bindir}/systemd-analyze"
368
369FILES_${PN}-initramfs = "/init"
370RDEPENDS_${PN}-initramfs = "${PN}"
371
372FILES_${PN}-gui = "${bindir}/systemadm"
373
374FILES_${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \
375 ${systemd_unitdir}/system/systemd-vconsole-setup.service \
376 ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service"
377
378RDEPENDS_${PN}-kernel-install += "bash"
379FILES_${PN}-kernel-install = "${bindir}/kernel-install \
380 ${sysconfdir}/kernel/ \
381 ${exec_prefix}/lib/kernel \
382 "
383FILES_${PN}-rpm-macros = "${exec_prefix}/lib/rpm \
384 "
385
386FILES_${PN}-xorg-xinitrc = "${sysconfdir}/X11/xinit/xinitrc.d/*"
387
388FILES_${PN}-zsh-completion = "${datadir}/zsh/site-functions"
389
390FILES_${PN}-binfmt = "${sysconfdir}/binfmt.d/ \
391 ${exec_prefix}/lib/binfmt.d \
392 ${rootlibexecdir}/systemd/systemd-binfmt \
393 ${systemd_unitdir}/system/proc-sys-fs-binfmt_misc.* \
394 ${systemd_unitdir}/system/systemd-binfmt.service"
395RRECOMMENDS_${PN}-binfmt = "kernel-module-binfmt-misc"
396
397RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts kbd-keymaps"
398
Brad Bishopa5c52ff2018-11-23 10:55:50 +1300399
400FILES_${PN}-journal-gatewayd = "${rootlibexecdir}/systemd/systemd-journal-gatewayd \
401 ${systemd_system_unitdir}/systemd-journal-gatewayd.service \
402 ${systemd_system_unitdir}/systemd-journal-gatewayd.socket \
403 ${systemd_system_unitdir}/sockets.target.wants/systemd-journal-gatewayd.socket \
404 ${datadir}/systemd/gatewayd/browse.html \
405 "
406SYSTEMD_SERVICE_${PN}-journal-gatewayd = "systemd-journal-gatewayd.socket"
407
408FILES_${PN}-journal-upload = "${rootlibexecdir}/systemd/systemd-journal-upload \
409 ${systemd_system_unitdir}/systemd-journal-upload.service \
410 ${sysconfdir}/systemd/journal-upload.conf \
411 "
412SYSTEMD_SERVICE_${PN}-journal-upload = "systemd-journal-upload.service"
413
414FILES_${PN}-journal-remote = "${rootlibexecdir}/systemd/systemd-journal-remote \
415 ${sysconfdir}/systemd/journal-remote.conf \
416 ${systemd_system_unitdir}/systemd-journal-remote.service \
417 ${systemd_system_unitdir}/systemd-journal-remote.socket \
418 "
419SYSTEMD_SERVICE_${PN}-remote = "systemd-journal-remote.socket"
420
421
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800422FILES_${PN}-container = "${sysconfdir}/dbus-1/system.d/org.freedesktop.import1.conf \
423 ${sysconfdir}/dbus-1/system.d/org.freedesktop.machine1.conf \
424 ${base_bindir}/machinectl \
425 ${bindir}/systemd-nspawn \
426 ${nonarch_libdir}/systemd/import-pubring.gpg \
427 ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.import1.busname \
428 ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.machine1.busname \
429 ${systemd_system_unitdir}/local-fs.target.wants/var-lib-machines.mount \
430 ${systemd_system_unitdir}/machine.slice \
431 ${systemd_system_unitdir}/machines.target \
432 ${systemd_system_unitdir}/org.freedesktop.import1.busname \
433 ${systemd_system_unitdir}/org.freedesktop.machine1.busname \
434 ${systemd_system_unitdir}/systemd-importd.service \
435 ${systemd_system_unitdir}/systemd-machined.service \
436 ${systemd_system_unitdir}/dbus-org.freedesktop.machine1.service \
437 ${systemd_system_unitdir}/var-lib-machines.mount \
438 ${rootlibexecdir}/systemd/systemd-import \
439 ${rootlibexecdir}/systemd/systemd-importd \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800440 ${rootlibexecdir}/systemd/systemd-machined \
441 ${rootlibexecdir}/systemd/systemd-pull \
442 ${exec_prefix}/lib/tmpfiles.d/systemd-nspawn.conf \
443 ${systemd_system_unitdir}/systemd-nspawn@.service \
444 ${libdir}/libnss_mymachines.so.2 \
445 ${datadir}/dbus-1/system-services/org.freedesktop.import1.service \
446 ${datadir}/dbus-1/system-services/org.freedesktop.machine1.service \
447 ${datadir}/dbus-1/system.d/org.freedesktop.import1.conf \
448 ${datadir}/dbus-1/system.d/org.freedesktop.machine1.conf \
449 ${datadir}/polkit-1/actions/org.freedesktop.import1.policy \
450 ${datadir}/polkit-1/actions/org.freedesktop.machine1.policy \
451 "
452
Brad Bishopa5c52ff2018-11-23 10:55:50 +1300453RRECOMMENDS_${PN}-container += "\
454 ${PN}-journal-upload \
455 ${PN}-journal-remote \
456 ${PN}-journal-gatewayd \
457 "
458
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800459FILES_${PN}-extra-utils = "\
460 ${base_bindir}/systemd-escape \
461 ${base_bindir}/systemd-inhibit \
462 ${bindir}/systemd-detect-virt \
463 ${bindir}/systemd-path \
464 ${bindir}/systemd-run \
465 ${bindir}/systemd-cat \
466 ${bindir}/systemd-delta \
467 ${bindir}/systemd-cgls \
468 ${bindir}/systemd-cgtop \
469 ${bindir}/systemd-stdio-bridge \
470 ${base_bindir}/systemd-ask-password \
471 ${base_bindir}/systemd-tty-ask-password-agent \
472 ${systemd_unitdir}/system/systemd-ask-password-console.path \
473 ${systemd_unitdir}/system/systemd-ask-password-console.service \
474 ${systemd_unitdir}/system/systemd-ask-password-wall.path \
475 ${systemd_unitdir}/system/systemd-ask-password-wall.service \
476 ${systemd_unitdir}/system/sysinit.target.wants/systemd-ask-password-console.path \
477 ${systemd_unitdir}/system/sysinit.target.wants/systemd-ask-password-wall.path \
478 ${systemd_unitdir}/system/multi-user.target.wants/systemd-ask-password-wall.path \
479 ${rootlibexecdir}/systemd/systemd-resolve-host \
480 ${rootlibexecdir}/systemd/systemd-ac-power \
481 ${rootlibexecdir}/systemd/systemd-activate \
482 ${rootlibexecdir}/systemd/systemd-bus-proxyd \
483 ${systemd_unitdir}/system/systemd-bus-proxyd.service \
484 ${systemd_unitdir}/system/systemd-bus-proxyd.socket \
485 ${rootlibexecdir}/systemd/systemd-socket-proxyd \
486 ${rootlibexecdir}/systemd/systemd-reply-password \
487 ${rootlibexecdir}/systemd/systemd-sleep \
488 ${rootlibexecdir}/systemd/system-sleep \
489 ${systemd_unitdir}/system/systemd-hibernate.service \
490 ${systemd_unitdir}/system/systemd-hybrid-sleep.service \
491 ${systemd_unitdir}/system/systemd-suspend.service \
492 ${systemd_unitdir}/system/sleep.target \
493 ${rootlibexecdir}/systemd/systemd-initctl \
494 ${systemd_unitdir}/system/systemd-initctl.service \
495 ${systemd_unitdir}/system/systemd-initctl.socket \
496 ${systemd_unitdir}/system/sockets.target.wants/systemd-initctl.socket \
497 ${rootlibexecdir}/systemd/system-generators/systemd-gpt-auto-generator \
498 ${rootlibexecdir}/systemd/systemd-cgroups-agent \
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
Brad Bishopf8caae32019-03-25 13:13:56 -0400562RDEPENDS_${PN} += "kmod dbus util-linux-mount util-linux-umount udev (= ${EXTENDPKGV}) util-linux-agetty util-linux-fsck"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800563RDEPENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', '', 'systemd-serialgetty', d)}"
564RDEPENDS_${PN} += "volatile-binds update-rc.d systemd-conf"
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"
572
573INSANE_SKIP_${PN} += "dev-so libdir"
574INSANE_SKIP_${PN}-dbg += "libdir"
575INSANE_SKIP_${PN}-doc += " libdir"
576
577PACKAGES =+ "udev udev-hwdb"
578
579RPROVIDES_udev = "hotplug"
580
581RDEPENDS_udev-hwdb += "udev"
582
583FILES_udev += "${base_sbindir}/udevd \
584 ${rootlibexecdir}/systemd/systemd-udevd \
585 ${rootlibexecdir}/udev/accelerometer \
586 ${rootlibexecdir}/udev/ata_id \
587 ${rootlibexecdir}/udev/cdrom_id \
588 ${rootlibexecdir}/udev/collect \
589 ${rootlibexecdir}/udev/findkeyboards \
590 ${rootlibexecdir}/udev/keyboard-force-release.sh \
591 ${rootlibexecdir}/udev/keymap \
592 ${rootlibexecdir}/udev/mtd_probe \
593 ${rootlibexecdir}/udev/scsi_id \
594 ${rootlibexecdir}/udev/v4l_id \
595 ${rootlibexecdir}/udev/keymaps \
596 ${rootlibexecdir}/udev/rules.d/*.rules \
597 ${sysconfdir}/udev \
598 ${sysconfdir}/init.d/systemd-udevd \
599 ${systemd_unitdir}/system/*udev* \
600 ${systemd_unitdir}/system/*.wants/*udev* \
601 ${base_bindir}/udevadm \
602 ${libexecdir}/${MLPREFIX}udevadm \
603 ${datadir}/bash-completion/completions/udevadm \
604 "
605
606FILES_udev-hwdb = "${rootlibexecdir}/udev/hwdb.d"
607
608INITSCRIPT_PACKAGES = "udev"
609INITSCRIPT_NAME_udev = "systemd-udevd"
610INITSCRIPT_PARAMS_udev = "start 03 S ."
611
612python __anonymous() {
613 if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
614 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
615}
616
617ALTERNATIVE_${PN} = "halt reboot shutdown poweroff runlevel resolv-conf"
618
619ALTERNATIVE_TARGET[resolv-conf] = "${sysconfdir}/resolv-conf.systemd"
620ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/resolv.conf"
621ALTERNATIVE_PRIORITY[resolv-conf] ?= "50"
622
623ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl"
624ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt"
625ALTERNATIVE_PRIORITY[halt] ?= "300"
626
627ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl"
628ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
629ALTERNATIVE_PRIORITY[reboot] ?= "300"
630
631ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl"
632ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown"
633ALTERNATIVE_PRIORITY[shutdown] ?= "300"
634
635ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl"
636ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
637ALTERNATIVE_PRIORITY[poweroff] ?= "300"
638
639ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"
640ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
641ALTERNATIVE_PRIORITY[runlevel] ?= "300"
642
643pkg_postinst_${PN} () {
644 sed -e '/^hosts:/s/\s*\<myhostname\>//' \
645 -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \
646 -i $D${sysconfdir}/nsswitch.conf
647}
648
649pkg_prerm_${PN} () {
650 sed -e '/^hosts:/s/\s*\<myhostname\>//' \
651 -e '/^hosts:/s/\s*myhostname//' \
652 -i $D${sysconfdir}/nsswitch.conf
653}
654
655PACKAGE_WRITE_DEPS += "qemu-native"
656pkg_postinst_udev-hwdb () {
657 if test -n "$D"; then
658 $INTERCEPT_DIR/postinst_intercept update_udev_hwdb ${PKG} mlprefix=${MLPREFIX} binprefix=${MLPREFIX}
659 else
660 udevadm hwdb --update
661 fi
662}
663
664pkg_prerm_udev-hwdb () {
665 rm -f $D${sysconfdir}/udev/hwdb.bin
666}