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