blob: 59e000f1ddc6670fdee74b9a8a8fe890a9c60b7b [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001require systemd.inc
2
3PROVIDES = "udev"
4
5PE = "1"
6
7DEPENDS = "intltool-native gperf-native libcap util-linux"
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 += "file://touchscreen.rules \
18 file://00-create-volatile.conf \
Andrew Geissler9b4d8b02021-02-19 12:26:16 -060019 ${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', 'file://org.freedesktop.hostname1_no_polkit.conf', '', d)} \
20 ${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', 'file://00-hostnamed-network-user.conf', '', d)} \
Andrew Geissler82c905d2020-04-13 13:39:40 -050021 file://init \
22 file://99-default.preset \
Andrew Geissler6ce62a22020-11-30 19:58:47 -060023 file://systemd-pager.sh \
Andrew Geissler82c905d2020-04-13 13:39:40 -050024 file://0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch \
25 file://0003-implment-systemd-sysv-install-for-OE.patch \
Andrew Geisslerf0343792020-11-18 10:42:21 -060026 file://0001-systemd.pc.in-use-ROOTPREFIX-without-suffixed-slash.patch \
Andrew Geissler6ce62a22020-11-30 19:58:47 -060027 file://0001-logind-Restore-chvt-as-non-root-user-without-polkit.patch \
Andrew Geisslerd1e89492021-02-12 15:35:20 -060028 file://0027-proc-dont-trigger-mount-error-with-invalid-options-o.patch \
29 file://0001-analyze-resolve-executable-path-if-it-is-relative.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050030 "
31
32# patches needed by musl
33SRC_URI_append_libc-musl = " ${SRC_URI_MUSL}"
34SRC_URI_MUSL = "\
35 file://0002-don-t-use-glibc-specific-qsort_r.patch \
36 file://0003-missing_type.h-add-__compare_fn_t-and-comparison_fn_.patch \
37 file://0004-add-fallback-parse_printf_format-implementation.patch \
38 file://0005-src-basic-missing.h-check-for-missing-strndupa.patch \
39 file://0006-Include-netinet-if_ether.h.patch \
Andrew Geisslerd1e89492021-02-12 15:35:20 -060040 file://0007-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050041 file://0008-add-missing-FTW_-macros-for-musl.patch \
Andrew Geisslerd1e89492021-02-12 15:35:20 -060042 file://0009-fix-missing-of-__register_atfork-for-non-glibc-build.patch \
43 file://0010-Use-uintmax_t-for-handling-rlim_t.patch \
44 file://0011-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch \
45 file://0012-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch \
46 file://0013-Define-glibc-compatible-basename-for-non-glibc-syste.patch \
47 file://0014-Do-not-disable-buffering-when-writing-to-oom_score_a.patch \
48 file://0015-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch \
49 file://0016-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch \
50 file://0017-missing_type.h-add-__compar_d_fn_t-definition.patch \
51 file://0018-avoid-redefinition-of-prctl_mm_map-structure.patch \
52 file://0019-Handle-missing-LOCK_EX.patch \
53 file://0020-Fix-incompatible-pointer-type-struct-sockaddr_un.patch \
54 file://0021-test-json.c-define-M_PIl.patch \
55 file://0022-do-not-disable-buffer-in-writing-files.patch \
Andrew Geisslerd1e89492021-02-12 15:35:20 -060056 file://0025-Handle-__cpu_mask-usage.patch \
57 file://0026-Handle-missing-gshadow.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050058 "
59
60PAM_PLUGINS = " \
61 pam-plugin-unix \
62 pam-plugin-loginuid \
63 pam-plugin-keyinit \
64"
65
66PACKAGECONFIG ??= " \
67 ${@bb.utils.filter('DISTRO_FEATURES', 'acl audit efi ldconfig pam selinux smack usrmerge polkit', d)} \
68 ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \
69 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \
70 backlight \
71 binfmt \
72 gshadow \
73 hibernate \
74 hostnamed \
75 idn \
76 ima \
77 kmod \
78 localed \
79 logind \
80 machined \
81 myhostname \
82 networkd \
83 nss \
84 nss-mymachines \
85 nss-resolve \
86 quotacheck \
87 randomseed \
88 resolved \
89 set-time-epoch \
90 sysusers \
91 sysvinit \
92 timedated \
93 timesyncd \
94 userdb \
95 utmp \
96 vconsole \
97 xz \
98"
99
100PACKAGECONFIG_remove_libc-musl = " \
101 gshadow \
102 idn \
103 localed \
104 myhostname \
105 nss \
106 nss-mymachines \
107 nss-resolve \
108 sysusers \
109 userdb \
110 utmp \
111"
112
113CFLAGS_append_libc-musl = " -D__UAPI_DEF_ETHHDR=0 "
114
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600115# Some of the dependencies are weak-style recommends - if not available at runtime,
116# systemd won't fail but the library-related feature will be skipped with a warning.
117
Andrew Geissler82c905d2020-04-13 13:39:40 -0500118# Use the upstream systemd serial-getty@.service and rely on
119# systemd-getty-generator instead of using the OE-core specific
120# systemd-serialgetty.bb - not enabled by default.
121PACKAGECONFIG[serial-getty-generator] = ""
122
123PACKAGECONFIG[acl] = "-Dacl=true,-Dacl=false,acl"
124PACKAGECONFIG[audit] = "-Daudit=true,-Daudit=false,audit"
125PACKAGECONFIG[backlight] = "-Dbacklight=true,-Dbacklight=false"
126PACKAGECONFIG[binfmt] = "-Dbinfmt=true,-Dbinfmt=false"
127PACKAGECONFIG[bzip2] = "-Dbzip2=true,-Dbzip2=false,bzip2"
128PACKAGECONFIG[cgroupv2] = "-Ddefault-hierarchy=unified,-Ddefault-hierarchy=hybrid"
129PACKAGECONFIG[coredump] = "-Dcoredump=true,-Dcoredump=false"
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600130PACKAGECONFIG[cryptsetup] = "-Dlibcryptsetup=true,-Dlibcryptsetup=false,cryptsetup,,cryptsetup"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500131PACKAGECONFIG[dbus] = "-Ddbus=true,-Ddbus=false,dbus"
132PACKAGECONFIG[efi] = "-Defi=true,-Defi=false"
133PACKAGECONFIG[gnu-efi] = "-Dgnu-efi=true -Defi-libdir=${STAGING_LIBDIR} -Defi-includedir=${STAGING_INCDIR}/efi,-Dgnu-efi=false,gnu-efi"
134PACKAGECONFIG[elfutils] = "-Delfutils=true,-Delfutils=false,elfutils"
135PACKAGECONFIG[firstboot] = "-Dfirstboot=true,-Dfirstboot=false"
136# Sign the journal for anti-tampering
137PACKAGECONFIG[gcrypt] = "-Dgcrypt=true,-Dgcrypt=false,libgcrypt"
138PACKAGECONFIG[gnutls] = "-Dgnutls=true,-Dgnutls=false,gnutls"
139PACKAGECONFIG[gshadow] = "-Dgshadow=true,-Dgshadow=false"
140PACKAGECONFIG[hibernate] = "-Dhibernate=true,-Dhibernate=false"
141PACKAGECONFIG[hostnamed] = "-Dhostnamed=true,-Dhostnamed=false"
142PACKAGECONFIG[idn] = "-Didn=true,-Didn=false"
143PACKAGECONFIG[ima] = "-Dima=true,-Dima=false"
144# importd requires curl/xz/zlib/bzip2/gcrypt
145PACKAGECONFIG[importd] = "-Dimportd=true,-Dimportd=false"
146# Update NAT firewall rules
147PACKAGECONFIG[iptc] = "-Dlibiptc=true,-Dlibiptc=false,iptables"
148PACKAGECONFIG[journal-upload] = "-Dlibcurl=true,-Dlibcurl=false,curl"
149PACKAGECONFIG[kmod] = "-Dkmod=true,-Dkmod=false,kmod"
150PACKAGECONFIG[ldconfig] = "-Dldconfig=true,-Dldconfig=false,,ldconfig"
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600151PACKAGECONFIG[libidn] = "-Dlibidn=true,-Dlibidn=false,libidn,,libidn"
152PACKAGECONFIG[libidn2] = "-Dlibidn2=true,-Dlibidn2=false,libidn2,,libidn2"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500153PACKAGECONFIG[localed] = "-Dlocaled=true,-Dlocaled=false"
154PACKAGECONFIG[logind] = "-Dlogind=true,-Dlogind=false"
155PACKAGECONFIG[lz4] = "-Dlz4=true,-Dlz4=false,lz4"
156PACKAGECONFIG[machined] = "-Dmachined=true,-Dmachined=false"
157PACKAGECONFIG[manpages] = "-Dman=true,-Dman=false,libxslt-native xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
158PACKAGECONFIG[microhttpd] = "-Dmicrohttpd=true,-Dmicrohttpd=false,libmicrohttpd"
159PACKAGECONFIG[myhostname] = "-Dnss-myhostname=true,-Dnss-myhostname=false,,libnss-myhostname"
160PACKAGECONFIG[networkd] = "-Dnetworkd=true,-Dnetworkd=false"
161PACKAGECONFIG[nss] = "-Dnss-systemd=true,-Dnss-systemd=false"
162PACKAGECONFIG[nss-mymachines] = "-Dnss-mymachines=true,-Dnss-mymachines=false"
163PACKAGECONFIG[nss-resolve] = "-Dnss-resolve=true,-Dnss-resolve=false"
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600164PACKAGECONFIG[oomd] = "-Doomd=true,-Doomd=false"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500165PACKAGECONFIG[openssl] = "-Dopenssl=true,-Dopenssl=false,openssl"
166PACKAGECONFIG[pam] = "-Dpam=true,-Dpam=false,libpam,${PAM_PLUGINS}"
167PACKAGECONFIG[pcre2] = "-Dpcre2=true,-Dpcre2=false,libpcre2"
168PACKAGECONFIG[polkit] = "-Dpolkit=true,-Dpolkit=false"
Andrew Geissler9b4d8b02021-02-19 12:26:16 -0600169# If polkit is disabled and networkd+hostnamed are in use, enabling this option and
170# using dbus-broker will allow networkd to be authorized to change the
171# hostname without acquiring additional privileges
172PACKAGECONFIG[polkit_hostnamed_fallback] = ",,,,dbus-broker,polkit"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500173PACKAGECONFIG[portabled] = "-Dportabled=true,-Dportabled=false"
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600174PACKAGECONFIG[qrencode] = "-Dqrencode=true,-Dqrencode=false,qrencode,,qrencode"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500175PACKAGECONFIG[quotacheck] = "-Dquotacheck=true,-Dquotacheck=false"
176PACKAGECONFIG[randomseed] = "-Drandomseed=true,-Drandomseed=false"
177PACKAGECONFIG[resolved] = "-Dresolve=true,-Dresolve=false"
178PACKAGECONFIG[rfkill] = "-Drfkill=true,-Drfkill=false"
179# libseccomp is found in meta-security
180PACKAGECONFIG[seccomp] = "-Dseccomp=true,-Dseccomp=false,libseccomp"
181PACKAGECONFIG[selinux] = "-Dselinux=true,-Dselinux=false,libselinux,initscripts-sushell"
182PACKAGECONFIG[smack] = "-Dsmack=true,-Dsmack=false"
183PACKAGECONFIG[sysusers] = "-Dsysusers=true,-Dsysusers=false"
184PACKAGECONFIG[sysvinit] = "-Dsysvinit-path=${sysconfdir}/init.d -Dsysvrcnd-path=${sysconfdir},-Dsysvinit-path= -Dsysvrcnd-path=,,systemd-compat-units update-rc.d"
185# When enabled use reproducble build timestamp if set as time epoch,
186# or build time if not. When disabled, time epoch is unset.
187def build_epoch(d):
188 epoch = d.getVar('SOURCE_DATE_EPOCH') or "-1"
189 return '-Dtime-epoch=%d' % int(epoch)
190PACKAGECONFIG[set-time-epoch] = "${@build_epoch(d)},-Dtime-epoch=0"
191PACKAGECONFIG[timedated] = "-Dtimedated=true,-Dtimedated=false"
192PACKAGECONFIG[timesyncd] = "-Dtimesyncd=true,-Dtimesyncd=false"
193PACKAGECONFIG[usrmerge] = "-Dsplit-usr=false,-Dsplit-usr=true"
194PACKAGECONFIG[sbinmerge] = "-Dsplit-bin=false,-Dsplit-bin=true"
195PACKAGECONFIG[userdb] = "-Duserdb=true,-Duserdb=false"
196PACKAGECONFIG[utmp] = "-Dutmp=true,-Dutmp=false"
197PACKAGECONFIG[valgrind] = "-DVALGRIND=1,,valgrind"
198PACKAGECONFIG[vconsole] = "-Dvconsole=true,-Dvconsole=false,,${PN}-vconsole-setup"
Andrew Geisslerc3d88e42020-10-02 09:45:00 -0500199PACKAGECONFIG[xdg-autostart] = "-Dxdg-autostart=true,-Dxdg-autostart=false"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500200# Verify keymaps on locale change
201PACKAGECONFIG[xkbcommon] = "-Dxkbcommon=true,-Dxkbcommon=false,libxkbcommon"
202PACKAGECONFIG[xz] = "-Dxz=true,-Dxz=false,xz"
203PACKAGECONFIG[zlib] = "-Dzlib=true,-Dzlib=false,zlib"
204
205# Helper variables to clarify locations. This mirrors the logic in systemd's
206# build system.
207rootprefix ?= "${root_prefix}"
208rootlibdir ?= "${base_libdir}"
209rootlibexecdir = "${rootprefix}/lib"
210
211# This links udev statically with systemd helper library.
212# Otherwise udev package would depend on systemd package (which has the needed shared library),
213# and always pull it into images.
214EXTRA_OEMESON += "-Dlink-udev-shared=false"
215
216EXTRA_OEMESON += "-Dnobody-user=nobody \
217 -Dnobody-group=nobody \
218 -Drootlibdir=${rootlibdir} \
219 -Drootprefix=${rootprefix} \
220 -Ddefault-locale=C \
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600221 -Dmode=release \
222 -Dsystem-alloc-uid-min=101 \
223 -Dsystem-uid-max=999 \
224 -Dsystem-alloc-gid-min=101 \
225 -Dsystem-gid-max=999 \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500226 "
227
228# Hardcode target binary paths to avoid using paths from sysroot
229EXTRA_OEMESON += "-Dkexec-path=${sbindir}/kexec \
230 -Dkmod-path=${base_bindir}/kmod \
231 -Dmount-path=${base_bindir}/mount \
232 -Dquotacheck-path=${sbindir}/quotacheck \
233 -Dquotaon-path=${sbindir}/quotaon \
234 -Dsulogin-path=${base_sbindir}/sulogin \
235 -Dnologin-path=${base_sbindir}/nologin \
236 -Dumount-path=${base_bindir}/umount"
237
238do_install() {
239 meson_do_install
240 install -d ${D}/${base_sbindir}
241 if ${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', 'false', 'true', d)}; then
242 # Provided by a separate recipe
243 rm ${D}${systemd_unitdir}/system/serial-getty* -f
244 fi
245
246 # Provide support for initramfs
247 [ ! -e ${D}/init ] && ln -s ${rootlibexecdir}/systemd/systemd ${D}/init
248 [ ! -e ${D}/${base_sbindir}/udevd ] && ln -s ${rootlibexecdir}/systemd/systemd-udevd ${D}/${base_sbindir}/udevd
249
250 install -d ${D}${sysconfdir}/udev/rules.d/
251 install -d ${D}${sysconfdir}/tmpfiles.d
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500252 for rule in $(find ${WORKDIR} -maxdepth 1 -type f -name "*.rules"); do
253 install -m 0644 $rule ${D}${sysconfdir}/udev/rules.d/
254 done
Andrew Geissler82c905d2020-04-13 13:39:40 -0500255
256 install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
257
258 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
259 install -d ${D}${sysconfdir}/init.d
260 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd
261 sed -i s%@UDEVD@%${rootlibexecdir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd
262 install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${systemd_unitdir}/systemd-sysv-install
263 fi
264
265 chown root:systemd-journal ${D}/${localstatedir}/log/journal
266
267 # Delete journal README, as log can be symlinked inside volatile.
268 rm -f ${D}/${localstatedir}/log/README
269
270 # journal-remote creates this at start
271 rm -rf ${D}/${localstatedir}/log/journal/remote
272
273 install -d ${D}${systemd_unitdir}/system/graphical.target.wants
274 install -d ${D}${systemd_unitdir}/system/multi-user.target.wants
275 install -d ${D}${systemd_unitdir}/system/poweroff.target.wants
276 install -d ${D}${systemd_unitdir}/system/reboot.target.wants
277 install -d ${D}${systemd_unitdir}/system/rescue.target.wants
278
279 # Create symlinks for systemd-update-utmp-runlevel.service
280 if ${@bb.utils.contains('PACKAGECONFIG', 'utmp', 'true', 'false', d)}; then
281 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/graphical.target.wants/systemd-update-utmp-runlevel.service
282 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/multi-user.target.wants/systemd-update-utmp-runlevel.service
283 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/poweroff.target.wants/systemd-update-utmp-runlevel.service
284 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/reboot.target.wants/systemd-update-utmp-runlevel.service
285 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/rescue.target.wants/systemd-update-utmp-runlevel.service
286 fi
287
288 # this file is needed to exist if networkd is disabled but timesyncd is still in use since timesyncd checks it
289 # for existence else it fails
290 if [ -s ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf ]; then
291 ${@bb.utils.contains('PACKAGECONFIG', 'networkd', ':', 'sed -i -e "\$ad /run/systemd/netif/links 0755 root root -" ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf', d)}
292 fi
293 if ! ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'true', 'false', d)}; then
294 echo 'L! ${sysconfdir}/resolv.conf - - - - ../run/systemd/resolve/resolv.conf' >>${D}${exec_prefix}/lib/tmpfiles.d/etc.conf
295 echo 'd /run/systemd/resolve 0755 root root -' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
296 echo 'f /run/systemd/resolve/resolv.conf 0644 root root' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
297 ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd
298 else
299 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
300 ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd
301 fi
302 if ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'false', 'true', d)}; then
303 rm ${D}${exec_prefix}/lib/tmpfiles.d/x11.conf
304 rm -r ${D}${sysconfdir}/X11
305 fi
306
307 # If polkit is setup fixup permissions and ownership
308 if ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'true', 'false', d)}; then
309 if [ -d ${D}${datadir}/polkit-1/rules.d ]; then
310 chmod 700 ${D}${datadir}/polkit-1/rules.d
311 chown polkitd:root ${D}${datadir}/polkit-1/rules.d
312 fi
313 fi
314
Andrew Geissler9b4d8b02021-02-19 12:26:16 -0600315 # If polkit is not available and a fallback was requested, install a drop-in that allows networkd to
316 # request hostname changes via DBUS without elevating its privileges
317 if ${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', 'true', 'false', d)}; then
318 install -d ${D}${systemd_unitdir}/system/systemd-hostnamed.service.d/
319 install -m 0644 ${WORKDIR}/00-hostnamed-network-user.conf ${D}${systemd_unitdir}/system/systemd-hostnamed.service.d/
320 install -d ${D}${datadir}/dbus-1/system.d/
321 install -m 0644 ${WORKDIR}/org.freedesktop.hostname1_no_polkit.conf ${D}${datadir}/dbus-1/system.d/
322 fi
323
Andrew Geissler82c905d2020-04-13 13:39:40 -0500324 # create link for existing udev rules
325 ln -s ${base_bindir}/udevadm ${D}${base_sbindir}/udevadm
326
327 # duplicate udevadm for postinst script
328 install -d ${D}${libexecdir}
329 ln ${D}${base_bindir}/udevadm ${D}${libexecdir}/${MLPREFIX}udevadm
330
331 # install default policy for presets
332 # https://www.freedesktop.org/wiki/Software/systemd/Preset/#howto
333 install -Dm 0644 ${WORKDIR}/99-default.preset ${D}${systemd_unitdir}/system-preset/99-default.preset
Andrew Geissler6ce62a22020-11-30 19:58:47 -0600334
335 # add a profile fragment to disable systemd pager with busybox less
336 install -Dm 0644 ${WORKDIR}/systemd-pager.sh ${D}${sysconfdir}/profile.d/systemd-pager.sh
Andrew Geissler82c905d2020-04-13 13:39:40 -0500337}
338
339python populate_packages_prepend (){
340 systemdlibdir = d.getVar("rootlibdir")
341 do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True)
342}
343PACKAGES_DYNAMIC += "^lib(udev|systemd|nss).*"
344
345PACKAGE_BEFORE_PN = "\
346 ${PN}-gui \
347 ${PN}-vconsole-setup \
348 ${PN}-initramfs \
349 ${PN}-analyze \
350 ${PN}-kernel-install \
351 ${PN}-rpm-macros \
352 ${PN}-binfmt \
353 ${PN}-zsh-completion \
354 ${PN}-container \
355 ${PN}-journal-gatewayd \
356 ${PN}-journal-upload \
357 ${PN}-journal-remote \
358 ${PN}-extra-utils \
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500359 ${PN}-udev-rules \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500360 udev \
361 udev-hwdb \
362"
363
364SUMMARY_${PN}-container = "Tools for containers and VMs"
365DESCRIPTION_${PN}-container = "Systemd tools to spawn and manage containers and virtual machines."
366
367SUMMARY_${PN}-journal-gatewayd = "HTTP server for journal events"
368DESCRIPTION_${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."
369
370SUMMARY_${PN}-journal-upload = "Send journal messages over the network"
371DESCRIPTION_${PN}-journal-upload = "systemd-journal-upload uploads journal entries to a specified URL."
372
373SUMMARY_${PN}-journal-remote = "Receive journal messages over the network"
374DESCRIPTION_${PN}-journal-remote = "systemd-journal-remote is a command to receive serialized journal events and store them to journal files."
375
376SYSTEMD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'binfmt', '${PN}-binfmt', '', d)} \
377 ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-gatewayd', '', d)} \
378 ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-remote', '', d)} \
379 ${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '${PN}-journal-upload', '', d)} \
380"
381SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service"
382
383USERADD_PACKAGES = "${PN} ${PN}-extra-utils \
384 ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-gateway', '', d)} \
385 ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-remote', '', d)} \
386 ${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '${PN}-journal-upload', '', d)} \
387"
Andrew Geissler9b4d8b02021-02-19 12:26:16 -0600388GROUPADD_PARAM_${PN} = "-r systemd-journal;"
389GROUPADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', '-r systemd-hostname;', '', d)}"
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600390USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'coredump', '--system -d / -M --shell /sbin/nologin systemd-coredump;', '', d)}"
391USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'networkd', '--system -d / -M --shell /sbin/nologin systemd-network;', '', d)}"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500392USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'polkit', '--system --no-create-home --user-group --home-dir ${sysconfdir}/polkit-1 polkitd;', '', d)}"
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600393USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'resolved', '--system -d / -M --shell /sbin/nologin systemd-resolve;', '', d)}"
394USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'timesyncd', '--system -d / -M --shell /sbin/nologin systemd-timesync;', '', d)}"
395USERADD_PARAM_${PN}-extra-utils = "--system -d / -M --shell /sbin/nologin systemd-bus-proxy"
396USERADD_PARAM_${PN}-journal-gateway = "--system -d / -M --shell /sbin/nologin systemd-journal-gateway"
397USERADD_PARAM_${PN}-journal-remote = "--system -d / -M --shell /sbin/nologin systemd-journal-remote"
398USERADD_PARAM_${PN}-journal-upload = "--system -d / -M --shell /sbin/nologin systemd-journal-upload"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500399
400FILES_${PN}-analyze = "${bindir}/systemd-analyze"
401
402FILES_${PN}-initramfs = "/init"
403RDEPENDS_${PN}-initramfs = "${PN}"
404
405FILES_${PN}-gui = "${bindir}/systemadm"
406
407FILES_${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \
408 ${systemd_unitdir}/system/systemd-vconsole-setup.service \
409 ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service"
410
411RDEPENDS_${PN}-kernel-install += "bash"
412FILES_${PN}-kernel-install = "${bindir}/kernel-install \
413 ${sysconfdir}/kernel/ \
414 ${exec_prefix}/lib/kernel \
415 "
416FILES_${PN}-rpm-macros = "${exec_prefix}/lib/rpm \
417 "
418
419FILES_${PN}-zsh-completion = "${datadir}/zsh/site-functions"
420
421FILES_${PN}-binfmt = "${sysconfdir}/binfmt.d/ \
422 ${exec_prefix}/lib/binfmt.d \
423 ${rootlibexecdir}/systemd/systemd-binfmt \
424 ${systemd_unitdir}/system/proc-sys-fs-binfmt_misc.* \
425 ${systemd_unitdir}/system/systemd-binfmt.service"
426RRECOMMENDS_${PN}-binfmt = "kernel-module-binfmt-misc"
427
428RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts kbd-keymaps"
429
430
431FILES_${PN}-journal-gatewayd = "${rootlibexecdir}/systemd/systemd-journal-gatewayd \
432 ${systemd_system_unitdir}/systemd-journal-gatewayd.service \
433 ${systemd_system_unitdir}/systemd-journal-gatewayd.socket \
434 ${systemd_system_unitdir}/sockets.target.wants/systemd-journal-gatewayd.socket \
435 ${datadir}/systemd/gatewayd/browse.html \
436 "
437SYSTEMD_SERVICE_${PN}-journal-gatewayd = "systemd-journal-gatewayd.socket"
438
439FILES_${PN}-journal-upload = "${rootlibexecdir}/systemd/systemd-journal-upload \
440 ${systemd_system_unitdir}/systemd-journal-upload.service \
441 ${sysconfdir}/systemd/journal-upload.conf \
442 "
443SYSTEMD_SERVICE_${PN}-journal-upload = "systemd-journal-upload.service"
444
445FILES_${PN}-journal-remote = "${rootlibexecdir}/systemd/systemd-journal-remote \
446 ${sysconfdir}/systemd/journal-remote.conf \
447 ${systemd_system_unitdir}/systemd-journal-remote.service \
448 ${systemd_system_unitdir}/systemd-journal-remote.socket \
449 "
450SYSTEMD_SERVICE_${PN}-journal-remote = "systemd-journal-remote.socket"
451
452
453FILES_${PN}-container = "${sysconfdir}/dbus-1/system.d/org.freedesktop.import1.conf \
454 ${sysconfdir}/dbus-1/system.d/org.freedesktop.machine1.conf \
455 ${sysconfdir}/systemd/system/multi-user.target.wants/machines.target \
456 ${base_bindir}/machinectl \
457 ${bindir}/systemd-nspawn \
458 ${nonarch_libdir}/systemd/import-pubring.gpg \
459 ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.import1.busname \
460 ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.machine1.busname \
461 ${systemd_system_unitdir}/local-fs.target.wants/var-lib-machines.mount \
462 ${systemd_system_unitdir}/machines.target.wants/var-lib-machines.mount \
463 ${systemd_system_unitdir}/remote-fs.target.wants/var-lib-machines.mount \
464 ${systemd_system_unitdir}/machine.slice \
465 ${systemd_system_unitdir}/machines.target \
466 ${systemd_system_unitdir}/org.freedesktop.import1.busname \
467 ${systemd_system_unitdir}/org.freedesktop.machine1.busname \
468 ${systemd_system_unitdir}/systemd-importd.service \
469 ${systemd_system_unitdir}/systemd-machined.service \
470 ${systemd_system_unitdir}/dbus-org.freedesktop.machine1.service \
471 ${systemd_system_unitdir}/var-lib-machines.mount \
472 ${rootlibexecdir}/systemd/systemd-import \
473 ${rootlibexecdir}/systemd/systemd-importd \
474 ${rootlibexecdir}/systemd/systemd-machined \
475 ${rootlibexecdir}/systemd/systemd-pull \
476 ${exec_prefix}/lib/tmpfiles.d/systemd-nspawn.conf \
477 ${systemd_system_unitdir}/systemd-nspawn@.service \
478 ${libdir}/libnss_mymachines.so.2 \
479 ${datadir}/dbus-1/system-services/org.freedesktop.import1.service \
480 ${datadir}/dbus-1/system-services/org.freedesktop.machine1.service \
481 ${datadir}/dbus-1/system.d/org.freedesktop.import1.conf \
482 ${datadir}/dbus-1/system.d/org.freedesktop.machine1.conf \
483 ${datadir}/polkit-1/actions/org.freedesktop.import1.policy \
484 ${datadir}/polkit-1/actions/org.freedesktop.machine1.policy \
485 "
486
487RRECOMMENDS_${PN}-container += "\
488 ${PN}-journal-upload \
489 ${PN}-journal-remote \
490 ${PN}-journal-gatewayd \
491 "
492
493FILES_${PN}-extra-utils = "\
494 ${base_bindir}/systemd-escape \
495 ${base_bindir}/systemd-inhibit \
496 ${bindir}/systemd-detect-virt \
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600497 ${bindir}/systemd-dissect \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500498 ${bindir}/systemd-path \
499 ${bindir}/systemd-run \
500 ${bindir}/systemd-cat \
501 ${bindir}/systemd-delta \
502 ${bindir}/systemd-cgls \
503 ${bindir}/systemd-cgtop \
504 ${bindir}/systemd-stdio-bridge \
505 ${base_bindir}/systemd-ask-password \
506 ${base_bindir}/systemd-tty-ask-password-agent \
507 ${systemd_unitdir}/system/systemd-ask-password-console.path \
508 ${systemd_unitdir}/system/systemd-ask-password-console.service \
509 ${systemd_unitdir}/system/systemd-ask-password-wall.path \
510 ${systemd_unitdir}/system/systemd-ask-password-wall.service \
511 ${systemd_unitdir}/system/sysinit.target.wants/systemd-ask-password-console.path \
512 ${systemd_unitdir}/system/sysinit.target.wants/systemd-ask-password-wall.path \
513 ${systemd_unitdir}/system/multi-user.target.wants/systemd-ask-password-wall.path \
514 ${rootlibexecdir}/systemd/systemd-resolve-host \
515 ${rootlibexecdir}/systemd/systemd-ac-power \
516 ${rootlibexecdir}/systemd/systemd-activate \
517 ${rootlibexecdir}/systemd/systemd-bus-proxyd \
518 ${systemd_unitdir}/system/systemd-bus-proxyd.service \
519 ${systemd_unitdir}/system/systemd-bus-proxyd.socket \
520 ${rootlibexecdir}/systemd/systemd-socket-proxyd \
521 ${rootlibexecdir}/systemd/systemd-reply-password \
522 ${rootlibexecdir}/systemd/systemd-sleep \
523 ${rootlibexecdir}/systemd/system-sleep \
524 ${systemd_unitdir}/system/systemd-hibernate.service \
525 ${systemd_unitdir}/system/systemd-hybrid-sleep.service \
526 ${systemd_unitdir}/system/systemd-suspend.service \
527 ${systemd_unitdir}/system/sleep.target \
528 ${rootlibexecdir}/systemd/systemd-initctl \
529 ${systemd_unitdir}/system/systemd-initctl.service \
530 ${systemd_unitdir}/system/systemd-initctl.socket \
531 ${systemd_unitdir}/system/sockets.target.wants/systemd-initctl.socket \
532 ${rootlibexecdir}/systemd/system-generators/systemd-gpt-auto-generator \
533 ${rootlibexecdir}/systemd/systemd-cgroups-agent \
534"
535
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500536FILES_${PN}-udev-rules = "\
537 ${rootlibexecdir}/udev/rules.d/70-uaccess.rules \
538 ${rootlibexecdir}/udev/rules.d/71-seat.rules \
539 ${rootlibexecdir}/udev/rules.d/73-seat-late.rules \
540 ${rootlibexecdir}/udev/rules.d/99-systemd.rules \
541"
542
Andrew Geissler82c905d2020-04-13 13:39:40 -0500543CONFFILES_${PN} = "${sysconfdir}/systemd/coredump.conf \
544 ${sysconfdir}/systemd/journald.conf \
545 ${sysconfdir}/systemd/logind.conf \
546 ${sysconfdir}/systemd/networkd.conf \
547 ${sysconfdir}/systemd/pstore.conf \
548 ${sysconfdir}/systemd/resolved.conf \
549 ${sysconfdir}/systemd/sleep.conf \
550 ${sysconfdir}/systemd/system.conf \
551 ${sysconfdir}/systemd/timesyncd.conf \
552 ${sysconfdir}/systemd/user.conf \
553"
554
555FILES_${PN} = " ${base_bindir}/* \
556 ${base_sbindir}/shutdown \
557 ${base_sbindir}/halt \
558 ${base_sbindir}/poweroff \
559 ${base_sbindir}/runlevel \
560 ${base_sbindir}/telinit \
561 ${base_sbindir}/resolvconf \
562 ${base_sbindir}/reboot \
563 ${base_sbindir}/init \
564 ${datadir}/dbus-1/services \
565 ${datadir}/dbus-1/system-services \
566 ${datadir}/polkit-1 \
567 ${datadir}/${BPN} \
568 ${datadir}/factory \
569 ${sysconfdir}/dbus-1/ \
570 ${sysconfdir}/modules-load.d/ \
571 ${sysconfdir}/pam.d/ \
Andrew Geissler6ce62a22020-11-30 19:58:47 -0600572 ${sysconfdir}/profile.d/ \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500573 ${sysconfdir}/sysctl.d/ \
574 ${sysconfdir}/systemd/ \
575 ${sysconfdir}/tmpfiles.d/ \
576 ${sysconfdir}/xdg/ \
577 ${sysconfdir}/init.d/README \
578 ${sysconfdir}/resolv-conf.systemd \
579 ${sysconfdir}/X11/xinit/xinitrc.d/* \
580 ${rootlibexecdir}/systemd/* \
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600581 ${libdir}/pam.d \
582 ${nonarch_libdir}/pam.d \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500583 ${systemd_unitdir}/* \
584 ${base_libdir}/security/*.so \
585 /cgroup \
586 ${bindir}/systemd* \
587 ${bindir}/busctl \
588 ${bindir}/coredumpctl \
589 ${bindir}/localectl \
590 ${bindir}/hostnamectl \
591 ${bindir}/resolvectl \
592 ${bindir}/timedatectl \
593 ${bindir}/bootctl \
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600594 ${bindir}/oomctl \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500595 ${exec_prefix}/lib/tmpfiles.d/*.conf \
596 ${exec_prefix}/lib/systemd \
597 ${exec_prefix}/lib/modules-load.d \
598 ${exec_prefix}/lib/sysctl.d \
599 ${exec_prefix}/lib/sysusers.d \
600 ${exec_prefix}/lib/environment.d \
601 ${localstatedir} \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500602 ${rootlibexecdir}/modprobe.d/systemd.conf \
603 ${datadir}/dbus-1/system.d/org.freedesktop.timedate1.conf \
604 ${datadir}/dbus-1/system.d/org.freedesktop.locale1.conf \
605 ${datadir}/dbus-1/system.d/org.freedesktop.network1.conf \
606 ${datadir}/dbus-1/system.d/org.freedesktop.resolve1.conf \
607 ${datadir}/dbus-1/system.d/org.freedesktop.systemd1.conf \
Andrew Geissler9b4d8b02021-02-19 12:26:16 -0600608 ${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', '${datadir}/dbus-1/system.d/org.freedesktop.hostname1_no_polkit.conf', '', d)} \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500609 ${datadir}/dbus-1/system.d/org.freedesktop.hostname1.conf \
610 ${datadir}/dbus-1/system.d/org.freedesktop.login1.conf \
611 ${datadir}/dbus-1/system.d/org.freedesktop.timesync1.conf \
612 ${datadir}/dbus-1/system.d/org.freedesktop.portable1.conf \
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600613 ${datadir}/dbus-1/system.d/org.freedesktop.oom1.conf \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500614 "
615
616FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
617
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500618RDEPENDS_${PN} += "kmod dbus util-linux-mount util-linux-umount udev (= ${EXTENDPKGV}) systemd-udev-rules util-linux-agetty util-linux-fsck"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500619RDEPENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', '', 'systemd-serialgetty', d)}"
620RDEPENDS_${PN} += "volatile-binds"
621
622RRECOMMENDS_${PN} += "systemd-extra-utils \
623 udev-hwdb \
624 e2fsprogs-e2fsck \
625 kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 kernel-module-sch-fq-codel \
626 os-release \
627 systemd-conf \
628"
629
630INSANE_SKIP_${PN} += "dev-so libdir"
631INSANE_SKIP_${PN}-dbg += "libdir"
632INSANE_SKIP_${PN}-doc += " libdir"
633
634RPROVIDES_udev = "hotplug"
635
636RDEPENDS_udev-hwdb += "udev"
637
638FILES_udev += "${base_sbindir}/udevd \
639 ${rootlibexecdir}/systemd/network/99-default.link \
640 ${rootlibexecdir}/systemd/systemd-udevd \
641 ${rootlibexecdir}/udev/accelerometer \
642 ${rootlibexecdir}/udev/ata_id \
643 ${rootlibexecdir}/udev/cdrom_id \
644 ${rootlibexecdir}/udev/collect \
645 ${rootlibexecdir}/udev/fido_id \
646 ${rootlibexecdir}/udev/findkeyboards \
647 ${rootlibexecdir}/udev/keyboard-force-release.sh \
648 ${rootlibexecdir}/udev/keymap \
649 ${rootlibexecdir}/udev/mtd_probe \
650 ${rootlibexecdir}/udev/scsi_id \
651 ${rootlibexecdir}/udev/v4l_id \
652 ${rootlibexecdir}/udev/keymaps \
653 ${rootlibexecdir}/udev/rules.d/50-udev-default.rules \
Andrew Geissler635e0e42020-08-21 15:58:33 -0500654 ${rootlibexecdir}/udev/rules.d/60-autosuspend.rules \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500655 ${rootlibexecdir}/udev/rules.d/60-autosuspend-chromiumos.rules \
656 ${rootlibexecdir}/udev/rules.d/60-block.rules \
657 ${rootlibexecdir}/udev/rules.d/60-cdrom_id.rules \
658 ${rootlibexecdir}/udev/rules.d/60-drm.rules \
659 ${rootlibexecdir}/udev/rules.d/60-evdev.rules \
660 ${rootlibexecdir}/udev/rules.d/60-fido-id.rules \
661 ${rootlibexecdir}/udev/rules.d/60-input-id.rules \
662 ${rootlibexecdir}/udev/rules.d/60-persistent-alsa.rules \
663 ${rootlibexecdir}/udev/rules.d/60-persistent-input.rules \
664 ${rootlibexecdir}/udev/rules.d/60-persistent-storage.rules \
665 ${rootlibexecdir}/udev/rules.d/60-persistent-storage-tape.rules \
666 ${rootlibexecdir}/udev/rules.d/60-persistent-v4l.rules \
667 ${rootlibexecdir}/udev/rules.d/60-sensor.rules \
668 ${rootlibexecdir}/udev/rules.d/60-serial.rules \
669 ${rootlibexecdir}/udev/rules.d/61-autosuspend-manual.rules \
670 ${rootlibexecdir}/udev/rules.d/64-btrfs.rules \
671 ${rootlibexecdir}/udev/rules.d/70-joystick.rules \
672 ${rootlibexecdir}/udev/rules.d/70-mouse.rules \
673 ${rootlibexecdir}/udev/rules.d/70-power-switch.rules \
674 ${rootlibexecdir}/udev/rules.d/70-touchpad.rules \
675 ${rootlibexecdir}/udev/rules.d/75-net-description.rules \
676 ${rootlibexecdir}/udev/rules.d/75-probe_mtd.rules \
677 ${rootlibexecdir}/udev/rules.d/78-sound-card.rules \
678 ${rootlibexecdir}/udev/rules.d/80-drivers.rules \
679 ${rootlibexecdir}/udev/rules.d/80-net-setup-link.rules \
680 ${rootlibexecdir}/udev/rules.d/90-vconsole.rules \
681 ${sysconfdir}/udev \
682 ${sysconfdir}/init.d/systemd-udevd \
683 ${systemd_unitdir}/system/*udev* \
684 ${systemd_unitdir}/system/*.wants/*udev* \
685 ${base_bindir}/systemd-hwdb \
686 ${base_bindir}/udevadm \
687 ${base_sbindir}/udevadm \
688 ${libexecdir}/${MLPREFIX}udevadm \
689 ${datadir}/bash-completion/completions/udevadm \
690 ${systemd_unitdir}/system/systemd-hwdb-update.service \
691 "
692
693FILES_udev-hwdb = "${rootlibexecdir}/udev/hwdb.d \
694 "
695
696RCONFLICTS_${PN} = "tiny-init ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'resolvconf', '', d)}"
697
698INITSCRIPT_PACKAGES = "udev"
699INITSCRIPT_NAME_udev = "systemd-udevd"
700INITSCRIPT_PARAMS_udev = "start 03 S ."
701
702python __anonymous() {
703 if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
704 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
705}
706
707python do_warn_musl() {
708 if d.getVar('TCLIBC') == "musl":
709 bb.warn("Using systemd with musl is not recommended since it is not supported upstream and some patches are known to be problematic.")
710}
711addtask warn_musl before do_configure
712
713ALTERNATIVE_${PN} = "halt reboot shutdown poweroff runlevel ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'resolv-conf', '', d)}"
714
715ALTERNATIVE_TARGET[resolv-conf] = "${sysconfdir}/resolv-conf.systemd"
716ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/resolv.conf"
717ALTERNATIVE_PRIORITY[resolv-conf] ?= "50"
718
719ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl"
720ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt"
721ALTERNATIVE_PRIORITY[halt] ?= "300"
722
723ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl"
724ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
725ALTERNATIVE_PRIORITY[reboot] ?= "300"
726
727ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl"
728ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown"
729ALTERNATIVE_PRIORITY[shutdown] ?= "300"
730
731ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl"
732ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
733ALTERNATIVE_PRIORITY[poweroff] ?= "300"
734
735ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"
736ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
737ALTERNATIVE_PRIORITY[runlevel] ?= "300"
738
739pkg_postinst_${PN}_libc-glibc () {
740 sed -e '/^hosts:/s/\s*\<myhostname\>//' \
741 -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \
742 -i $D${sysconfdir}/nsswitch.conf
743}
744
745pkg_prerm_${PN}_libc-glibc () {
746 sed -e '/^hosts:/s/\s*\<myhostname\>//' \
747 -e '/^hosts:/s/\s*myhostname//' \
748 -i $D${sysconfdir}/nsswitch.conf
749}
750
751PACKAGE_WRITE_DEPS += "qemu-native"
752pkg_postinst_udev-hwdb () {
753 if test -n "$D"; then
754 $INTERCEPT_DIR/postinst_intercept update_udev_hwdb ${PKG} mlprefix=${MLPREFIX} binprefix=${MLPREFIX} rootlibexecdir="${rootlibexecdir}" PREFERRED_PROVIDER_udev="${PREFERRED_PROVIDER_udev}"
755 else
756 udevadm hwdb --update
757 fi
758}
759
760pkg_prerm_udev-hwdb () {
761 rm -f $D${sysconfdir}/udev/hwdb.bin
762}