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