blob: ed10f634b9a10cbbd03ceae313e8cf417f65dcfc [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
Brad Bishopa5c52ff2018-11-23 10:55:50 +1300242 # journal-remote creates this at start
243 rm -rf ${D}/${localstatedir}/log/journal/remote
244
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800245 install -d ${D}${systemd_unitdir}/system/graphical.target.wants
246 install -d ${D}${systemd_unitdir}/system/multi-user.target.wants
247 install -d ${D}${systemd_unitdir}/system/poweroff.target.wants
248 install -d ${D}${systemd_unitdir}/system/reboot.target.wants
249 install -d ${D}${systemd_unitdir}/system/rescue.target.wants
250
251 # Create symlinks for systemd-update-utmp-runlevel.service
252 if ${@bb.utils.contains('PACKAGECONFIG', 'utmp', 'true', 'false', d)}; then
253 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/graphical.target.wants/systemd-update-utmp-runlevel.service
254 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/multi-user.target.wants/systemd-update-utmp-runlevel.service
255 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/poweroff.target.wants/systemd-update-utmp-runlevel.service
256 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/reboot.target.wants/systemd-update-utmp-runlevel.service
257 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/rescue.target.wants/systemd-update-utmp-runlevel.service
258 fi
259
260 # this file is needed to exist if networkd is disabled but timesyncd is still in use since timesyncd checks it
261 # for existence else it fails
262 if [ -s ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf ]; then
263 ${@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)}
264 fi
265 if ! ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'true', 'false', d)}; then
266 echo 'L! ${sysconfdir}/resolv.conf - - - - ../run/systemd/resolve/resolv.conf' >>${D}${exec_prefix}/lib/tmpfiles.d/etc.conf
267 echo 'd /run/systemd/resolve 0755 root root -' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
268 echo 'f /run/systemd/resolve/resolv.conf 0644 root root' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
269 ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd
270 else
271 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
272 ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd
273 fi
274 install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${systemd_unitdir}/systemd-sysv-install
275
276 # If polkit is setup fixup permissions and ownership
277 if ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'true', 'false', d)}; then
278 if [ -d ${D}${datadir}/polkit-1/rules.d ]; then
279 chmod 700 ${D}${datadir}/polkit-1/rules.d
280 chown polkitd:root ${D}${datadir}/polkit-1/rules.d
281 fi
282 fi
283
284 # conf files are handled by systemd-conf
285 rm -f ${D}${sysconfdir}/machine-id
286 rm -f ${D}${sysconfdir}/systemd/coredump.conf
287 rm -f ${D}${sysconfdir}/systemd/journald.conf
288 rm -f ${D}${sysconfdir}/systemd/logind.conf
289 rm -f ${D}${sysconfdir}/systemd/system.conf
290 rm -f ${D}${sysconfdir}/systemd/user.conf
291
292 # duplicate udevadm for postinst script
293 install -d ${D}${libexecdir}
294 ln ${D}${base_bindir}/udevadm ${D}${libexecdir}/${MLPREFIX}udevadm
295}
296
297
298python populate_packages_prepend (){
299 systemdlibdir = d.getVar("rootlibdir")
300 do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True)
301}
302PACKAGES_DYNAMIC += "^lib(udev|systemd|nss).*"
303
304PACKAGES =+ "\
305 ${PN}-gui \
306 ${PN}-vconsole-setup \
307 ${PN}-initramfs \
308 ${PN}-analyze \
309 ${PN}-kernel-install \
310 ${PN}-rpm-macros \
311 ${PN}-binfmt \
312 ${PN}-zsh-completion \
313 ${PN}-xorg-xinitrc \
314 ${PN}-container \
Brad Bishopa5c52ff2018-11-23 10:55:50 +1300315 ${PN}-journal-gatewayd \
316 ${PN}-journal-upload \
317 ${PN}-journal-remote \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800318 ${PN}-extra-utils \
319"
320
321SUMMARY_${PN}-container = "Tools for containers and VMs"
322DESCRIPTION_${PN}-container = "Systemd tools to spawn and manage containers and virtual machines."
323
Brad Bishopa5c52ff2018-11-23 10:55:50 +1300324SUMMARY_${PN}-journal-gatewayd = "HTTP server for journal events"
325DESCRIPTION_${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."
326
327SUMMARY_${PN}-journal-upload = "Send journal messages over the network"
328DESCRIPTION_${PN}-journal-upload = "systemd-journal-upload uploads journal entries to a specified URL."
329
330SUMMARY_${PN}-journal-remote = "Receive journal messages over the network"
331DESCRIPTION_${PN}-journal-remote = "systemd-journal-remote is a command to receive serialized journal events and store them to journal files."
332
333SYSTEMD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'binfmt', '${PN}-binfmt', '', d)} \
334 ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-gatewayd', '', d)} \
335 ${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '${PN}-journal-upload', '', d)} \
336 ${@bb.utils.contains('PACKAGECONFIG', '', '${PN}-journal-remote', '', d)} \
337"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800338SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service"
339
Brad Bishopa5c52ff2018-11-23 10:55:50 +1300340USERADD_PACKAGES = "${PN} ${PN}-extra-utils ${PN}-journal-gateway ${PN}-journal-upload ${PN}-journal-remote"
341USERADD_PARAM_${PN}-journal-gateway += "${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '--system -d / -M --shell /bin/nologin systemd-journal-gateway;', '', d)}"
342USERADD_PARAM_${PN}-journal-remote += "${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '--system -d / -M --shell /bin/nologin systemd-journal-remote;', '', d)}"
343USERADD_PARAM_${PN}-journal-upload += "${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '--system -d / -M --shell /bin/nologin systemd-journal-upload;', '', d)}"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800344USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'timesyncd', '--system -d / -M --shell /bin/nologin systemd-timesync;', '', d)}"
345USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'networkd', '--system -d / -M --shell /bin/nologin systemd-network;', '', d)}"
346USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'coredump', '--system -d / -M --shell /bin/nologin systemd-coredump;', '', d)}"
347USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'resolved', '--system -d / -M --shell /bin/nologin systemd-resolve;', '', d)}"
348USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'polkit', '--system --no-create-home --user-group --home-dir ${sysconfdir}/polkit-1 polkitd;', '', d)}"
349GROUPADD_PARAM_${PN} = "-r systemd-journal"
350USERADD_PARAM_${PN}-extra-utils += "--system -d / -M --shell /bin/nologin systemd-bus-proxy;"
351
352FILES_${PN}-analyze = "${bindir}/systemd-analyze"
353
354FILES_${PN}-initramfs = "/init"
355RDEPENDS_${PN}-initramfs = "${PN}"
356
357FILES_${PN}-gui = "${bindir}/systemadm"
358
359FILES_${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \
360 ${systemd_unitdir}/system/systemd-vconsole-setup.service \
361 ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service"
362
363RDEPENDS_${PN}-kernel-install += "bash"
364FILES_${PN}-kernel-install = "${bindir}/kernel-install \
365 ${sysconfdir}/kernel/ \
366 ${exec_prefix}/lib/kernel \
367 "
368FILES_${PN}-rpm-macros = "${exec_prefix}/lib/rpm \
369 "
370
371FILES_${PN}-xorg-xinitrc = "${sysconfdir}/X11/xinit/xinitrc.d/*"
372
373FILES_${PN}-zsh-completion = "${datadir}/zsh/site-functions"
374
375FILES_${PN}-binfmt = "${sysconfdir}/binfmt.d/ \
376 ${exec_prefix}/lib/binfmt.d \
377 ${rootlibexecdir}/systemd/systemd-binfmt \
378 ${systemd_unitdir}/system/proc-sys-fs-binfmt_misc.* \
379 ${systemd_unitdir}/system/systemd-binfmt.service"
380RRECOMMENDS_${PN}-binfmt = "kernel-module-binfmt-misc"
381
382RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts kbd-keymaps"
383
Brad Bishopa5c52ff2018-11-23 10:55:50 +1300384
385FILES_${PN}-journal-gatewayd = "${rootlibexecdir}/systemd/systemd-journal-gatewayd \
386 ${systemd_system_unitdir}/systemd-journal-gatewayd.service \
387 ${systemd_system_unitdir}/systemd-journal-gatewayd.socket \
388 ${systemd_system_unitdir}/sockets.target.wants/systemd-journal-gatewayd.socket \
389 ${datadir}/systemd/gatewayd/browse.html \
390 "
391SYSTEMD_SERVICE_${PN}-journal-gatewayd = "systemd-journal-gatewayd.socket"
392
393FILES_${PN}-journal-upload = "${rootlibexecdir}/systemd/systemd-journal-upload \
394 ${systemd_system_unitdir}/systemd-journal-upload.service \
395 ${sysconfdir}/systemd/journal-upload.conf \
396 "
397SYSTEMD_SERVICE_${PN}-journal-upload = "systemd-journal-upload.service"
398
399FILES_${PN}-journal-remote = "${rootlibexecdir}/systemd/systemd-journal-remote \
400 ${sysconfdir}/systemd/journal-remote.conf \
401 ${systemd_system_unitdir}/systemd-journal-remote.service \
402 ${systemd_system_unitdir}/systemd-journal-remote.socket \
403 "
404SYSTEMD_SERVICE_${PN}-remote = "systemd-journal-remote.socket"
405
406
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800407FILES_${PN}-container = "${sysconfdir}/dbus-1/system.d/org.freedesktop.import1.conf \
408 ${sysconfdir}/dbus-1/system.d/org.freedesktop.machine1.conf \
409 ${base_bindir}/machinectl \
410 ${bindir}/systemd-nspawn \
411 ${nonarch_libdir}/systemd/import-pubring.gpg \
412 ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.import1.busname \
413 ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.machine1.busname \
414 ${systemd_system_unitdir}/local-fs.target.wants/var-lib-machines.mount \
415 ${systemd_system_unitdir}/machine.slice \
416 ${systemd_system_unitdir}/machines.target \
417 ${systemd_system_unitdir}/org.freedesktop.import1.busname \
418 ${systemd_system_unitdir}/org.freedesktop.machine1.busname \
419 ${systemd_system_unitdir}/systemd-importd.service \
420 ${systemd_system_unitdir}/systemd-machined.service \
421 ${systemd_system_unitdir}/dbus-org.freedesktop.machine1.service \
422 ${systemd_system_unitdir}/var-lib-machines.mount \
423 ${rootlibexecdir}/systemd/systemd-import \
424 ${rootlibexecdir}/systemd/systemd-importd \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800425 ${rootlibexecdir}/systemd/systemd-machined \
426 ${rootlibexecdir}/systemd/systemd-pull \
427 ${exec_prefix}/lib/tmpfiles.d/systemd-nspawn.conf \
428 ${systemd_system_unitdir}/systemd-nspawn@.service \
429 ${libdir}/libnss_mymachines.so.2 \
430 ${datadir}/dbus-1/system-services/org.freedesktop.import1.service \
431 ${datadir}/dbus-1/system-services/org.freedesktop.machine1.service \
432 ${datadir}/dbus-1/system.d/org.freedesktop.import1.conf \
433 ${datadir}/dbus-1/system.d/org.freedesktop.machine1.conf \
434 ${datadir}/polkit-1/actions/org.freedesktop.import1.policy \
435 ${datadir}/polkit-1/actions/org.freedesktop.machine1.policy \
436 "
437
Brad Bishopa5c52ff2018-11-23 10:55:50 +1300438RRECOMMENDS_${PN}-container += "\
439 ${PN}-journal-upload \
440 ${PN}-journal-remote \
441 ${PN}-journal-gatewayd \
442 "
443
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800444FILES_${PN}-extra-utils = "\
445 ${base_bindir}/systemd-escape \
446 ${base_bindir}/systemd-inhibit \
447 ${bindir}/systemd-detect-virt \
448 ${bindir}/systemd-path \
449 ${bindir}/systemd-run \
450 ${bindir}/systemd-cat \
451 ${bindir}/systemd-delta \
452 ${bindir}/systemd-cgls \
453 ${bindir}/systemd-cgtop \
454 ${bindir}/systemd-stdio-bridge \
455 ${base_bindir}/systemd-ask-password \
456 ${base_bindir}/systemd-tty-ask-password-agent \
457 ${systemd_unitdir}/system/systemd-ask-password-console.path \
458 ${systemd_unitdir}/system/systemd-ask-password-console.service \
459 ${systemd_unitdir}/system/systemd-ask-password-wall.path \
460 ${systemd_unitdir}/system/systemd-ask-password-wall.service \
461 ${systemd_unitdir}/system/sysinit.target.wants/systemd-ask-password-console.path \
462 ${systemd_unitdir}/system/sysinit.target.wants/systemd-ask-password-wall.path \
463 ${systemd_unitdir}/system/multi-user.target.wants/systemd-ask-password-wall.path \
464 ${rootlibexecdir}/systemd/systemd-resolve-host \
465 ${rootlibexecdir}/systemd/systemd-ac-power \
466 ${rootlibexecdir}/systemd/systemd-activate \
467 ${rootlibexecdir}/systemd/systemd-bus-proxyd \
468 ${systemd_unitdir}/system/systemd-bus-proxyd.service \
469 ${systemd_unitdir}/system/systemd-bus-proxyd.socket \
470 ${rootlibexecdir}/systemd/systemd-socket-proxyd \
471 ${rootlibexecdir}/systemd/systemd-reply-password \
472 ${rootlibexecdir}/systemd/systemd-sleep \
473 ${rootlibexecdir}/systemd/system-sleep \
474 ${systemd_unitdir}/system/systemd-hibernate.service \
475 ${systemd_unitdir}/system/systemd-hybrid-sleep.service \
476 ${systemd_unitdir}/system/systemd-suspend.service \
477 ${systemd_unitdir}/system/sleep.target \
478 ${rootlibexecdir}/systemd/systemd-initctl \
479 ${systemd_unitdir}/system/systemd-initctl.service \
480 ${systemd_unitdir}/system/systemd-initctl.socket \
481 ${systemd_unitdir}/system/sockets.target.wants/systemd-initctl.socket \
482 ${rootlibexecdir}/systemd/system-generators/systemd-gpt-auto-generator \
483 ${rootlibexecdir}/systemd/systemd-cgroups-agent \
484"
485
486FILES_${PN} = " ${base_bindir}/* \
487 ${base_sbindir}/shutdown \
488 ${base_sbindir}/halt \
489 ${base_sbindir}/poweroff \
490 ${base_sbindir}/runlevel \
491 ${base_sbindir}/telinit \
492 ${base_sbindir}/resolvconf \
493 ${base_sbindir}/reboot \
494 ${base_sbindir}/init \
495 ${datadir}/dbus-1/services \
496 ${datadir}/dbus-1/system-services \
497 ${datadir}/polkit-1 \
498 ${datadir}/${BPN} \
499 ${datadir}/factory \
500 ${sysconfdir}/dbus-1/ \
501 ${sysconfdir}/modules-load.d/ \
502 ${sysconfdir}/pam.d/ \
503 ${sysconfdir}/sysctl.d/ \
504 ${sysconfdir}/systemd/ \
505 ${sysconfdir}/tmpfiles.d/ \
506 ${sysconfdir}/xdg/ \
507 ${sysconfdir}/init.d/README \
508 ${sysconfdir}/resolv-conf.systemd \
509 ${rootlibexecdir}/systemd/* \
510 ${systemd_unitdir}/* \
511 ${base_libdir}/security/*.so \
512 /cgroup \
513 ${bindir}/systemd* \
514 ${bindir}/busctl \
515 ${bindir}/coredumpctl \
516 ${bindir}/localectl \
517 ${bindir}/hostnamectl \
518 ${bindir}/resolvectl \
519 ${bindir}/timedatectl \
520 ${bindir}/bootctl \
521 ${bindir}/kernel-install \
522 ${exec_prefix}/lib/tmpfiles.d/*.conf \
523 ${exec_prefix}/lib/systemd \
524 ${exec_prefix}/lib/modules-load.d \
525 ${exec_prefix}/lib/sysctl.d \
526 ${exec_prefix}/lib/sysusers.d \
527 ${exec_prefix}/lib/environment.d \
528 ${localstatedir} \
529 ${nonarch_base_libdir}/udev/rules.d/70-uaccess.rules \
530 ${nonarch_base_libdir}/udev/rules.d/71-seat.rules \
531 ${nonarch_base_libdir}/udev/rules.d/73-seat-late.rules \
532 ${nonarch_base_libdir}/udev/rules.d/99-systemd.rules \
533 ${nonarch_base_libdir}/modprobe.d/systemd.conf \
534 ${datadir}/dbus-1/system.d/org.freedesktop.timedate1.conf \
535 ${datadir}/dbus-1/system.d/org.freedesktop.locale1.conf \
536 ${datadir}/dbus-1/system.d/org.freedesktop.network1.conf \
537 ${datadir}/dbus-1/system.d/org.freedesktop.resolve1.conf \
538 ${datadir}/dbus-1/system.d/org.freedesktop.systemd1.conf \
539 ${datadir}/dbus-1/system.d/org.freedesktop.hostname1.conf \
540 ${datadir}/dbus-1/system.d/org.freedesktop.login1.conf \
541 ${datadir}/dbus-1/system.d/org.freedesktop.timesync1.conf \
542 ${datadir}/dbus-1/system.d/org.freedesktop.portable1.conf \
543 "
544
545FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
546
547RDEPENDS_${PN} += "kmod dbus util-linux-mount udev (= ${EXTENDPKGV}) util-linux-agetty util-linux-fsck"
548RDEPENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', '', 'systemd-serialgetty', d)}"
549RDEPENDS_${PN} += "volatile-binds update-rc.d systemd-conf"
550
551RRECOMMENDS_${PN} += "systemd-extra-utils \
552 systemd-compat-units udev-hwdb \
553 e2fsprogs-e2fsck \
554 kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \
555 os-release \
556"
557
558INSANE_SKIP_${PN} += "dev-so libdir"
559INSANE_SKIP_${PN}-dbg += "libdir"
560INSANE_SKIP_${PN}-doc += " libdir"
561
562PACKAGES =+ "udev udev-hwdb"
563
564RPROVIDES_udev = "hotplug"
565
566RDEPENDS_udev-hwdb += "udev"
567
568FILES_udev += "${base_sbindir}/udevd \
569 ${rootlibexecdir}/systemd/systemd-udevd \
570 ${rootlibexecdir}/udev/accelerometer \
571 ${rootlibexecdir}/udev/ata_id \
572 ${rootlibexecdir}/udev/cdrom_id \
573 ${rootlibexecdir}/udev/collect \
574 ${rootlibexecdir}/udev/findkeyboards \
575 ${rootlibexecdir}/udev/keyboard-force-release.sh \
576 ${rootlibexecdir}/udev/keymap \
577 ${rootlibexecdir}/udev/mtd_probe \
578 ${rootlibexecdir}/udev/scsi_id \
579 ${rootlibexecdir}/udev/v4l_id \
580 ${rootlibexecdir}/udev/keymaps \
581 ${rootlibexecdir}/udev/rules.d/*.rules \
582 ${sysconfdir}/udev \
583 ${sysconfdir}/init.d/systemd-udevd \
584 ${systemd_unitdir}/system/*udev* \
585 ${systemd_unitdir}/system/*.wants/*udev* \
586 ${base_bindir}/udevadm \
587 ${libexecdir}/${MLPREFIX}udevadm \
588 ${datadir}/bash-completion/completions/udevadm \
589 "
590
591FILES_udev-hwdb = "${rootlibexecdir}/udev/hwdb.d"
592
593INITSCRIPT_PACKAGES = "udev"
594INITSCRIPT_NAME_udev = "systemd-udevd"
595INITSCRIPT_PARAMS_udev = "start 03 S ."
596
597python __anonymous() {
598 if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
599 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
600}
601
602ALTERNATIVE_${PN} = "halt reboot shutdown poweroff runlevel resolv-conf"
603
604ALTERNATIVE_TARGET[resolv-conf] = "${sysconfdir}/resolv-conf.systemd"
605ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/resolv.conf"
606ALTERNATIVE_PRIORITY[resolv-conf] ?= "50"
607
608ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl"
609ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt"
610ALTERNATIVE_PRIORITY[halt] ?= "300"
611
612ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl"
613ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
614ALTERNATIVE_PRIORITY[reboot] ?= "300"
615
616ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl"
617ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown"
618ALTERNATIVE_PRIORITY[shutdown] ?= "300"
619
620ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl"
621ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
622ALTERNATIVE_PRIORITY[poweroff] ?= "300"
623
624ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"
625ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
626ALTERNATIVE_PRIORITY[runlevel] ?= "300"
627
628pkg_postinst_${PN} () {
629 sed -e '/^hosts:/s/\s*\<myhostname\>//' \
630 -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \
631 -i $D${sysconfdir}/nsswitch.conf
632}
633
634pkg_prerm_${PN} () {
635 sed -e '/^hosts:/s/\s*\<myhostname\>//' \
636 -e '/^hosts:/s/\s*myhostname//' \
637 -i $D${sysconfdir}/nsswitch.conf
638}
639
640PACKAGE_WRITE_DEPS += "qemu-native"
641pkg_postinst_udev-hwdb () {
642 if test -n "$D"; then
643 $INTERCEPT_DIR/postinst_intercept update_udev_hwdb ${PKG} mlprefix=${MLPREFIX} binprefix=${MLPREFIX}
644 else
645 udevadm hwdb --update
646 fi
647}
648
649pkg_prerm_udev-hwdb () {
650 rm -f $D${sysconfdir}/udev/hwdb.bin
651}