blob: 8b92b2cf425c3bab73f8d969868bae38e5bac6b9 [file] [log] [blame]
Andrew Geissler517393d2023-01-13 08:55:19 -06001require systemd.inc
2
3PROVIDES = "udev"
4
5PE = "1"
6
7DEPENDS = "intltool-native gperf-native libcap util-linux python3-jinja2-native"
8
9SECTION = "base/shell"
10
11inherit useradd pkgconfig meson perlnative update-rc.d update-alternatives qemu systemd gettext bash-completion manpages 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 += " \
18 file://touchscreen.rules \
19 file://00-create-volatile.conf \
20 ${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', 'file://org.freedesktop.hostname1_no_polkit.conf', '', d)} \
21 ${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', 'file://00-hostnamed-network-user.conf', '', d)} \
22 file://init \
23 file://99-default.preset \
24 file://systemd-pager.sh \
25 file://0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch \
26 file://0003-implment-systemd-sysv-install-for-OE.patch \
27 file://0001-Move-sysusers.d-sysctl.d-binfmt.d-modules-load.d-to-.patch \
28 "
29
30# patches needed by musl
31SRC_URI:append:libc-musl = " ${SRC_URI_MUSL}"
32SRC_URI_MUSL = "\
33 file://0003-missing_type.h-add-comparison_fn_t.patch \
34 file://0004-add-fallback-parse_printf_format-implementation.patch \
35 file://0005-src-basic-missing.h-check-for-missing-strndupa.patch \
36 file://0007-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch \
37 file://0008-add-missing-FTW_-macros-for-musl.patch \
38 file://0010-Use-uintmax_t-for-handling-rlim_t.patch \
39 file://0011-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch \
40 file://0012-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch \
41 file://0013-Define-glibc-compatible-basename-for-non-glibc-syste.patch \
42 file://0014-Do-not-disable-buffering-when-writing-to-oom_score_a.patch \
43 file://0015-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch \
44 file://0018-avoid-redefinition-of-prctl_mm_map-structure.patch \
45 file://0022-do-not-disable-buffer-in-writing-files.patch \
46 file://0025-Handle-__cpu_mask-usage.patch \
47 file://0026-Handle-missing-gshadow.patch \
48 file://0028-missing_syscall.h-Define-MIPS-ABI-defines-for-musl.patch \
49 file://0001-pass-correct-parameters-to-getdents64.patch \
50 file://0002-Add-sys-stat.h-for-S_IFDIR.patch \
51 file://0001-Adjust-for-musl-headers.patch \
52 file://0001-test-bus-error-strerror-is-assumed-to-be-GNU-specifi.patch \
Andrew Geisslerc5535c92023-01-27 16:10:19 -060053 file://0001-errno-util-Make-STRERROR-portable-for-musl.patch \
Andrew Geissler517393d2023-01-13 08:55:19 -060054 "
55
56PAM_PLUGINS = " \
57 pam-plugin-unix \
58 pam-plugin-loginuid \
59 pam-plugin-keyinit \
60"
61
62PACKAGECONFIG ??= " \
63 ${@bb.utils.filter('DISTRO_FEATURES', 'acl audit efi ldconfig pam selinux smack usrmerge polkit seccomp', d)} \
64 ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \
65 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \
66 ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', '', 'link-udev-shared', d)} \
67 backlight \
68 binfmt \
69 gshadow \
70 hibernate \
71 hostnamed \
72 idn \
73 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 \
86 set-time-epoch \
87 sysusers \
88 sysvinit \
89 timedated \
90 timesyncd \
91 userdb \
92 utmp \
93 vconsole \
94 wheel-group \
95 zstd \
96"
97
98PACKAGECONFIG:remove:libc-musl = " \
99 gshadow \
100 idn \
101 localed \
102 myhostname \
103 nss \
104 nss-mymachines \
105 nss-resolve \
106 sysusers \
107 userdb \
108 utmp \
109"
110
111# https://github.com/seccomp/libseccomp/issues/347
112PACKAGECONFIG:remove:mipsarch = "seccomp"
113
114TARGET_CC_ARCH:append:libc-musl = " -D__UAPI_DEF_ETHHDR=0 -D_LARGEFILE64_SOURCE"
115
116# Some of the dependencies are weak-style recommends - if not available at runtime,
117# systemd won't fail but the library-related feature will be skipped with a warning.
118
119# Use the upstream systemd serial-getty@.service and rely on
120# systemd-getty-generator instead of using the OE-core specific
121# systemd-serialgetty.bb - not enabled by default.
122PACKAGECONFIG[serial-getty-generator] = ""
123
124PACKAGECONFIG[acl] = "-Dacl=true,-Dacl=false,acl"
125PACKAGECONFIG[audit] = "-Daudit=true,-Daudit=false,audit"
126PACKAGECONFIG[backlight] = "-Dbacklight=true,-Dbacklight=false"
127PACKAGECONFIG[binfmt] = "-Dbinfmt=true,-Dbinfmt=false"
128PACKAGECONFIG[bzip2] = "-Dbzip2=true,-Dbzip2=false,bzip2"
129PACKAGECONFIG[cgroupv2] = "-Ddefault-hierarchy=unified,-Ddefault-hierarchy=hybrid"
130PACKAGECONFIG[coredump] = "-Dcoredump=true,-Dcoredump=false"
131PACKAGECONFIG[cryptsetup] = "-Dlibcryptsetup=true,-Dlibcryptsetup=false,cryptsetup,,cryptsetup"
132PACKAGECONFIG[tpm2] = "-Dtpm2=true,-Dtpm2=false,tpm2-tss,tpm2-tss libtss2 libtss2-tcti-device"
Andrew Geisslerc5535c92023-01-27 16:10:19 -0600133# If multiple compression libraries are enabled, the format to use for compression is chosen implicitly,
134# so if you want to compress with e.g. lz4 you cannot enable zstd, so you cannot read zstd-compressed journal files.
135# This option allows to enable all compression formats for reading, but choosing a specific one for writing.
136PACKAGECONFIG[default-compression-lz4] = "-Dlz4=true -Ddefault-compression=lz4,,lz4"
137PACKAGECONFIG[default-compression-xz] = "-Dxz=true -Ddefault-compression=xz,,xz"
138PACKAGECONFIG[default-compression-zstd] = "-Dzstd=true -Ddefault-compression=zstd,,zstd"
Andrew Geissler517393d2023-01-13 08:55:19 -0600139PACKAGECONFIG[dbus] = "-Ddbus=true,-Ddbus=false,dbus"
140PACKAGECONFIG[efi] = "-Defi=true,-Defi=false"
141PACKAGECONFIG[gnu-efi] = "-Dgnu-efi=true -Defi-libdir=${STAGING_LIBDIR} -Defi-includedir=${STAGING_INCDIR}/efi,-Dgnu-efi=false,gnu-efi"
142PACKAGECONFIG[elfutils] = "-Delfutils=true,-Delfutils=false,elfutils"
143PACKAGECONFIG[firstboot] = "-Dfirstboot=true,-Dfirstboot=false"
144PACKAGECONFIG[repart] = "-Drepart=true,-Drepart=false"
145PACKAGECONFIG[homed] = "-Dhomed=true,-Dhomed=false"
146# Sign the journal for anti-tampering
147PACKAGECONFIG[gcrypt] = "-Dgcrypt=true,-Dgcrypt=false,libgcrypt"
148PACKAGECONFIG[gnutls] = "-Dgnutls=true,-Dgnutls=false,gnutls"
149PACKAGECONFIG[gshadow] = "-Dgshadow=true,-Dgshadow=false"
150PACKAGECONFIG[hibernate] = "-Dhibernate=true,-Dhibernate=false"
151PACKAGECONFIG[hostnamed] = "-Dhostnamed=true,-Dhostnamed=false"
152PACKAGECONFIG[idn] = "-Didn=true,-Didn=false"
153PACKAGECONFIG[ima] = "-Dima=true,-Dima=false"
154# importd requires journal-upload/xz/zlib/bzip2/gcrypt
155PACKAGECONFIG[importd] = "-Dimportd=true,-Dimportd=false,glib-2.0"
156# Update NAT firewall rules
157PACKAGECONFIG[iptc] = "-Dlibiptc=true,-Dlibiptc=false,iptables"
158PACKAGECONFIG[journal-upload] = "-Dlibcurl=true,-Dlibcurl=false,curl"
159PACKAGECONFIG[kmod] = "-Dkmod=true,-Dkmod=false,kmod"
160PACKAGECONFIG[ldconfig] = "-Dldconfig=true,-Dldconfig=false,,ldconfig"
161PACKAGECONFIG[libidn] = "-Dlibidn=true,-Dlibidn=false,libidn,,libidn"
162PACKAGECONFIG[libidn2] = "-Dlibidn2=true,-Dlibidn2=false,libidn2,,libidn2"
163# Link udev shared with systemd helper library.
164# If enabled the udev package depends on the systemd package (which has the needed shared library).
165PACKAGECONFIG[link-udev-shared] = "-Dlink-udev-shared=true,-Dlink-udev-shared=false"
166PACKAGECONFIG[localed] = "-Dlocaled=true,-Dlocaled=false"
167PACKAGECONFIG[logind] = "-Dlogind=true,-Dlogind=false"
168PACKAGECONFIG[lz4] = "-Dlz4=true,-Dlz4=false,lz4"
169PACKAGECONFIG[machined] = "-Dmachined=true,-Dmachined=false"
170PACKAGECONFIG[manpages] = "-Dman=true,-Dman=false,libxslt-native xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
171PACKAGECONFIG[microhttpd] = "-Dmicrohttpd=true,-Dmicrohttpd=false,libmicrohttpd"
172PACKAGECONFIG[myhostname] = "-Dnss-myhostname=true,-Dnss-myhostname=false,,libnss-myhostname"
173PACKAGECONFIG[networkd] = "-Dnetworkd=true,-Dnetworkd=false"
174PACKAGECONFIG[no-dns-fallback] = "-Ddns-servers="
175PACKAGECONFIG[nss] = "-Dnss-systemd=true,-Dnss-systemd=false"
176PACKAGECONFIG[nss-mymachines] = "-Dnss-mymachines=true,-Dnss-mymachines=false"
177PACKAGECONFIG[nss-resolve] = "-Dnss-resolve=true,-Dnss-resolve=false"
178PACKAGECONFIG[oomd] = "-Doomd=true,-Doomd=false"
179PACKAGECONFIG[openssl] = "-Dopenssl=true,-Dopenssl=false,openssl"
180PACKAGECONFIG[pam] = "-Dpam=true,-Dpam=false,libpam,${PAM_PLUGINS}"
181PACKAGECONFIG[pcre2] = "-Dpcre2=true,-Dpcre2=false,libpcre2"
182PACKAGECONFIG[polkit] = "-Dpolkit=true,-Dpolkit=false"
183# If polkit is disabled and networkd+hostnamed are in use, enabling this option and
184# using dbus-broker will allow networkd to be authorized to change the
185# hostname without acquiring additional privileges
186PACKAGECONFIG[polkit_hostnamed_fallback] = ",,,,dbus-broker,polkit"
187PACKAGECONFIG[portabled] = "-Dportabled=true,-Dportabled=false"
Patrick Williams864cc432023-02-09 14:54:44 -0600188PACKAGECONFIG[pstore] = "-Dpstore=true,-Dpstore=false"
Andrew Geissler517393d2023-01-13 08:55:19 -0600189PACKAGECONFIG[qrencode] = "-Dqrencode=true,-Dqrencode=false,qrencode,,qrencode"
190PACKAGECONFIG[quotacheck] = "-Dquotacheck=true,-Dquotacheck=false"
191PACKAGECONFIG[randomseed] = "-Drandomseed=true,-Drandomseed=false"
192PACKAGECONFIG[resolved] = "-Dresolve=true,-Dresolve=false"
193PACKAGECONFIG[rfkill] = "-Drfkill=true,-Drfkill=false"
194PACKAGECONFIG[seccomp] = "-Dseccomp=true,-Dseccomp=false,libseccomp"
195PACKAGECONFIG[selinux] = "-Dselinux=true,-Dselinux=false,libselinux,initscripts-sushell"
196PACKAGECONFIG[smack] = "-Dsmack=true,-Dsmack=false"
197PACKAGECONFIG[sysext] = "-Dsysext=true, -Dsysext=false"
198PACKAGECONFIG[sysusers] = "-Dsysusers=true,-Dsysusers=false"
199PACKAGECONFIG[sysvinit] = "-Dsysvinit-path=${sysconfdir}/init.d -Dsysvrcnd-path=${sysconfdir},-Dsysvinit-path= -Dsysvrcnd-path=,,systemd-compat-units update-rc.d"
200# When enabled use reproducble build timestamp if set as time epoch,
201# or build time if not. When disabled, time epoch is unset.
202def build_epoch(d):
203 epoch = d.getVar('SOURCE_DATE_EPOCH') or "-1"
204 return '-Dtime-epoch=%d' % int(epoch)
205PACKAGECONFIG[set-time-epoch] = "${@build_epoch(d)},-Dtime-epoch=0"
206PACKAGECONFIG[timedated] = "-Dtimedated=true,-Dtimedated=false"
207PACKAGECONFIG[timesyncd] = "-Dtimesyncd=true,-Dtimesyncd=false"
208PACKAGECONFIG[usrmerge] = "-Dsplit-usr=false,-Dsplit-usr=true"
209PACKAGECONFIG[sbinmerge] = "-Dsplit-bin=false,-Dsplit-bin=true"
210PACKAGECONFIG[userdb] = "-Duserdb=true,-Duserdb=false"
211PACKAGECONFIG[utmp] = "-Dutmp=true,-Dutmp=false"
212PACKAGECONFIG[valgrind] = "-DVALGRIND=1,,valgrind"
213PACKAGECONFIG[vconsole] = "-Dvconsole=true,-Dvconsole=false,,${PN}-vconsole-setup"
214PACKAGECONFIG[wheel-group] = "-Dwheel-group=true, -Dwheel-group=false"
215PACKAGECONFIG[xdg-autostart] = "-Dxdg-autostart=true,-Dxdg-autostart=false"
216# Verify keymaps on locale change
217PACKAGECONFIG[xkbcommon] = "-Dxkbcommon=true,-Dxkbcommon=false,libxkbcommon"
218PACKAGECONFIG[xz] = "-Dxz=true,-Dxz=false,xz"
219PACKAGECONFIG[zlib] = "-Dzlib=true,-Dzlib=false,zlib"
220PACKAGECONFIG[zstd] = "-Dzstd=true,-Dzstd=false,zstd"
221
222# Helper variables to clarify locations. This mirrors the logic in systemd's
223# build system.
224rootprefix ?= "${root_prefix}"
225rootlibdir ?= "${base_libdir}"
226rootlibexecdir = "${rootprefix}/lib"
227
228EXTRA_OEMESON += "-Dnobody-user=nobody \
229 -Dnobody-group=nobody \
230 -Drootlibdir=${rootlibdir} \
231 -Drootprefix=${rootprefix} \
232 -Ddefault-locale=C \
233 -Dmode=release \
234 -Dsystem-alloc-uid-min=101 \
235 -Dsystem-uid-max=999 \
236 -Dsystem-alloc-gid-min=101 \
237 -Dsystem-gid-max=999 \
238 "
239
240# Hardcode target binary paths to avoid using paths from sysroot
241EXTRA_OEMESON += "-Dkexec-path=${sbindir}/kexec \
242 -Dkmod-path=${base_bindir}/kmod \
243 -Dmount-path=${base_bindir}/mount \
244 -Dquotacheck-path=${sbindir}/quotacheck \
245 -Dquotaon-path=${sbindir}/quotaon \
246 -Dsulogin-path=${base_sbindir}/sulogin \
247 -Dnologin-path=${base_sbindir}/nologin \
248 -Dumount-path=${base_bindir}/umount"
249
250# The 60 seconds is watchdog's default vaule.
251WATCHDOG_TIMEOUT ??= "60"
252
253do_install() {
254 meson_do_install
255 install -d ${D}/${base_sbindir}
256 if ${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', 'false', 'true', d)}; then
257 # Provided by a separate recipe
258 rm ${D}${systemd_system_unitdir}/serial-getty* -f
259 fi
260
261 # Provide support for initramfs
262 [ ! -e ${D}/init ] && ln -s ${rootlibexecdir}/systemd/systemd ${D}/init
263 [ ! -e ${D}/${base_sbindir}/udevd ] && ln -s ${rootlibexecdir}/systemd/systemd-udevd ${D}/${base_sbindir}/udevd
264
265 install -d ${D}${sysconfdir}/udev/rules.d/
266 install -d ${D}${sysconfdir}/tmpfiles.d
267 for rule in $(find ${WORKDIR} -maxdepth 1 -type f -name "*.rules"); do
268 install -m 0644 $rule ${D}${sysconfdir}/udev/rules.d/
269 done
270
271 install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
272
273 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
274 install -d ${D}${sysconfdir}/init.d
275 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd
276 sed -i s%@UDEVD@%${rootlibexecdir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd
277 install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${systemd_unitdir}/systemd-sysv-install
278 fi
279
280 if "${@'true' if oe.types.boolean(d.getVar('VOLATILE_LOG_DIR')) else 'false'}"; then
281 # /var/log is typically a symbolic link to inside /var/volatile,
282 # which is expected to be empty.
283 rm -rf ${D}${localstatedir}/log
284 else
285 chown root:systemd-journal ${D}${localstatedir}/log/journal
286
287 # journal-remote creates this at start
288 rm -rf ${D}${localstatedir}/log/journal/remote
289 fi
290
Andrew Geissler6aa7eec2023-03-03 12:41:14 -0600291 # if the user requests /tmp be on persistent storage (i.e. not volatile)
292 # then don't use a tmpfs for /tmp
293 if [ "${VOLATILE_TMP_DIR}" != "yes" ]; then
294 rm -f ${D}${rootlibdir}/systemd/system/tmp.mount
295 rm -f ${D}${rootlibdir}/systemd/system/local-fs.target.wants/tmp.mount
296 fi
297
Andrew Geissler517393d2023-01-13 08:55:19 -0600298 install -d ${D}${systemd_system_unitdir}/graphical.target.wants
299 install -d ${D}${systemd_system_unitdir}/multi-user.target.wants
300 install -d ${D}${systemd_system_unitdir}/poweroff.target.wants
301 install -d ${D}${systemd_system_unitdir}/reboot.target.wants
302 install -d ${D}${systemd_system_unitdir}/rescue.target.wants
303
304 # Create symlinks for systemd-update-utmp-runlevel.service
305 if ${@bb.utils.contains('PACKAGECONFIG', 'utmp', 'true', 'false', d)}; then
306 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_system_unitdir}/graphical.target.wants/systemd-update-utmp-runlevel.service
307 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_system_unitdir}/multi-user.target.wants/systemd-update-utmp-runlevel.service
308 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_system_unitdir}/poweroff.target.wants/systemd-update-utmp-runlevel.service
309 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_system_unitdir}/reboot.target.wants/systemd-update-utmp-runlevel.service
310 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_system_unitdir}/rescue.target.wants/systemd-update-utmp-runlevel.service
311 fi
312
313 # this file is needed to exist if networkd is disabled but timesyncd is still in use since timesyncd checks it
314 # for existence else it fails
315 if [ -s ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf ] &&
316 ! ${@bb.utils.contains('PACKAGECONFIG', 'networkd', 'true', 'false', d)}; then
317 echo 'd /run/systemd/netif/links 0755 root root -' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
318 fi
319 if ! ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'true', 'false', d)}; then
320 echo 'L! ${sysconfdir}/resolv.conf - - - - ../run/systemd/resolve/resolv.conf' >>${D}${exec_prefix}/lib/tmpfiles.d/etc.conf
321 echo 'd /run/systemd/resolve 0755 root root -' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
322 echo 'f /run/systemd/resolve/resolv.conf 0644 root root' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
323 ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd
324 else
325 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
326 ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd
327 fi
328 if ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'false', 'true', d)}; then
329 rm ${D}${exec_prefix}/lib/tmpfiles.d/x11.conf
330 rm -r ${D}${sysconfdir}/X11
331 fi
332
333 # If polkit is setup fixup permissions and ownership
334 if ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'true', 'false', d)}; then
335 if [ -d ${D}${datadir}/polkit-1/rules.d ]; then
336 chmod 700 ${D}${datadir}/polkit-1/rules.d
337 chown polkitd:root ${D}${datadir}/polkit-1/rules.d
338 fi
339 fi
340
341 # If polkit is not available and a fallback was requested, install a drop-in that allows networkd to
342 # request hostname changes via DBUS without elevating its privileges
343 if ${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', 'true', 'false', d)}; then
344 install -d ${D}${systemd_system_unitdir}/systemd-hostnamed.service.d/
345 install -m 0644 ${WORKDIR}/00-hostnamed-network-user.conf ${D}${systemd_system_unitdir}/systemd-hostnamed.service.d/
346 install -d ${D}${datadir}/dbus-1/system.d/
347 install -m 0644 ${WORKDIR}/org.freedesktop.hostname1_no_polkit.conf ${D}${datadir}/dbus-1/system.d/
348 fi
349
350 # create link for existing udev rules
351 ln -s ${base_bindir}/udevadm ${D}${base_sbindir}/udevadm
352
353 # install default policy for presets
354 # https://www.freedesktop.org/wiki/Software/systemd/Preset/#howto
355 install -Dm 0644 ${WORKDIR}/99-default.preset ${D}${systemd_unitdir}/system-preset/99-default.preset
356
357 # add a profile fragment to disable systemd pager with busybox less
358 install -Dm 0644 ${WORKDIR}/systemd-pager.sh ${D}${sysconfdir}/profile.d/systemd-pager.sh
359
360 if [ -n "${WATCHDOG_TIMEOUT}" ]; then
361 sed -i -e 's/#RebootWatchdogSec=10min/RebootWatchdogSec=${WATCHDOG_TIMEOUT}/' \
362 ${D}/${sysconfdir}/systemd/system.conf
363 fi
364}
365
366python populate_packages:prepend (){
367 systemdlibdir = d.getVar("rootlibdir")
368 do_split_packages(d, systemdlibdir, r'^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True)
369}
370PACKAGES_DYNAMIC += "^lib(udev|systemd|nss).*"
371
372PACKAGE_BEFORE_PN = "\
373 ${PN}-gui \
374 ${PN}-vconsole-setup \
375 ${PN}-initramfs \
376 ${PN}-analyze \
377 ${PN}-kernel-install \
378 ${PN}-rpm-macros \
379 ${PN}-binfmt \
380 ${PN}-zsh-completion \
381 ${PN}-container \
382 ${PN}-journal-gatewayd \
383 ${PN}-journal-upload \
384 ${PN}-journal-remote \
385 ${PN}-extra-utils \
386 ${PN}-udev-rules \
387 libsystemd-shared \
388 udev \
389 udev-hwdb \
390"
391
392SUMMARY:${PN}-container = "Tools for containers and VMs"
393DESCRIPTION:${PN}-container = "Systemd tools to spawn and manage containers and virtual machines."
394
395SUMMARY:${PN}-journal-gatewayd = "HTTP server for journal events"
396DESCRIPTION:${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."
397
398SUMMARY:${PN}-journal-upload = "Send journal messages over the network"
399DESCRIPTION:${PN}-journal-upload = "systemd-journal-upload uploads journal entries to a specified URL."
400
401SUMMARY:${PN}-journal-remote = "Receive journal messages over the network"
402DESCRIPTION:${PN}-journal-remote = "systemd-journal-remote is a command to receive serialized journal events and store them to journal files."
403
404SUMMARY:libsystemd-shared = "Systemd shared library"
405
406SYSTEMD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'binfmt', '${PN}-binfmt', '', d)} \
407 ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-gatewayd', '', d)} \
408 ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-remote', '', d)} \
409 ${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '${PN}-journal-upload', '', d)} \
410"
411SYSTEMD_SERVICE:${PN}-binfmt = "systemd-binfmt.service"
412
413USERADD_PACKAGES = "${PN} ${PN}-extra-utils \
414 udev \
415 ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-gatewayd', '', d)} \
416 ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-remote', '', d)} \
417 ${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '${PN}-journal-upload', '', d)} \
418"
419GROUPADD_PARAM:${PN} = "-r systemd-journal;"
Andrew Geissler6aa7eec2023-03-03 12:41:14 -0600420GROUPADD_PARAM:udev = "-r render;-r sgx;"
Andrew Geissler517393d2023-01-13 08:55:19 -0600421GROUPADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', '-r systemd-hostname;', '', d)}"
422USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'coredump', '--system -d / -M --shell /sbin/nologin systemd-coredump;', '', d)}"
423USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'networkd', '--system -d / -M --shell /sbin/nologin systemd-network;', '', d)}"
424USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'polkit', '--system --no-create-home --user-group --home-dir ${sysconfdir}/polkit-1 polkitd;', '', d)}"
425USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'resolved', '--system -d / -M --shell /sbin/nologin systemd-resolve;', '', d)}"
426USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'timesyncd', '--system -d / -M --shell /sbin/nologin systemd-timesync;', '', d)}"
Andrew Geissler6aa7eec2023-03-03 12:41:14 -0600427USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'oomd', '--system -d / -M --shell /sbin/nologin systemd-oom;', '', d)}"
Andrew Geissler517393d2023-01-13 08:55:19 -0600428USERADD_PARAM:${PN}-extra-utils = "--system -d / -M --shell /sbin/nologin systemd-bus-proxy"
429USERADD_PARAM:${PN}-journal-gatewayd = "--system -d / -M --shell /sbin/nologin systemd-journal-gateway"
430USERADD_PARAM:${PN}-journal-remote = "--system -d / -M --shell /sbin/nologin systemd-journal-remote"
431USERADD_PARAM:${PN}-journal-upload = "--system -d / -M --shell /sbin/nologin systemd-journal-upload"
432
433FILES:${PN}-analyze = "${bindir}/systemd-analyze"
434
435FILES:${PN}-initramfs = "/init"
436RDEPENDS:${PN}-initramfs = "${PN}"
437
438FILES:${PN}-gui = "${bindir}/systemadm"
439
440FILES:${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \
441 ${systemd_system_unitdir}/systemd-vconsole-setup.service \
442 ${systemd_system_unitdir}/sysinit.target.wants/systemd-vconsole-setup.service"
443
444RDEPENDS:${PN}-kernel-install += "bash"
445FILES:${PN}-kernel-install = "${bindir}/kernel-install \
446 ${sysconfdir}/kernel/ \
447 ${exec_prefix}/lib/kernel \
448 "
449FILES:${PN}-rpm-macros = "${exec_prefix}/lib/rpm \
450 "
451
452FILES:${PN}-zsh-completion = "${datadir}/zsh/site-functions"
453
454FILES:${PN}-binfmt = "${sysconfdir}/binfmt.d/ \
455 ${exec_prefix}/lib/binfmt.d \
456 ${rootlibexecdir}/systemd/systemd-binfmt \
457 ${systemd_system_unitdir}/proc-sys-fs-binfmt_misc.* \
458 ${systemd_system_unitdir}/systemd-binfmt.service"
459RRECOMMENDS:${PN}-binfmt = "${@bb.utils.contains('PACKAGECONFIG', 'binfmt', 'kernel-module-binfmt-misc', '', d)}"
460
461RRECOMMENDS:${PN}-vconsole-setup = "${@bb.utils.contains('PACKAGECONFIG', 'vconsole', 'kbd kbd-consolefonts kbd-keymaps', '', d)}"
462
463
464FILES:${PN}-journal-gatewayd = "${rootlibexecdir}/systemd/systemd-journal-gatewayd \
465 ${systemd_system_unitdir}/systemd-journal-gatewayd.service \
466 ${systemd_system_unitdir}/systemd-journal-gatewayd.socket \
467 ${systemd_system_unitdir}/sockets.target.wants/systemd-journal-gatewayd.socket \
468 ${datadir}/systemd/gatewayd/browse.html \
469 "
470SYSTEMD_SERVICE:${PN}-journal-gatewayd = "systemd-journal-gatewayd.socket"
471
472FILES:${PN}-journal-upload = "${rootlibexecdir}/systemd/systemd-journal-upload \
473 ${systemd_system_unitdir}/systemd-journal-upload.service \
474 ${sysconfdir}/systemd/journal-upload.conf \
475 "
476SYSTEMD_SERVICE:${PN}-journal-upload = "systemd-journal-upload.service"
477
478FILES:${PN}-journal-remote = "${rootlibexecdir}/systemd/systemd-journal-remote \
479 ${sysconfdir}/systemd/journal-remote.conf \
480 ${systemd_system_unitdir}/systemd-journal-remote.service \
481 ${systemd_system_unitdir}/systemd-journal-remote.socket \
482 "
483SYSTEMD_SERVICE:${PN}-journal-remote = "systemd-journal-remote.socket"
484
485
486FILES:${PN}-container = "${sysconfdir}/dbus-1/system.d/org.freedesktop.import1.conf \
487 ${sysconfdir}/dbus-1/system.d/org.freedesktop.machine1.conf \
488 ${sysconfdir}/systemd/system/multi-user.target.wants/machines.target \
489 ${base_bindir}/machinectl \
490 ${bindir}/systemd-nspawn \
491 ${nonarch_libdir}/systemd/import-pubring.gpg \
492 ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.import1.busname \
493 ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.machine1.busname \
494 ${systemd_system_unitdir}/local-fs.target.wants/var-lib-machines.mount \
495 ${systemd_system_unitdir}/machines.target.wants/var-lib-machines.mount \
496 ${systemd_system_unitdir}/remote-fs.target.wants/var-lib-machines.mount \
497 ${systemd_system_unitdir}/machine.slice \
498 ${systemd_system_unitdir}/machines.target \
499 ${systemd_system_unitdir}/org.freedesktop.import1.busname \
500 ${systemd_system_unitdir}/org.freedesktop.machine1.busname \
501 ${systemd_system_unitdir}/systemd-importd.service \
502 ${systemd_system_unitdir}/systemd-machined.service \
503 ${systemd_system_unitdir}/dbus-org.freedesktop.machine1.service \
504 ${systemd_system_unitdir}/var-lib-machines.mount \
505 ${rootlibexecdir}/systemd/systemd-import \
506 ${rootlibexecdir}/systemd/systemd-importd \
507 ${rootlibexecdir}/systemd/systemd-machined \
508 ${rootlibexecdir}/systemd/systemd-pull \
509 ${exec_prefix}/lib/tmpfiles.d/systemd-nspawn.conf \
510 ${exec_prefix}/lib/tmpfiles.d/README \
511 ${systemd_system_unitdir}/systemd-nspawn@.service \
512 ${libdir}/libnss_mymachines.so.2 \
513 ${datadir}/dbus-1/system-services/org.freedesktop.import1.service \
514 ${datadir}/dbus-1/system-services/org.freedesktop.machine1.service \
515 ${datadir}/dbus-1/system.d/org.freedesktop.import1.conf \
516 ${datadir}/dbus-1/system.d/org.freedesktop.machine1.conf \
517 ${datadir}/polkit-1/actions/org.freedesktop.import1.policy \
518 ${datadir}/polkit-1/actions/org.freedesktop.machine1.policy \
519 "
520
521# "machinectl import-tar" uses "tar --numeric-owner", not supported by busybox.
522RRECOMMENDS:${PN}-container += "\
523 ${PN}-journal-gatewayd \
524 ${PN}-journal-remote \
525 ${PN}-journal-upload \
526 kernel-module-dm-mod \
527 kernel-module-loop \
528 kernel-module-tun \
529 tar \
530 "
531
532FILES:${PN}-extra-utils = "\
533 ${base_bindir}/systemd-escape \
534 ${base_bindir}/systemd-inhibit \
535 ${bindir}/systemd-detect-virt \
536 ${bindir}/systemd-dissect \
537 ${bindir}/systemd-path \
538 ${bindir}/systemd-run \
539 ${bindir}/systemd-cat \
540 ${bindir}/systemd-creds \
541 ${bindir}/systemd-cryptenroll \
542 ${bindir}/systemd-delta \
543 ${bindir}/systemd-cgls \
544 ${bindir}/systemd-cgtop \
545 ${bindir}/systemd-stdio-bridge \
546 ${base_bindir}/systemd-ask-password \
547 ${base_bindir}/systemd-tty-ask-password-agent \
548 ${systemd_system_unitdir}/initrd.target.wants/systemd-pcrphase-initrd.path \
549 ${systemd_system_unitdir}/systemd-ask-password-console.path \
550 ${systemd_system_unitdir}/systemd-ask-password-console.service \
551 ${systemd_system_unitdir}/systemd-ask-password-wall.path \
552 ${systemd_system_unitdir}/systemd-ask-password-wall.service \
553 ${systemd_system_unitdir}/sysinit.target.wants/systemd-ask-password-console.path \
554 ${systemd_system_unitdir}/sysinit.target.wants/systemd-ask-password-wall.path \
555 ${systemd_system_unitdir}/sysinit.target.wants/systemd-pcrphase.path \
556 ${systemd_system_unitdir}/sysinit.target.wants/systemd-pcrphase-sysinit.path \
557 ${systemd_system_unitdir}/multi-user.target.wants/systemd-ask-password-wall.path \
558 ${rootlibexecdir}/systemd/systemd-resolve-host \
559 ${rootlibexecdir}/systemd/systemd-ac-power \
560 ${rootlibexecdir}/systemd/systemd-activate \
561 ${rootlibexecdir}/systemd/systemd-bus-proxyd \
562 ${systemd_system_unitdir}/systemd-bus-proxyd.service \
563 ${systemd_system_unitdir}/systemd-bus-proxyd.socket \
564 ${rootlibexecdir}/systemd/systemd-measure \
565 ${rootlibexecdir}/systemd/systemd-pcrphase \
566 ${rootlibexecdir}/systemd/systemd-socket-proxyd \
567 ${rootlibexecdir}/systemd/systemd-reply-password \
568 ${rootlibexecdir}/systemd/systemd-sleep \
569 ${rootlibexecdir}/systemd/system-sleep \
570 ${systemd_system_unitdir}/systemd-hibernate.service \
571 ${systemd_system_unitdir}/systemd-hybrid-sleep.service \
572 ${systemd_system_unitdir}/systemd-pcrphase-initrd.service \
573 ${systemd_system_unitdir}/systemd-pcrphase.service \
574 ${systemd_system_unitdir}/systemd-pcrphase-sysinit.service \
575 ${systemd_system_unitdir}/systemd-suspend.service \
576 ${systemd_system_unitdir}/sleep.target \
577 ${rootlibexecdir}/systemd/systemd-initctl \
578 ${systemd_system_unitdir}/systemd-initctl.service \
579 ${systemd_system_unitdir}/systemd-initctl.socket \
580 ${systemd_system_unitdir}/sockets.target.wants/systemd-initctl.socket \
581 ${rootlibexecdir}/systemd/system-generators/systemd-gpt-auto-generator \
582 ${rootlibexecdir}/systemd/systemd-cgroups-agent \
583"
584
585FILES:${PN}-udev-rules = "\
586 ${rootlibexecdir}/udev/rules.d/70-uaccess.rules \
587 ${rootlibexecdir}/udev/rules.d/71-seat.rules \
588 ${rootlibexecdir}/udev/rules.d/73-seat-late.rules \
589 ${rootlibexecdir}/udev/rules.d/99-systemd.rules \
590"
591
592CONFFILES:${PN} = "${sysconfdir}/systemd/coredump.conf \
593 ${sysconfdir}/systemd/journald.conf \
594 ${sysconfdir}/systemd/logind.conf \
595 ${sysconfdir}/systemd/networkd.conf \
596 ${sysconfdir}/systemd/pstore.conf \
597 ${sysconfdir}/systemd/resolved.conf \
598 ${sysconfdir}/systemd/sleep.conf \
599 ${sysconfdir}/systemd/system.conf \
600 ${sysconfdir}/systemd/timesyncd.conf \
601 ${sysconfdir}/systemd/user.conf \
602"
603
604FILES:${PN} = " ${base_bindir}/* \
605 ${base_sbindir}/shutdown \
606 ${base_sbindir}/halt \
607 ${base_sbindir}/poweroff \
608 ${base_sbindir}/runlevel \
609 ${base_sbindir}/telinit \
610 ${base_sbindir}/resolvconf \
611 ${base_sbindir}/reboot \
612 ${base_sbindir}/init \
613 ${datadir}/dbus-1/services \
614 ${datadir}/dbus-1/system-services \
615 ${datadir}/polkit-1 \
616 ${datadir}/${BPN} \
617 ${datadir}/factory \
618 ${sysconfdir}/dbus-1/ \
619 ${sysconfdir}/modules-load.d/ \
620 ${sysconfdir}/pam.d/ \
621 ${sysconfdir}/profile.d/ \
622 ${sysconfdir}/sysctl.d/ \
623 ${sysconfdir}/systemd/ \
624 ${sysconfdir}/tmpfiles.d/ \
625 ${sysconfdir}/xdg/ \
626 ${sysconfdir}/init.d/README \
627 ${sysconfdir}/resolv-conf.systemd \
628 ${sysconfdir}/X11/xinit/xinitrc.d/* \
629 ${rootlibexecdir}/systemd/* \
630 ${rootlibdir}/systemd/libsystemd-core* \
631 ${libdir}/pam.d \
632 ${nonarch_libdir}/pam.d \
633 ${systemd_unitdir}/* \
634 ${base_libdir}/security/*.so \
635 /cgroup \
636 ${bindir}/systemd* \
637 ${bindir}/busctl \
638 ${bindir}/coredumpctl \
639 ${bindir}/localectl \
640 ${bindir}/hostnamectl \
641 ${bindir}/resolvectl \
642 ${bindir}/timedatectl \
643 ${bindir}/bootctl \
644 ${bindir}/oomctl \
645 ${bindir}/userdbctl \
646 ${exec_prefix}/lib/tmpfiles.d/*.conf \
647 ${exec_prefix}/lib/systemd \
648 ${exec_prefix}/lib/modules-load.d \
649 ${exec_prefix}/lib/sysctl.d \
650 ${exec_prefix}/lib/sysusers.d \
651 ${exec_prefix}/lib/environment.d \
652 ${localstatedir} \
653 ${rootlibexecdir}/modprobe.d/systemd.conf \
654 ${rootlibexecdir}/modprobe.d/README \
655 ${datadir}/dbus-1/system.d/org.freedesktop.timedate1.conf \
656 ${datadir}/dbus-1/system.d/org.freedesktop.locale1.conf \
657 ${datadir}/dbus-1/system.d/org.freedesktop.network1.conf \
658 ${datadir}/dbus-1/system.d/org.freedesktop.resolve1.conf \
659 ${datadir}/dbus-1/system.d/org.freedesktop.systemd1.conf \
660 ${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', '${datadir}/dbus-1/system.d/org.freedesktop.hostname1_no_polkit.conf', '', d)} \
661 ${datadir}/dbus-1/system.d/org.freedesktop.hostname1.conf \
662 ${datadir}/dbus-1/system.d/org.freedesktop.login1.conf \
663 ${datadir}/dbus-1/system.d/org.freedesktop.timesync1.conf \
664 ${datadir}/dbus-1/system.d/org.freedesktop.portable1.conf \
665 ${datadir}/dbus-1/system.d/org.freedesktop.oom1.conf \
666 ${datadir}/dbus-1/system.d/org.freedesktop.home1.conf \
667 "
668
669FILES:${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
670
671RDEPENDS:${PN} += "kmod dbus util-linux-mount util-linux-umount udev (= ${EXTENDPKGV}) systemd-udev-rules util-linux-agetty util-linux-fsck"
672RDEPENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', '', 'systemd-serialgetty', d)}"
673RDEPENDS:${PN} += "volatile-binds"
674
675RRECOMMENDS:${PN} += "systemd-extra-utils \
676 udev-hwdb \
677 e2fsprogs-e2fsck \
678 kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 kernel-module-sch-fq-codel \
679 os-release \
680 systemd-conf \
681"
682
683INSANE_SKIP:${PN} += "dev-so libdir"
684INSANE_SKIP:${PN}-dbg += "libdir"
685INSANE_SKIP:${PN}-doc += " libdir"
686INSANE_SKIP:libsystemd-shared += "libdir"
687
688FILES:libsystemd-shared = "${rootlibdir}/systemd/libsystemd-shared*.so"
689
690RPROVIDES:udev = "hotplug"
691
692RDEPENDS:udev-hwdb += "udev"
693
694FILES:udev += "${base_sbindir}/udevd \
695 ${rootlibexecdir}/systemd/network/99-default.link \
696 ${rootlibexecdir}/systemd/systemd-udevd \
697 ${rootlibexecdir}/udev/accelerometer \
698 ${rootlibexecdir}/udev/ata_id \
699 ${rootlibexecdir}/udev/cdrom_id \
700 ${rootlibexecdir}/udev/collect \
701 ${rootlibexecdir}/udev/dmi_memory_id \
702 ${rootlibexecdir}/udev/fido_id \
703 ${rootlibexecdir}/udev/findkeyboards \
704 ${rootlibexecdir}/udev/keyboard-force-release.sh \
705 ${rootlibexecdir}/udev/keymap \
706 ${rootlibexecdir}/udev/mtd_probe \
707 ${rootlibexecdir}/udev/scsi_id \
708 ${rootlibexecdir}/udev/v4l_id \
709 ${rootlibexecdir}/udev/keymaps \
710 ${rootlibexecdir}/udev/rules.d/50-udev-default.rules \
711 ${rootlibexecdir}/udev/rules.d/60-autosuspend.rules \
712 ${rootlibexecdir}/udev/rules.d/60-autosuspend-chromiumos.rules \
713 ${rootlibexecdir}/udev/rules.d/60-block.rules \
714 ${rootlibexecdir}/udev/rules.d/60-cdrom_id.rules \
715 ${rootlibexecdir}/udev/rules.d/60-drm.rules \
716 ${rootlibexecdir}/udev/rules.d/60-evdev.rules \
717 ${rootlibexecdir}/udev/rules.d/60-fido-id.rules \
718 ${rootlibexecdir}/udev/rules.d/60-input-id.rules \
719 ${rootlibexecdir}/udev/rules.d/60-persistent-alsa.rules \
720 ${rootlibexecdir}/udev/rules.d/60-persistent-input.rules \
721 ${rootlibexecdir}/udev/rules.d/60-persistent-storage.rules \
722 ${rootlibexecdir}/udev/rules.d/60-persistent-storage-tape.rules \
723 ${rootlibexecdir}/udev/rules.d/60-persistent-v4l.rules \
724 ${rootlibexecdir}/udev/rules.d/60-sensor.rules \
725 ${rootlibexecdir}/udev/rules.d/60-serial.rules \
726 ${rootlibexecdir}/udev/rules.d/61-autosuspend-manual.rules \
727 ${rootlibexecdir}/udev/rules.d/64-btrfs.rules \
728 ${rootlibexecdir}/udev/rules.d/70-camera.rules \
729 ${rootlibexecdir}/udev/rules.d/70-joystick.rules \
730 ${rootlibexecdir}/udev/rules.d/70-memory.rules \
731 ${rootlibexecdir}/udev/rules.d/70-mouse.rules \
732 ${rootlibexecdir}/udev/rules.d/70-power-switch.rules \
733 ${rootlibexecdir}/udev/rules.d/70-touchpad.rules \
734 ${rootlibexecdir}/udev/rules.d/75-net-description.rules \
735 ${rootlibexecdir}/udev/rules.d/75-probe_mtd.rules \
736 ${rootlibexecdir}/udev/rules.d/78-sound-card.rules \
737 ${rootlibexecdir}/udev/rules.d/80-drivers.rules \
738 ${rootlibexecdir}/udev/rules.d/80-net-setup-link.rules \
739 ${rootlibexecdir}/udev/rules.d/81-net-dhcp.rules \
740 ${rootlibexecdir}/udev/rules.d/90-vconsole.rules \
741 ${rootlibexecdir}/udev/rules.d/README \
742 ${sysconfdir}/udev \
743 ${sysconfdir}/init.d/systemd-udevd \
744 ${systemd_system_unitdir}/*udev* \
745 ${systemd_system_unitdir}/*.wants/*udev* \
746 ${base_bindir}/systemd-hwdb \
747 ${base_bindir}/udevadm \
748 ${base_sbindir}/udevadm \
749 ${datadir}/bash-completion/completions/udevadm \
750 ${systemd_system_unitdir}/systemd-hwdb-update.service \
751 "
752
753FILES:udev-hwdb = "${rootlibexecdir}/udev/hwdb.d \
754 "
755
756RCONFLICTS:${PN} = "tiny-init ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'resolvconf', '', d)}"
757
758INITSCRIPT_PACKAGES = "udev"
759INITSCRIPT_NAME:udev = "systemd-udevd"
760INITSCRIPT_PARAMS:udev = "start 03 S ."
761
762python __anonymous() {
763 if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
764 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
765
766 if bb.utils.contains('PACKAGECONFIG', 'repart', True, False, d) and not bb.utils.contains('PACKAGECONFIG', 'openssl', True, False, d):
767 bb.error("PACKAGECONFIG[repart] requires PACKAGECONFIG[openssl]")
768
769 if bb.utils.contains('PACKAGECONFIG', 'homed', True, False, d) and not bb.utils.contains('PACKAGECONFIG', 'userdb openssl cryptsetup', True, False, d):
770 bb.error("PACKAGECONFIG[homed] requires PACKAGECONFIG[userdb], PACKAGECONFIG[openssl] and PACKAGECONFIG[cryptsetup]")
771}
772
773python do_warn_musl() {
774 if d.getVar('TCLIBC') == "musl":
775 bb.warn("Using systemd with musl is not recommended since it is not supported upstream and some patches are known to be problematic.")
776}
777addtask warn_musl before do_configure
778
779ALTERNATIVE:${PN} = "halt reboot shutdown poweroff runlevel ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'resolv-conf', '', d)}"
780
781ALTERNATIVE_TARGET[resolv-conf] = "${sysconfdir}/resolv-conf.systemd"
782ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/resolv.conf"
783ALTERNATIVE_PRIORITY[resolv-conf] ?= "50"
784
785ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl"
786ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt"
787ALTERNATIVE_PRIORITY[halt] ?= "300"
788
789ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl"
790ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
791ALTERNATIVE_PRIORITY[reboot] ?= "300"
792
793ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl"
794ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown"
795ALTERNATIVE_PRIORITY[shutdown] ?= "300"
796
797ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl"
798ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
799ALTERNATIVE_PRIORITY[poweroff] ?= "300"
800
801ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"
802ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
803ALTERNATIVE_PRIORITY[runlevel] ?= "300"
804
805pkg_postinst:${PN}:libc-glibc () {
806 sed -e '/^hosts:/s/\s*\<myhostname\>//' \
807 -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \
808 -i $D${sysconfdir}/nsswitch.conf
809}
810
811pkg_prerm:${PN}:libc-glibc () {
812 sed -e '/^hosts:/s/\s*\<myhostname\>//' \
813 -e '/^hosts:/s/\s*myhostname//' \
814 -i $D${sysconfdir}/nsswitch.conf
815}
816
817PACKAGE_WRITE_DEPS += "qemu-native"
818pkg_postinst:udev-hwdb () {
819 if test -n "$D"; then
820 $INTERCEPT_DIR/postinst_intercept update_udev_hwdb ${PKG} mlprefix=${MLPREFIX} binprefix=${MLPREFIX} rootlibexecdir="${rootlibexecdir}" PREFERRED_PROVIDER_udev="${PREFERRED_PROVIDER_udev}" base_bindir="${base_bindir}"
821 else
822 udevadm hwdb --update
823 fi
824}
825
826pkg_prerm:udev-hwdb () {
827 rm -f $D${sysconfdir}/udev/hwdb.bin
828}