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