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