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