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