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