blob: 3dbeaac3427a295e2346d8039d9bad3c04dd0579 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001require systemd.inc
2
3PROVIDES = "udev"
4
5PE = "1"
6
7DEPENDS = "intltool-native gperf-native libcap util-linux"
8
9SECTION = "base/shell"
10
11inherit useradd pkgconfig meson perlnative update-rc.d update-alternatives qemu systemd gettext bash-completion manpages distro_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 file://init \
20 file://0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch \
21 file://0002-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch \
22 file://0003-implment-systemd-sysv-install-for-OE.patch \
23 file://0004-rules-whitelist-hd-devices.patch \
24 file://0005-Make-root-s-home-directory-configurable.patch \
25 file://0006-remove-nobody-user-group-checking.patch \
26 file://0007-rules-watch-metadata-changes-in-ide-devices.patch \
27 file://0008-Do-not-enable-nss-tests-if-nss-systemd-is-not-enable.patch \
28 file://0009-nss-mymachines-Build-conditionally-when-ENABLE_MYHOS.patch \
29 file://0001-login-use-parse_uid-when-unmounting-user-runtime-dir.patch \
30 file://0001-sd-bus-make-BUS_DEFAULT_TIMEOUT-configurable.patch \
31 file://0022-build-sys-Detect-whether-struct-statx-is-defined-in-.patch \
32 file://0023-resolvconf-fixes-for-the-compatibility-interface.patch \
33 file://0001-core-when-deserializing-state-always-use-read_line-L.patch \
34 file://0001-chown-recursive-let-s-rework-the-recursive-logic-to-.patch \
35 file://0001-dhcp6-make-sure-we-have-enough-space-for-the-DHCP6-o.patch \
36 "
37
38# patches made for musl are only applied on TCLIBC is musl
39SRC_URI += "${SRC_URI_MUSL}"
40SRC_URI_MUSL = "file://0001-Use-getenv-when-secure-versions-are-not-available.patch \
41 file://0002-don-t-use-glibc-specific-qsort_r.patch \
42 file://0003-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch \
43 file://0004-add-fallback-parse_printf_format-implementation.patch \
44 file://0005-include-gshadow-only-if-ENABLE_GSHADOW-is-1.patch \
45 file://0006-src-basic-missing.h-check-for-missing-strndupa.patch \
46 file://0007-Include-netinet-if_ether.h.patch \
47 file://0008-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch \
48 file://0009-add-missing-FTW_-macros-for-musl.patch \
49 file://0010-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch \
50 file://0011-src-basic-missing.h-check-for-missing-__compar_fn_t-.patch \
51 file://0012-fix-missing-of-__register_atfork-for-non-glibc-build.patch \
52 file://0013-Use-uintmax_t-for-handling-rlim_t.patch \
53 file://0014-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch \
54 file://0015-test-hexdecoct.c-Include-missing.h-for-strndupa.patch \
55 file://0016-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch \
56 file://0017-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch \
57 file://0018-Define-glibc-compatible-basename-for-non-glibc-syste.patch \
58 file://0019-Do-not-disable-buffering-when-writing-to-oom_score_a.patch \
59 file://0020-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch \
60 file://0021-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch \
61 "
62
63# Workaround undefined reference to `__stack_chk_fail_local' on qemux86 and qemuppc for musl
64SRC_URI_append_libc-musl_qemux86 = " file://0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch"
65SRC_URI_append_libc-musl_qemuppc = " file://0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch"
66
67PAM_PLUGINS = " \
68 pam-plugin-unix \
69 pam-plugin-loginuid \
70 pam-plugin-keyinit \
71"
72
73PACKAGECONFIG ??= " \
74 ${@bb.utils.filter('DISTRO_FEATURES', 'efi ldconfig pam selinux usrmerge', d)} \
75 ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \
76 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \
77 acl \
78 backlight \
79 binfmt \
80 firstboot \
81 gshadow \
82 hibernate \
83 hostnamed \
84 ima \
85 kmod \
86 localed \
87 logind \
88 machined \
89 myhostname \
90 networkd \
91 nss \
92 polkit \
93 quotacheck \
94 randomseed \
95 resolved \
96 smack \
97 sysusers \
98 timedated \
99 timesyncd \
100 utmp \
101 vconsole \
102 xz \
103"
104
105PACKAGECONFIG_remove_libc-musl = " \
106 gshadow \
107 localed \
108 myhostname \
109 nss \
110 resolved \
111 selinux \
112 smack \
113 sysusers \
114 utmp \
115"
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[coredump] = "-Dcoredump=true,-Dcoredump=false"
128PACKAGECONFIG[cryptsetup] = "-Dlibcryptsetup=true,-Dlibcryptsetup=false,cryptsetup"
129PACKAGECONFIG[dbus] = "-Ddbus=true,-Ddbus=false,dbus"
130PACKAGECONFIG[efi] = "-Defi=true,-Defi=false"
131PACKAGECONFIG[elfutils] = "-Delfutils=true,-Delfutils=false,elfutils"
132PACKAGECONFIG[firstboot] = "-Dfirstboot=true,-Dfirstboot=false"
133# Sign the journal for anti-tampering
134PACKAGECONFIG[gcrypt] = "-Dgcrypt=true,-Dgcrypt=false,libgcrypt"
135PACKAGECONFIG[gshadow] = "-Dgshadow=true,-Dgshadow=false"
136PACKAGECONFIG[hibernate] = "-Dhibernate=true,-Dhibernate=false"
137PACKAGECONFIG[hostnamed] = "-Dhostnamed=true,-Dhostnamed=false"
138PACKAGECONFIG[ima] = "-Dima=true,-Dima=false"
139# importd requires curl/xz/zlib/bzip2/gcrypt
140PACKAGECONFIG[importd] = "-Dimportd=true,-Dimportd=false"
141# Update NAT firewall rules
142PACKAGECONFIG[iptc] = "-Dlibiptc=true,-Dlibiptc=false,iptables"
143PACKAGECONFIG[journal-upload] = "-Dlibcurl=true,-Dlibcurl=false,curl"
144PACKAGECONFIG[kmod] = "-Dkmod=true,-Dkmod=false,kmod"
145PACKAGECONFIG[ldconfig] = "-Dldconfig=true,-Dldconfig=false"
146PACKAGECONFIG[libidn] = "-Dlibidn=true,-Dlibidn=false,libidn"
147PACKAGECONFIG[localed] = "-Dlocaled=true,-Dlocaled=false"
148PACKAGECONFIG[logind] = "-Dlogind=true,-Dlogind=false"
149PACKAGECONFIG[lz4] = "-Dlz4=true,-Dlz4=false,lz4"
150PACKAGECONFIG[machined] = "-Dmachined=true,-Dmachined=false"
151PACKAGECONFIG[manpages] = "-Dman=true,-Dman=false,libxslt-native xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
152PACKAGECONFIG[microhttpd] = "-Dmicrohttpd=true,-Dmicrohttpd=false,libmicrohttpd"
153PACKAGECONFIG[myhostname] = "-Dmyhostname=true,-Dmyhostname=false"
154PACKAGECONFIG[networkd] = "-Dnetworkd=true,-Dnetworkd=false"
155PACKAGECONFIG[nss] = "-Dnss-systemd=true,-Dnss-systemd=false"
156PACKAGECONFIG[pam] = "-Dpam=true,-Dpam=false,libpam,${PAM_PLUGINS}"
157PACKAGECONFIG[polkit] = "-Dpolkit=true,-Dpolkit=false"
158PACKAGECONFIG[portabled] = "-Dportabled=true,-Dportabled=false"
159PACKAGECONFIG[qrencode] = "-Dqrencode=true,-Dqrencode=false,qrencode"
160PACKAGECONFIG[quotacheck] = "-Dquotacheck=true,-Dquotacheck=false"
161PACKAGECONFIG[randomseed] = "-Drandomseed=true,-Drandomseed=false"
162PACKAGECONFIG[resolved] = "-Dresolve=true,-Dresolve=false"
163PACKAGECONFIG[rfkill] = "-Drfkill=true,-Drfkill=false"
164# libseccomp is found in meta-security
165PACKAGECONFIG[seccomp] = "-Dseccomp=true,-Dseccomp=false,libseccomp"
166PACKAGECONFIG[selinux] = "-Dselinux=true,-Dselinux=false,libselinux,initscripts-sushell"
167PACKAGECONFIG[smack] = "-Dsmack=true,-Dsmack=false"
168PACKAGECONFIG[sysusers] = "-Dsysusers=true,-Dsysusers=false"
169PACKAGECONFIG[time-epoch] = "-Dtime-epoch=0,,"
170PACKAGECONFIG[timedated] = "-Dtimedated=true,-Dtimedated=false"
171PACKAGECONFIG[timesyncd] = "-Dtimesyncd=true,-Dtimesyncd=false"
172PACKAGECONFIG[usrmerge] = "-Dsplit-usr=false,-Dsplit-usr=true"
173PACKAGECONFIG[sbinmerge] = "-Dsplit-bin=false,-Dsplit-bin=true"
174PACKAGECONFIG[utmp] = "-Dutmp=true,-Dutmp=false"
175PACKAGECONFIG[valgrind] = "-DVALGRIND=1,,valgrind"
176PACKAGECONFIG[vconsole] = "-Dvconsole=true,-Dvconsole=false,,${PN}-vconsole-setup"
177# Verify keymaps on locale change
178PACKAGECONFIG[xkbcommon] = "-Dxkbcommon=true,-Dxkbcommon=false,libxkbcommon"
179PACKAGECONFIG[xz] = "-Dxz=true,-Dxz=false,xz"
180PACKAGECONFIG[zlib] = "-Dzlib=true,-Dzlib=false,zlib"
181
182# Helper variables to clarify locations. This mirrors the logic in systemd's
183# build system.
184rootprefix ?= "${root_prefix}"
185rootlibdir ?= "${base_libdir}"
186rootlibexecdir = "${rootprefix}/lib"
187
188# This links udev statically with systemd helper library.
189# Otherwise udev package would depend on systemd package (which has the needed shared library),
190# and always pull it into images.
191EXTRA_OEMESON += "-Dlink-udev-shared=false"
192
193EXTRA_OEMESON += "-Dnobody-user=nobody \
194 -Dnobody-group=nobody \
195 -Droothomedir=${ROOT_HOME} \
196 -Drootlibdir=${rootlibdir} \
197 -Drootprefix=${rootprefix} \
198 -Dsysvrcnd-path=${sysconfdir} \
199 "
200
201# Hardcode target binary paths to avoid using paths from sysroot
202EXTRA_OEMESON += "-Dkexec-path=${sbindir}/kexec \
203 -Dkill-path=${base_bindir}/kill \
204 -Dkmod-path=${base_bindir}/kmod \
205 -Dmount-path=${base_bindir}/mount \
206 -Dquotacheck-path=${sbindir}/quotacheck \
207 -Dquotaon-path=${sbindir}/quotaon \
208 -Dsulogin-path=${base_sbindir}/sulogin \
209 -Dumount-path=${base_bindir}/umount"
210
211do_install() {
212 meson_do_install
213 install -d ${D}/${base_sbindir}
214 if ${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', 'false', 'true', d)}; then
215 # Provided by a separate recipe
216 rm ${D}${systemd_unitdir}/system/serial-getty* -f
217 fi
218
219 # Provide support for initramfs
220 [ ! -e ${D}/init ] && ln -s ${rootlibexecdir}/systemd/systemd ${D}/init
221 [ ! -e ${D}/${base_sbindir}/udevd ] && ln -s ${rootlibexecdir}/systemd/systemd-udevd ${D}/${base_sbindir}/udevd
222
223 install -d ${D}${sysconfdir}/udev/rules.d/
224 install -d ${D}${sysconfdir}/tmpfiles.d
225 install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/
226 install -d ${D}${libdir}/pkgconfig
227 install -m 0644 ${B}/src/udev/udev.pc ${D}${libdir}/pkgconfig/
228
229 install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
230
231 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
232 install -d ${D}${sysconfdir}/init.d
233 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd
234 sed -i s%@UDEVD@%${rootlibexecdir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd
235 fi
236
237 chown root:systemd-journal ${D}/${localstatedir}/log/journal
238
239 # Delete journal README, as log can be symlinked inside volatile.
240 rm -f ${D}/${localstatedir}/log/README
241
242 install -d ${D}${systemd_unitdir}/system/graphical.target.wants
243 install -d ${D}${systemd_unitdir}/system/multi-user.target.wants
244 install -d ${D}${systemd_unitdir}/system/poweroff.target.wants
245 install -d ${D}${systemd_unitdir}/system/reboot.target.wants
246 install -d ${D}${systemd_unitdir}/system/rescue.target.wants
247
248 # Create symlinks for systemd-update-utmp-runlevel.service
249 if ${@bb.utils.contains('PACKAGECONFIG', 'utmp', 'true', 'false', d)}; then
250 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/graphical.target.wants/systemd-update-utmp-runlevel.service
251 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/multi-user.target.wants/systemd-update-utmp-runlevel.service
252 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/poweroff.target.wants/systemd-update-utmp-runlevel.service
253 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/reboot.target.wants/systemd-update-utmp-runlevel.service
254 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/rescue.target.wants/systemd-update-utmp-runlevel.service
255 fi
256
257 # this file is needed to exist if networkd is disabled but timesyncd is still in use since timesyncd checks it
258 # for existence else it fails
259 if [ -s ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf ]; then
260 ${@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)}
261 fi
262 if ! ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'true', 'false', d)}; then
263 echo 'L! ${sysconfdir}/resolv.conf - - - - ../run/systemd/resolve/resolv.conf' >>${D}${exec_prefix}/lib/tmpfiles.d/etc.conf
264 echo 'd /run/systemd/resolve 0755 root root -' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
265 echo 'f /run/systemd/resolve/resolv.conf 0644 root root' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
266 ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd
267 else
268 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
269 ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd
270 fi
271 install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${systemd_unitdir}/systemd-sysv-install
272
273 # If polkit is setup fixup permissions and ownership
274 if ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'true', 'false', d)}; then
275 if [ -d ${D}${datadir}/polkit-1/rules.d ]; then
276 chmod 700 ${D}${datadir}/polkit-1/rules.d
277 chown polkitd:root ${D}${datadir}/polkit-1/rules.d
278 fi
279 fi
280
281 # conf files are handled by systemd-conf
282 rm -f ${D}${sysconfdir}/machine-id
283 rm -f ${D}${sysconfdir}/systemd/coredump.conf
284 rm -f ${D}${sysconfdir}/systemd/journald.conf
285 rm -f ${D}${sysconfdir}/systemd/logind.conf
286 rm -f ${D}${sysconfdir}/systemd/system.conf
287 rm -f ${D}${sysconfdir}/systemd/user.conf
288
289 # duplicate udevadm for postinst script
290 install -d ${D}${libexecdir}
291 ln ${D}${base_bindir}/udevadm ${D}${libexecdir}/${MLPREFIX}udevadm
292}
293
294
295python populate_packages_prepend (){
296 systemdlibdir = d.getVar("rootlibdir")
297 do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True)
298}
299PACKAGES_DYNAMIC += "^lib(udev|systemd|nss).*"
300
301PACKAGES =+ "\
302 ${PN}-gui \
303 ${PN}-vconsole-setup \
304 ${PN}-initramfs \
305 ${PN}-analyze \
306 ${PN}-kernel-install \
307 ${PN}-rpm-macros \
308 ${PN}-binfmt \
309 ${PN}-zsh-completion \
310 ${PN}-xorg-xinitrc \
311 ${PN}-container \
312 ${PN}-extra-utils \
313"
314
315SUMMARY_${PN}-container = "Tools for containers and VMs"
316DESCRIPTION_${PN}-container = "Systemd tools to spawn and manage containers and virtual machines."
317
318SYSTEMD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'binfmt', '${PN}-binfmt', '', d)}"
319SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service"
320
321USERADD_PACKAGES = "${PN} ${PN}-extra-utils"
322USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '--system -d / -M --shell /bin/nologin systemd-journal-gateway;', '', d)}"
323USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '--system -d / -M --shell /bin/nologin systemd-journal-remote;', '', d)}"
324USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '--system -d / -M --shell /bin/nologin systemd-journal-upload;', '', d)}"
325USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'timesyncd', '--system -d / -M --shell /bin/nologin systemd-timesync;', '', d)}"
326USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'networkd', '--system -d / -M --shell /bin/nologin systemd-network;', '', d)}"
327USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'coredump', '--system -d / -M --shell /bin/nologin systemd-coredump;', '', d)}"
328USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'resolved', '--system -d / -M --shell /bin/nologin systemd-resolve;', '', d)}"
329USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'polkit', '--system --no-create-home --user-group --home-dir ${sysconfdir}/polkit-1 polkitd;', '', d)}"
330GROUPADD_PARAM_${PN} = "-r systemd-journal"
331USERADD_PARAM_${PN}-extra-utils += "--system -d / -M --shell /bin/nologin systemd-bus-proxy;"
332
333FILES_${PN}-analyze = "${bindir}/systemd-analyze"
334
335FILES_${PN}-initramfs = "/init"
336RDEPENDS_${PN}-initramfs = "${PN}"
337
338FILES_${PN}-gui = "${bindir}/systemadm"
339
340FILES_${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \
341 ${systemd_unitdir}/system/systemd-vconsole-setup.service \
342 ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service"
343
344RDEPENDS_${PN}-kernel-install += "bash"
345FILES_${PN}-kernel-install = "${bindir}/kernel-install \
346 ${sysconfdir}/kernel/ \
347 ${exec_prefix}/lib/kernel \
348 "
349FILES_${PN}-rpm-macros = "${exec_prefix}/lib/rpm \
350 "
351
352FILES_${PN}-xorg-xinitrc = "${sysconfdir}/X11/xinit/xinitrc.d/*"
353
354FILES_${PN}-zsh-completion = "${datadir}/zsh/site-functions"
355
356FILES_${PN}-binfmt = "${sysconfdir}/binfmt.d/ \
357 ${exec_prefix}/lib/binfmt.d \
358 ${rootlibexecdir}/systemd/systemd-binfmt \
359 ${systemd_unitdir}/system/proc-sys-fs-binfmt_misc.* \
360 ${systemd_unitdir}/system/systemd-binfmt.service"
361RRECOMMENDS_${PN}-binfmt = "kernel-module-binfmt-misc"
362
363RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts kbd-keymaps"
364
365FILES_${PN}-container = "${sysconfdir}/dbus-1/system.d/org.freedesktop.import1.conf \
366 ${sysconfdir}/dbus-1/system.d/org.freedesktop.machine1.conf \
367 ${base_bindir}/machinectl \
368 ${bindir}/systemd-nspawn \
369 ${nonarch_libdir}/systemd/import-pubring.gpg \
370 ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.import1.busname \
371 ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.machine1.busname \
372 ${systemd_system_unitdir}/local-fs.target.wants/var-lib-machines.mount \
373 ${systemd_system_unitdir}/machine.slice \
374 ${systemd_system_unitdir}/machines.target \
375 ${systemd_system_unitdir}/org.freedesktop.import1.busname \
376 ${systemd_system_unitdir}/org.freedesktop.machine1.busname \
377 ${systemd_system_unitdir}/systemd-importd.service \
378 ${systemd_system_unitdir}/systemd-machined.service \
379 ${systemd_system_unitdir}/dbus-org.freedesktop.machine1.service \
380 ${systemd_system_unitdir}/var-lib-machines.mount \
381 ${rootlibexecdir}/systemd/systemd-import \
382 ${rootlibexecdir}/systemd/systemd-importd \
383 ${rootlibexecdir}/systemd/systemd-journal-gatewayd \
384 ${rootlibexecdir}/systemd/systemd-journal-remote \
385 ${rootlibexecdir}/systemd/systemd-journal-upload \
386 ${rootlibexecdir}/systemd/systemd-machined \
387 ${rootlibexecdir}/systemd/systemd-pull \
388 ${exec_prefix}/lib/tmpfiles.d/systemd-nspawn.conf \
389 ${systemd_system_unitdir}/systemd-nspawn@.service \
390 ${libdir}/libnss_mymachines.so.2 \
391 ${datadir}/dbus-1/system-services/org.freedesktop.import1.service \
392 ${datadir}/dbus-1/system-services/org.freedesktop.machine1.service \
393 ${datadir}/dbus-1/system.d/org.freedesktop.import1.conf \
394 ${datadir}/dbus-1/system.d/org.freedesktop.machine1.conf \
395 ${datadir}/polkit-1/actions/org.freedesktop.import1.policy \
396 ${datadir}/polkit-1/actions/org.freedesktop.machine1.policy \
397 "
398
399FILES_${PN}-extra-utils = "\
400 ${base_bindir}/systemd-escape \
401 ${base_bindir}/systemd-inhibit \
402 ${bindir}/systemd-detect-virt \
403 ${bindir}/systemd-path \
404 ${bindir}/systemd-run \
405 ${bindir}/systemd-cat \
406 ${bindir}/systemd-delta \
407 ${bindir}/systemd-cgls \
408 ${bindir}/systemd-cgtop \
409 ${bindir}/systemd-stdio-bridge \
410 ${base_bindir}/systemd-ask-password \
411 ${base_bindir}/systemd-tty-ask-password-agent \
412 ${systemd_unitdir}/system/systemd-ask-password-console.path \
413 ${systemd_unitdir}/system/systemd-ask-password-console.service \
414 ${systemd_unitdir}/system/systemd-ask-password-wall.path \
415 ${systemd_unitdir}/system/systemd-ask-password-wall.service \
416 ${systemd_unitdir}/system/sysinit.target.wants/systemd-ask-password-console.path \
417 ${systemd_unitdir}/system/sysinit.target.wants/systemd-ask-password-wall.path \
418 ${systemd_unitdir}/system/multi-user.target.wants/systemd-ask-password-wall.path \
419 ${rootlibexecdir}/systemd/systemd-resolve-host \
420 ${rootlibexecdir}/systemd/systemd-ac-power \
421 ${rootlibexecdir}/systemd/systemd-activate \
422 ${rootlibexecdir}/systemd/systemd-bus-proxyd \
423 ${systemd_unitdir}/system/systemd-bus-proxyd.service \
424 ${systemd_unitdir}/system/systemd-bus-proxyd.socket \
425 ${rootlibexecdir}/systemd/systemd-socket-proxyd \
426 ${rootlibexecdir}/systemd/systemd-reply-password \
427 ${rootlibexecdir}/systemd/systemd-sleep \
428 ${rootlibexecdir}/systemd/system-sleep \
429 ${systemd_unitdir}/system/systemd-hibernate.service \
430 ${systemd_unitdir}/system/systemd-hybrid-sleep.service \
431 ${systemd_unitdir}/system/systemd-suspend.service \
432 ${systemd_unitdir}/system/sleep.target \
433 ${rootlibexecdir}/systemd/systemd-initctl \
434 ${systemd_unitdir}/system/systemd-initctl.service \
435 ${systemd_unitdir}/system/systemd-initctl.socket \
436 ${systemd_unitdir}/system/sockets.target.wants/systemd-initctl.socket \
437 ${rootlibexecdir}/systemd/system-generators/systemd-gpt-auto-generator \
438 ${rootlibexecdir}/systemd/systemd-cgroups-agent \
439"
440
441FILES_${PN} = " ${base_bindir}/* \
442 ${base_sbindir}/shutdown \
443 ${base_sbindir}/halt \
444 ${base_sbindir}/poweroff \
445 ${base_sbindir}/runlevel \
446 ${base_sbindir}/telinit \
447 ${base_sbindir}/resolvconf \
448 ${base_sbindir}/reboot \
449 ${base_sbindir}/init \
450 ${datadir}/dbus-1/services \
451 ${datadir}/dbus-1/system-services \
452 ${datadir}/polkit-1 \
453 ${datadir}/${BPN} \
454 ${datadir}/factory \
455 ${sysconfdir}/dbus-1/ \
456 ${sysconfdir}/modules-load.d/ \
457 ${sysconfdir}/pam.d/ \
458 ${sysconfdir}/sysctl.d/ \
459 ${sysconfdir}/systemd/ \
460 ${sysconfdir}/tmpfiles.d/ \
461 ${sysconfdir}/xdg/ \
462 ${sysconfdir}/init.d/README \
463 ${sysconfdir}/resolv-conf.systemd \
464 ${rootlibexecdir}/systemd/* \
465 ${systemd_unitdir}/* \
466 ${base_libdir}/security/*.so \
467 /cgroup \
468 ${bindir}/systemd* \
469 ${bindir}/busctl \
470 ${bindir}/coredumpctl \
471 ${bindir}/localectl \
472 ${bindir}/hostnamectl \
473 ${bindir}/resolvectl \
474 ${bindir}/timedatectl \
475 ${bindir}/bootctl \
476 ${bindir}/kernel-install \
477 ${exec_prefix}/lib/tmpfiles.d/*.conf \
478 ${exec_prefix}/lib/systemd \
479 ${exec_prefix}/lib/modules-load.d \
480 ${exec_prefix}/lib/sysctl.d \
481 ${exec_prefix}/lib/sysusers.d \
482 ${exec_prefix}/lib/environment.d \
483 ${localstatedir} \
484 ${nonarch_base_libdir}/udev/rules.d/70-uaccess.rules \
485 ${nonarch_base_libdir}/udev/rules.d/71-seat.rules \
486 ${nonarch_base_libdir}/udev/rules.d/73-seat-late.rules \
487 ${nonarch_base_libdir}/udev/rules.d/99-systemd.rules \
488 ${nonarch_base_libdir}/modprobe.d/systemd.conf \
489 ${datadir}/dbus-1/system.d/org.freedesktop.timedate1.conf \
490 ${datadir}/dbus-1/system.d/org.freedesktop.locale1.conf \
491 ${datadir}/dbus-1/system.d/org.freedesktop.network1.conf \
492 ${datadir}/dbus-1/system.d/org.freedesktop.resolve1.conf \
493 ${datadir}/dbus-1/system.d/org.freedesktop.systemd1.conf \
494 ${datadir}/dbus-1/system.d/org.freedesktop.hostname1.conf \
495 ${datadir}/dbus-1/system.d/org.freedesktop.login1.conf \
496 ${datadir}/dbus-1/system.d/org.freedesktop.timesync1.conf \
497 ${datadir}/dbus-1/system.d/org.freedesktop.portable1.conf \
498 "
499
500FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
501
502RDEPENDS_${PN} += "kmod dbus util-linux-mount udev (= ${EXTENDPKGV}) util-linux-agetty util-linux-fsck"
503RDEPENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', '', 'systemd-serialgetty', d)}"
504RDEPENDS_${PN} += "volatile-binds update-rc.d systemd-conf"
505
506RRECOMMENDS_${PN} += "systemd-extra-utils \
507 systemd-compat-units udev-hwdb \
508 e2fsprogs-e2fsck \
509 kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \
510 os-release \
511"
512
513INSANE_SKIP_${PN} += "dev-so libdir"
514INSANE_SKIP_${PN}-dbg += "libdir"
515INSANE_SKIP_${PN}-doc += " libdir"
516
517PACKAGES =+ "udev udev-hwdb"
518
519RPROVIDES_udev = "hotplug"
520
521RDEPENDS_udev-hwdb += "udev"
522
523FILES_udev += "${base_sbindir}/udevd \
524 ${rootlibexecdir}/systemd/systemd-udevd \
525 ${rootlibexecdir}/udev/accelerometer \
526 ${rootlibexecdir}/udev/ata_id \
527 ${rootlibexecdir}/udev/cdrom_id \
528 ${rootlibexecdir}/udev/collect \
529 ${rootlibexecdir}/udev/findkeyboards \
530 ${rootlibexecdir}/udev/keyboard-force-release.sh \
531 ${rootlibexecdir}/udev/keymap \
532 ${rootlibexecdir}/udev/mtd_probe \
533 ${rootlibexecdir}/udev/scsi_id \
534 ${rootlibexecdir}/udev/v4l_id \
535 ${rootlibexecdir}/udev/keymaps \
536 ${rootlibexecdir}/udev/rules.d/*.rules \
537 ${sysconfdir}/udev \
538 ${sysconfdir}/init.d/systemd-udevd \
539 ${systemd_unitdir}/system/*udev* \
540 ${systemd_unitdir}/system/*.wants/*udev* \
541 ${base_bindir}/udevadm \
542 ${libexecdir}/${MLPREFIX}udevadm \
543 ${datadir}/bash-completion/completions/udevadm \
544 "
545
546FILES_udev-hwdb = "${rootlibexecdir}/udev/hwdb.d"
547
548INITSCRIPT_PACKAGES = "udev"
549INITSCRIPT_NAME_udev = "systemd-udevd"
550INITSCRIPT_PARAMS_udev = "start 03 S ."
551
552python __anonymous() {
553 if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
554 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
555}
556
557ALTERNATIVE_${PN} = "halt reboot shutdown poweroff runlevel resolv-conf"
558
559ALTERNATIVE_TARGET[resolv-conf] = "${sysconfdir}/resolv-conf.systemd"
560ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/resolv.conf"
561ALTERNATIVE_PRIORITY[resolv-conf] ?= "50"
562
563ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl"
564ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt"
565ALTERNATIVE_PRIORITY[halt] ?= "300"
566
567ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl"
568ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
569ALTERNATIVE_PRIORITY[reboot] ?= "300"
570
571ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl"
572ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown"
573ALTERNATIVE_PRIORITY[shutdown] ?= "300"
574
575ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl"
576ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
577ALTERNATIVE_PRIORITY[poweroff] ?= "300"
578
579ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"
580ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
581ALTERNATIVE_PRIORITY[runlevel] ?= "300"
582
583pkg_postinst_${PN} () {
584 sed -e '/^hosts:/s/\s*\<myhostname\>//' \
585 -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \
586 -i $D${sysconfdir}/nsswitch.conf
587}
588
589pkg_prerm_${PN} () {
590 sed -e '/^hosts:/s/\s*\<myhostname\>//' \
591 -e '/^hosts:/s/\s*myhostname//' \
592 -i $D${sysconfdir}/nsswitch.conf
593}
594
595PACKAGE_WRITE_DEPS += "qemu-native"
596pkg_postinst_udev-hwdb () {
597 if test -n "$D"; then
598 $INTERCEPT_DIR/postinst_intercept update_udev_hwdb ${PKG} mlprefix=${MLPREFIX} binprefix=${MLPREFIX}
599 else
600 udevadm hwdb --update
601 fi
602}
603
604pkg_prerm_udev-hwdb () {
605 rm -f $D${sysconfdir}/udev/hwdb.bin
606}