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