blob: b368ca8a2c4a2735d4ac22af935ea016926df857 [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001require 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-rules-watch-metadata-changes-in-ide-devices.patch \
25 file://0006-network-remove-redunant-link-name-in-message.patch \
26 file://99-default.preset \
Brad Bishop15ae2502019-06-18 21:44:24 -040027 file://0001-resolved-Fix-incorrect-use-of-OpenSSL-BUF_MEM.patch \
Brad Bishop96ff1982019-08-19 13:50:42 -040028 file://0001-core-set-fs.file-max-sysctl-to-LONG_MAX-rather-than-.patch \
29 file://0001-networkd-fix-link-up.patch \
30 file://0002-network-do-not-send-ipv6.patch \
Brad Bishopc342db32019-05-15 21:57:59 -040031 "
32
33# patches needed by musl
Brad Bishop15ae2502019-06-18 21:44:24 -040034SRC_URI_append_libc-musl = " ${SRC_URI_MUSL}"
Brad Bishopc68388fc2019-08-26 01:33:31 -040035SRC_URI_MUSL = "\
Brad Bishopc342db32019-05-15 21:57:59 -040036 file://0002-don-t-use-glibc-specific-qsort_r.patch \
37 file://0003-missing_type.h-add-__compare_fn_t-and-comparison_fn_.patch \
38 file://0004-add-fallback-parse_printf_format-implementation.patch \
39 file://0005-src-basic-missing.h-check-for-missing-strndupa.patch \
40 file://0006-Include-netinet-if_ether.h.patch \
41 file://0007-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not.patch \
42 file://0008-add-missing-FTW_-macros-for-musl.patch \
Brad Bishopc342db32019-05-15 21:57:59 -040043 file://0010-fix-missing-of-__register_atfork-for-non-glibc-build.patch \
44 file://0011-Use-uintmax_t-for-handling-rlim_t.patch \
Brad Bishop15ae2502019-06-18 21:44:24 -040045 file://0001-Replace-the-legacy-ULONG_LONG_MAX-with-the-C99-ULLON.patch \
Brad Bishopc342db32019-05-15 21:57:59 -040046 file://0014-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch \
47 file://0015-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch \
48 file://0016-Define-glibc-compatible-basename-for-non-glibc-syste.patch \
49 file://0017-Do-not-disable-buffering-when-writing-to-oom_score_a.patch \
50 file://0018-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch \
51 file://0019-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch \
52 file://0020-missing_type.h-add-__compar_d_fn_t-definition.patch \
53 file://0021-avoid-redefinition-of-prctl_mm_map-structure.patch \
Brad Bishop15ae2502019-06-18 21:44:24 -040054 file://0001-src-udev-udev-event.c-must-include-sys-wait.h.patch \
Brad Bishopc342db32019-05-15 21:57:59 -040055 file://0023-socket-util.h-include-string.h.patch \
56 file://0024-test-json.c-define-M_PIl.patch \
57 file://0025-fs-utilh-add-missing-sys-stat-include.patch \
58 file://0001-do-not-disable-buffer-in-writing-files.patch \
59 "
60
61PAM_PLUGINS = " \
62 pam-plugin-unix \
63 pam-plugin-loginuid \
64 pam-plugin-keyinit \
65"
66
67PACKAGECONFIG ??= " \
68 ${@bb.utils.filter('DISTRO_FEATURES', 'efi ldconfig pam selinux usrmerge polkit', d)} \
69 ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \
70 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \
71 acl \
72 backlight \
73 binfmt \
74 gshadow \
75 hibernate \
76 hostnamed \
Brad Bishop393846f2019-05-20 12:24:11 -040077 idn \
Brad Bishopc342db32019-05-15 21:57:59 -040078 ima \
79 kmod \
80 localed \
81 logind \
82 machined \
83 myhostname \
84 networkd \
85 nss \
86 nss-mymachines \
87 nss-resolve \
88 quotacheck \
89 randomseed \
90 resolved \
91 smack \
92 sysusers \
93 timedated \
94 timesyncd \
95 utmp \
96 vconsole \
97 xz \
98"
99
100PACKAGECONFIG_remove_libc-musl = " \
101 gshadow \
Brad Bishop393846f2019-05-20 12:24:11 -0400102 idn \
Brad Bishopc342db32019-05-15 21:57:59 -0400103 localed \
104 myhostname \
105 nss \
106 nss-mymachines \
107 nss-resolve \
108 resolved \
109 smack \
110 sysusers \
111 utmp \
112"
113
114# Use the upstream systemd serial-getty@.service and rely on
115# systemd-getty-generator instead of using the OE-core specific
116# systemd-serialgetty.bb - not enabled by default.
117PACKAGECONFIG[serial-getty-generator] = ""
118
119PACKAGECONFIG[acl] = "-Dacl=true,-Dacl=false,acl"
120PACKAGECONFIG[audit] = "-Daudit=true,-Daudit=false,audit"
121PACKAGECONFIG[backlight] = "-Dbacklight=true,-Dbacklight=false"
122PACKAGECONFIG[binfmt] = "-Dbinfmt=true,-Dbinfmt=false"
123PACKAGECONFIG[bzip2] = "-Dbzip2=true,-Dbzip2=false,bzip2"
124PACKAGECONFIG[cgroupv2] = "-Ddefault-hierarchy=unified,-Ddefault-hierarchy=hybrid"
125PACKAGECONFIG[coredump] = "-Dcoredump=true,-Dcoredump=false"
126PACKAGECONFIG[cryptsetup] = "-Dlibcryptsetup=true,-Dlibcryptsetup=false,cryptsetup"
127PACKAGECONFIG[dbus] = "-Ddbus=true,-Ddbus=false,dbus"
128PACKAGECONFIG[efi] = "-Defi=true,-Defi=false"
Brad Bishopc68388fc2019-08-26 01:33:31 -0400129PACKAGECONFIG[gnu-efi] = "-Dgnu-efi=true -Defi-libdir=${STAGING_LIBDIR} -Defi-includedir=${STAGING_INCDIR}/efi,-Dgnu-efi=false,gnu-efi"
Brad Bishopc342db32019-05-15 21:57:59 -0400130PACKAGECONFIG[elfutils] = "-Delfutils=true,-Delfutils=false,elfutils"
131PACKAGECONFIG[firstboot] = "-Dfirstboot=true,-Dfirstboot=false"
132# Sign the journal for anti-tampering
133PACKAGECONFIG[gcrypt] = "-Dgcrypt=true,-Dgcrypt=false,libgcrypt"
134PACKAGECONFIG[gnutls] = "-Dgnutls=true,-Dgnutls=false,gnutls"
135PACKAGECONFIG[gshadow] = "-Dgshadow=true,-Dgshadow=false"
136PACKAGECONFIG[hibernate] = "-Dhibernate=true,-Dhibernate=false"
137PACKAGECONFIG[hostnamed] = "-Dhostnamed=true,-Dhostnamed=false"
Brad Bishop393846f2019-05-20 12:24:11 -0400138PACKAGECONFIG[idn] = "-Didn=true,-Didn=false"
Brad Bishopc342db32019-05-15 21:57:59 -0400139PACKAGECONFIG[ima] = "-Dima=true,-Dima=false"
140# importd requires curl/xz/zlib/bzip2/gcrypt
141PACKAGECONFIG[importd] = "-Dimportd=true,-Dimportd=false"
142# Update NAT firewall rules
143PACKAGECONFIG[iptc] = "-Dlibiptc=true,-Dlibiptc=false,iptables"
144PACKAGECONFIG[journal-upload] = "-Dlibcurl=true,-Dlibcurl=false,curl"
145PACKAGECONFIG[kmod] = "-Dkmod=true,-Dkmod=false,kmod"
146PACKAGECONFIG[ldconfig] = "-Dldconfig=true,-Dldconfig=false"
147PACKAGECONFIG[libidn] = "-Dlibidn=true,-Dlibidn=false,libidn"
148PACKAGECONFIG[localed] = "-Dlocaled=true,-Dlocaled=false"
149PACKAGECONFIG[logind] = "-Dlogind=true,-Dlogind=false"
150PACKAGECONFIG[lz4] = "-Dlz4=true,-Dlz4=false,lz4"
151PACKAGECONFIG[machined] = "-Dmachined=true,-Dmachined=false"
152PACKAGECONFIG[manpages] = "-Dman=true,-Dman=false,libxslt-native xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
153PACKAGECONFIG[microhttpd] = "-Dmicrohttpd=true,-Dmicrohttpd=false,libmicrohttpd"
154PACKAGECONFIG[myhostname] = "-Dnss-myhostname=true,-Dnss-myhostname=false,,libnss-myhostname"
155PACKAGECONFIG[networkd] = "-Dnetworkd=true,-Dnetworkd=false"
156PACKAGECONFIG[nss] = "-Dnss-systemd=true,-Dnss-systemd=false"
157PACKAGECONFIG[nss-mymachines] = "-Dnss-mymachines=true,-Dnss-mymachines=false"
158PACKAGECONFIG[nss-resolve] = "-Dnss-resolve=true,-Dnss-resolve=false"
159PACKAGECONFIG[openssl] = "-Dopenssl=true,-Dopenssl=false,openssl"
160PACKAGECONFIG[pam] = "-Dpam=true,-Dpam=false,libpam,${PAM_PLUGINS}"
161PACKAGECONFIG[pcre2] = "-Dpcre2=true,-Dpcre2=false,libpcre2"
162PACKAGECONFIG[polkit] = "-Dpolkit=true,-Dpolkit=false"
163PACKAGECONFIG[portabled] = "-Dportabled=true,-Dportabled=false"
164PACKAGECONFIG[qrencode] = "-Dqrencode=true,-Dqrencode=false,qrencode"
165PACKAGECONFIG[quotacheck] = "-Dquotacheck=true,-Dquotacheck=false"
166PACKAGECONFIG[randomseed] = "-Drandomseed=true,-Drandomseed=false"
167PACKAGECONFIG[resolved] = "-Dresolve=true,-Dresolve=false"
168PACKAGECONFIG[rfkill] = "-Drfkill=true,-Drfkill=false"
169# libseccomp is found in meta-security
170PACKAGECONFIG[seccomp] = "-Dseccomp=true,-Dseccomp=false,libseccomp"
171PACKAGECONFIG[selinux] = "-Dselinux=true,-Dselinux=false,libselinux,initscripts-sushell"
172PACKAGECONFIG[smack] = "-Dsmack=true,-Dsmack=false"
173PACKAGECONFIG[sysusers] = "-Dsysusers=true,-Dsysusers=false"
174PACKAGECONFIG[time-epoch] = "-Dtime-epoch=0,,"
175PACKAGECONFIG[timedated] = "-Dtimedated=true,-Dtimedated=false"
176PACKAGECONFIG[timesyncd] = "-Dtimesyncd=true,-Dtimesyncd=false"
177PACKAGECONFIG[usrmerge] = "-Dsplit-usr=false,-Dsplit-usr=true"
178PACKAGECONFIG[sbinmerge] = "-Dsplit-bin=false,-Dsplit-bin=true"
179PACKAGECONFIG[utmp] = "-Dutmp=true,-Dutmp=false"
180PACKAGECONFIG[valgrind] = "-DVALGRIND=1,,valgrind"
181PACKAGECONFIG[vconsole] = "-Dvconsole=true,-Dvconsole=false,,${PN}-vconsole-setup"
182# Verify keymaps on locale change
183PACKAGECONFIG[xkbcommon] = "-Dxkbcommon=true,-Dxkbcommon=false,libxkbcommon"
184PACKAGECONFIG[xz] = "-Dxz=true,-Dxz=false,xz"
185PACKAGECONFIG[zlib] = "-Dzlib=true,-Dzlib=false,zlib"
186
187# Helper variables to clarify locations. This mirrors the logic in systemd's
188# build system.
189rootprefix ?= "${root_prefix}"
190rootlibdir ?= "${base_libdir}"
191rootlibexecdir = "${rootprefix}/lib"
192
193# This links udev statically with systemd helper library.
194# Otherwise udev package would depend on systemd package (which has the needed shared library),
195# and always pull it into images.
196EXTRA_OEMESON += "-Dlink-udev-shared=false"
197
198EXTRA_OEMESON += "-Dnobody-user=nobody \
199 -Dnobody-group=nobody \
200 -Drootlibdir=${rootlibdir} \
201 -Drootprefix=${rootprefix} \
202 -Dsysvrcnd-path=${sysconfdir} \
203 -Ddefault-locale=C \
204 "
205
206# Hardcode target binary paths to avoid using paths from sysroot
207EXTRA_OEMESON += "-Dkexec-path=${sbindir}/kexec \
208 -Dkmod-path=${base_bindir}/kmod \
209 -Dmount-path=${base_bindir}/mount \
210 -Dquotacheck-path=${sbindir}/quotacheck \
211 -Dquotaon-path=${sbindir}/quotaon \
212 -Dsulogin-path=${base_sbindir}/sulogin \
213 -Dumount-path=${base_bindir}/umount"
214
215do_install() {
216 meson_do_install
217 install -d ${D}/${base_sbindir}
218 if ${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', 'false', 'true', d)}; then
219 # Provided by a separate recipe
220 rm ${D}${systemd_unitdir}/system/serial-getty* -f
221 fi
222
223 # Provide support for initramfs
224 [ ! -e ${D}/init ] && ln -s ${rootlibexecdir}/systemd/systemd ${D}/init
225 [ ! -e ${D}/${base_sbindir}/udevd ] && ln -s ${rootlibexecdir}/systemd/systemd-udevd ${D}/${base_sbindir}/udevd
226
227 install -d ${D}${sysconfdir}/udev/rules.d/
228 install -d ${D}${sysconfdir}/tmpfiles.d
229 install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/
230 install -d ${D}${libdir}/pkgconfig
231 install -m 0644 ${B}/src/udev/udev.pc ${D}${libdir}/pkgconfig/
232
233 install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
234
235 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
236 install -d ${D}${sysconfdir}/init.d
237 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd
238 sed -i s%@UDEVD@%${rootlibexecdir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd
239 fi
240
241 chown root:systemd-journal ${D}/${localstatedir}/log/journal
242
243 # Delete journal README, as log can be symlinked inside volatile.
244 rm -f ${D}/${localstatedir}/log/README
245
246 # journal-remote creates this at start
247 rm -rf ${D}/${localstatedir}/log/journal/remote
248
249 install -d ${D}${systemd_unitdir}/system/graphical.target.wants
250 install -d ${D}${systemd_unitdir}/system/multi-user.target.wants
251 install -d ${D}${systemd_unitdir}/system/poweroff.target.wants
252 install -d ${D}${systemd_unitdir}/system/reboot.target.wants
253 install -d ${D}${systemd_unitdir}/system/rescue.target.wants
254
255 # Create symlinks for systemd-update-utmp-runlevel.service
256 if ${@bb.utils.contains('PACKAGECONFIG', 'utmp', 'true', 'false', d)}; then
257 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/graphical.target.wants/systemd-update-utmp-runlevel.service
258 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/multi-user.target.wants/systemd-update-utmp-runlevel.service
259 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/poweroff.target.wants/systemd-update-utmp-runlevel.service
260 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/reboot.target.wants/systemd-update-utmp-runlevel.service
261 ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/rescue.target.wants/systemd-update-utmp-runlevel.service
262 fi
263
264 # this file is needed to exist if networkd is disabled but timesyncd is still in use since timesyncd checks it
265 # for existence else it fails
266 if [ -s ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf ]; then
267 ${@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)}
268 fi
269 if ! ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'true', 'false', d)}; then
270 echo 'L! ${sysconfdir}/resolv.conf - - - - ../run/systemd/resolve/resolv.conf' >>${D}${exec_prefix}/lib/tmpfiles.d/etc.conf
271 echo 'd /run/systemd/resolve 0755 root root -' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
272 echo 'f /run/systemd/resolve/resolv.conf 0644 root root' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
273 ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd
274 else
275 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
276 ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd
277 fi
278 install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${systemd_unitdir}/systemd-sysv-install
279
280 # If polkit is setup fixup permissions and ownership
281 if ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'true', 'false', d)}; then
282 if [ -d ${D}${datadir}/polkit-1/rules.d ]; then
283 chmod 700 ${D}${datadir}/polkit-1/rules.d
284 chown polkitd:root ${D}${datadir}/polkit-1/rules.d
285 fi
286 fi
287
288 # duplicate udevadm for postinst script
289 install -d ${D}${libexecdir}
290 ln ${D}${base_bindir}/udevadm ${D}${libexecdir}/${MLPREFIX}udevadm
291
292 # install default policy for presets
293 # https://www.freedesktop.org/wiki/Software/systemd/Preset/#howto
294 install -Dm 0644 ${WORKDIR}/99-default.preset ${D}${systemd_unitdir}/system-preset/99-default.preset
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 \
315 ${PN}-journal-gatewayd \
316 ${PN}-journal-upload \
317 ${PN}-journal-remote \
318 ${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
324SUMMARY_${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', 'microhttpd', '${PN}-journal-remote', '', d)} \
336 ${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '${PN}-journal-upload', '', d)} \
337"
338SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service"
339
340USERADD_PACKAGES = "${PN} ${PN}-extra-utils \
341 ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-gateway', '', d)} \
342 ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-remote', '', d)} \
343 ${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '${PN}-journal-upload', '', d)} \
344"
345GROUPADD_PARAM_${PN} = "-r systemd-journal"
346USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'coredump', '--system -d / -M --shell /bin/nologin systemd-coredump;', '', d)}"
347USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'networkd', '--system -d / -M --shell /bin/nologin systemd-network;', '', d)}"
348USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'polkit', '--system --no-create-home --user-group --home-dir ${sysconfdir}/polkit-1 polkitd;', '', d)}"
349USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'resolved', '--system -d / -M --shell /bin/nologin systemd-resolve;', '', d)}"
350USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'timesyncd', '--system -d / -M --shell /bin/nologin systemd-timesync;', '', d)}"
351USERADD_PARAM_${PN}-extra-utils = "--system -d / -M --shell /bin/nologin systemd-bus-proxy"
352USERADD_PARAM_${PN}-journal-gateway = "--system -d / -M --shell /bin/nologin systemd-journal-gateway"
353USERADD_PARAM_${PN}-journal-remote = "--system -d / -M --shell /bin/nologin systemd-journal-remote"
354USERADD_PARAM_${PN}-journal-upload = "--system -d / -M --shell /bin/nologin systemd-journal-upload"
355
356FILES_${PN}-analyze = "${bindir}/systemd-analyze"
357
358FILES_${PN}-initramfs = "/init"
359RDEPENDS_${PN}-initramfs = "${PN}"
360
361FILES_${PN}-gui = "${bindir}/systemadm"
362
363FILES_${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \
364 ${systemd_unitdir}/system/systemd-vconsole-setup.service \
365 ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service"
366
367RDEPENDS_${PN}-kernel-install += "bash"
368FILES_${PN}-kernel-install = "${bindir}/kernel-install \
369 ${sysconfdir}/kernel/ \
370 ${exec_prefix}/lib/kernel \
371 "
372FILES_${PN}-rpm-macros = "${exec_prefix}/lib/rpm \
373 "
374
375FILES_${PN}-xorg-xinitrc = "${sysconfdir}/X11/xinit/xinitrc.d/*"
376
377FILES_${PN}-zsh-completion = "${datadir}/zsh/site-functions"
378
379FILES_${PN}-binfmt = "${sysconfdir}/binfmt.d/ \
380 ${exec_prefix}/lib/binfmt.d \
381 ${rootlibexecdir}/systemd/systemd-binfmt \
382 ${systemd_unitdir}/system/proc-sys-fs-binfmt_misc.* \
383 ${systemd_unitdir}/system/systemd-binfmt.service"
384RRECOMMENDS_${PN}-binfmt = "kernel-module-binfmt-misc"
385
386RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts kbd-keymaps"
387
388
389FILES_${PN}-journal-gatewayd = "${rootlibexecdir}/systemd/systemd-journal-gatewayd \
390 ${systemd_system_unitdir}/systemd-journal-gatewayd.service \
391 ${systemd_system_unitdir}/systemd-journal-gatewayd.socket \
392 ${systemd_system_unitdir}/sockets.target.wants/systemd-journal-gatewayd.socket \
393 ${datadir}/systemd/gatewayd/browse.html \
394 "
395SYSTEMD_SERVICE_${PN}-journal-gatewayd = "systemd-journal-gatewayd.socket"
396
397FILES_${PN}-journal-upload = "${rootlibexecdir}/systemd/systemd-journal-upload \
398 ${systemd_system_unitdir}/systemd-journal-upload.service \
399 ${sysconfdir}/systemd/journal-upload.conf \
400 "
401SYSTEMD_SERVICE_${PN}-journal-upload = "systemd-journal-upload.service"
402
403FILES_${PN}-journal-remote = "${rootlibexecdir}/systemd/systemd-journal-remote \
404 ${sysconfdir}/systemd/journal-remote.conf \
405 ${systemd_system_unitdir}/systemd-journal-remote.service \
406 ${systemd_system_unitdir}/systemd-journal-remote.socket \
407 "
408SYSTEMD_SERVICE_${PN}-remote = "systemd-journal-remote.socket"
409
410
411FILES_${PN}-container = "${sysconfdir}/dbus-1/system.d/org.freedesktop.import1.conf \
412 ${sysconfdir}/dbus-1/system.d/org.freedesktop.machine1.conf \
413 ${sysconfdir}/systemd/system/multi-user.target.wants/machines.target \
414 ${base_bindir}/machinectl \
415 ${bindir}/systemd-nspawn \
416 ${nonarch_libdir}/systemd/import-pubring.gpg \
417 ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.import1.busname \
418 ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.machine1.busname \
419 ${systemd_system_unitdir}/local-fs.target.wants/var-lib-machines.mount \
420 ${systemd_system_unitdir}/machines.target.wants/var-lib-machines.mount \
421 ${systemd_system_unitdir}/remote-fs.target.wants/var-lib-machines.mount \
422 ${systemd_system_unitdir}/machine.slice \
423 ${systemd_system_unitdir}/machines.target \
424 ${systemd_system_unitdir}/org.freedesktop.import1.busname \
425 ${systemd_system_unitdir}/org.freedesktop.machine1.busname \
426 ${systemd_system_unitdir}/systemd-importd.service \
427 ${systemd_system_unitdir}/systemd-machined.service \
428 ${systemd_system_unitdir}/dbus-org.freedesktop.machine1.service \
429 ${systemd_system_unitdir}/var-lib-machines.mount \
430 ${rootlibexecdir}/systemd/systemd-import \
431 ${rootlibexecdir}/systemd/systemd-importd \
432 ${rootlibexecdir}/systemd/systemd-machined \
433 ${rootlibexecdir}/systemd/systemd-pull \
434 ${exec_prefix}/lib/tmpfiles.d/systemd-nspawn.conf \
435 ${systemd_system_unitdir}/systemd-nspawn@.service \
436 ${libdir}/libnss_mymachines.so.2 \
437 ${datadir}/dbus-1/system-services/org.freedesktop.import1.service \
438 ${datadir}/dbus-1/system-services/org.freedesktop.machine1.service \
439 ${datadir}/dbus-1/system.d/org.freedesktop.import1.conf \
440 ${datadir}/dbus-1/system.d/org.freedesktop.machine1.conf \
441 ${datadir}/polkit-1/actions/org.freedesktop.import1.policy \
442 ${datadir}/polkit-1/actions/org.freedesktop.machine1.policy \
443 "
444
445RRECOMMENDS_${PN}-container += "\
446 ${PN}-journal-upload \
447 ${PN}-journal-remote \
448 ${PN}-journal-gatewayd \
449 "
450
451FILES_${PN}-extra-utils = "\
452 ${base_bindir}/systemd-escape \
453 ${base_bindir}/systemd-inhibit \
454 ${bindir}/systemd-detect-virt \
455 ${bindir}/systemd-path \
456 ${bindir}/systemd-run \
457 ${bindir}/systemd-cat \
458 ${bindir}/systemd-delta \
459 ${bindir}/systemd-cgls \
460 ${bindir}/systemd-cgtop \
461 ${bindir}/systemd-stdio-bridge \
462 ${base_bindir}/systemd-ask-password \
463 ${base_bindir}/systemd-tty-ask-password-agent \
464 ${systemd_unitdir}/system/systemd-ask-password-console.path \
465 ${systemd_unitdir}/system/systemd-ask-password-console.service \
466 ${systemd_unitdir}/system/systemd-ask-password-wall.path \
467 ${systemd_unitdir}/system/systemd-ask-password-wall.service \
468 ${systemd_unitdir}/system/sysinit.target.wants/systemd-ask-password-console.path \
469 ${systemd_unitdir}/system/sysinit.target.wants/systemd-ask-password-wall.path \
470 ${systemd_unitdir}/system/multi-user.target.wants/systemd-ask-password-wall.path \
471 ${rootlibexecdir}/systemd/systemd-resolve-host \
472 ${rootlibexecdir}/systemd/systemd-ac-power \
473 ${rootlibexecdir}/systemd/systemd-activate \
474 ${rootlibexecdir}/systemd/systemd-bus-proxyd \
475 ${systemd_unitdir}/system/systemd-bus-proxyd.service \
476 ${systemd_unitdir}/system/systemd-bus-proxyd.socket \
477 ${rootlibexecdir}/systemd/systemd-socket-proxyd \
478 ${rootlibexecdir}/systemd/systemd-reply-password \
479 ${rootlibexecdir}/systemd/systemd-sleep \
480 ${rootlibexecdir}/systemd/system-sleep \
481 ${systemd_unitdir}/system/systemd-hibernate.service \
482 ${systemd_unitdir}/system/systemd-hybrid-sleep.service \
483 ${systemd_unitdir}/system/systemd-suspend.service \
484 ${systemd_unitdir}/system/sleep.target \
485 ${rootlibexecdir}/systemd/systemd-initctl \
486 ${systemd_unitdir}/system/systemd-initctl.service \
487 ${systemd_unitdir}/system/systemd-initctl.socket \
488 ${systemd_unitdir}/system/sockets.target.wants/systemd-initctl.socket \
489 ${rootlibexecdir}/systemd/system-generators/systemd-gpt-auto-generator \
490 ${rootlibexecdir}/systemd/systemd-cgroups-agent \
491"
492
493CONFFILES_${PN} = "${sysconfdir}/systemd/coredump.conf \
494 ${sysconfdir}/systemd/journald.conf \
495 ${sysconfdir}/systemd/logind.conf \
496 ${sysconfdir}/systemd/system.conf \
497 ${sysconfdir}/systemd/user.conf \
498 ${sysconfdir}/systemd/resolved.conf \
499 ${sysconfdir}/systemd/timesyncd.conf \
500"
501
502FILES_${PN} = " ${base_bindir}/* \
503 ${base_sbindir}/shutdown \
504 ${base_sbindir}/halt \
505 ${base_sbindir}/poweroff \
506 ${base_sbindir}/runlevel \
507 ${base_sbindir}/telinit \
508 ${base_sbindir}/resolvconf \
509 ${base_sbindir}/reboot \
510 ${base_sbindir}/init \
511 ${datadir}/dbus-1/services \
512 ${datadir}/dbus-1/system-services \
513 ${datadir}/polkit-1 \
514 ${datadir}/${BPN} \
515 ${datadir}/factory \
516 ${sysconfdir}/dbus-1/ \
517 ${sysconfdir}/modules-load.d/ \
518 ${sysconfdir}/pam.d/ \
519 ${sysconfdir}/sysctl.d/ \
520 ${sysconfdir}/systemd/ \
521 ${sysconfdir}/tmpfiles.d/ \
522 ${sysconfdir}/xdg/ \
523 ${sysconfdir}/init.d/README \
524 ${sysconfdir}/resolv-conf.systemd \
525 ${rootlibexecdir}/systemd/* \
526 ${systemd_unitdir}/* \
527 ${base_libdir}/security/*.so \
528 /cgroup \
529 ${bindir}/systemd* \
530 ${bindir}/busctl \
531 ${bindir}/coredumpctl \
532 ${bindir}/localectl \
533 ${bindir}/hostnamectl \
534 ${bindir}/resolvectl \
535 ${bindir}/timedatectl \
536 ${bindir}/bootctl \
537 ${bindir}/kernel-install \
538 ${exec_prefix}/lib/tmpfiles.d/*.conf \
539 ${exec_prefix}/lib/systemd \
540 ${exec_prefix}/lib/modules-load.d \
541 ${exec_prefix}/lib/sysctl.d \
542 ${exec_prefix}/lib/sysusers.d \
543 ${exec_prefix}/lib/environment.d \
544 ${localstatedir} \
545 ${nonarch_base_libdir}/udev/rules.d/70-uaccess.rules \
546 ${nonarch_base_libdir}/udev/rules.d/71-seat.rules \
547 ${nonarch_base_libdir}/udev/rules.d/73-seat-late.rules \
548 ${nonarch_base_libdir}/udev/rules.d/99-systemd.rules \
549 ${nonarch_base_libdir}/modprobe.d/systemd.conf \
550 ${datadir}/dbus-1/system.d/org.freedesktop.timedate1.conf \
551 ${datadir}/dbus-1/system.d/org.freedesktop.locale1.conf \
552 ${datadir}/dbus-1/system.d/org.freedesktop.network1.conf \
553 ${datadir}/dbus-1/system.d/org.freedesktop.resolve1.conf \
554 ${datadir}/dbus-1/system.d/org.freedesktop.systemd1.conf \
555 ${datadir}/dbus-1/system.d/org.freedesktop.hostname1.conf \
556 ${datadir}/dbus-1/system.d/org.freedesktop.login1.conf \
557 ${datadir}/dbus-1/system.d/org.freedesktop.timesync1.conf \
558 ${datadir}/dbus-1/system.d/org.freedesktop.portable1.conf \
559 "
560
561FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
562
563RDEPENDS_${PN} += "kmod dbus util-linux-mount util-linux-umount udev (= ${EXTENDPKGV}) util-linux-agetty util-linux-fsck"
564RDEPENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', '', 'systemd-serialgetty', d)}"
565RDEPENDS_${PN} += "volatile-binds update-rc.d"
566
567RRECOMMENDS_${PN} += "systemd-extra-utils \
568 systemd-compat-units udev-hwdb \
569 e2fsprogs-e2fsck \
570 kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \
571 os-release \
572 systemd-conf \
573"
574
575INSANE_SKIP_${PN} += "dev-so libdir"
576INSANE_SKIP_${PN}-dbg += "libdir"
577INSANE_SKIP_${PN}-doc += " libdir"
578
579PACKAGES =+ "udev udev-hwdb"
580
581RPROVIDES_udev = "hotplug"
582
583RDEPENDS_udev-hwdb += "udev"
584
585FILES_udev += "${base_sbindir}/udevd \
586 ${rootlibexecdir}/systemd/network/99-default.link \
587 ${rootlibexecdir}/systemd/systemd-udevd \
588 ${rootlibexecdir}/udev/accelerometer \
589 ${rootlibexecdir}/udev/ata_id \
590 ${rootlibexecdir}/udev/cdrom_id \
591 ${rootlibexecdir}/udev/collect \
592 ${rootlibexecdir}/udev/findkeyboards \
593 ${rootlibexecdir}/udev/keyboard-force-release.sh \
594 ${rootlibexecdir}/udev/keymap \
595 ${rootlibexecdir}/udev/mtd_probe \
596 ${rootlibexecdir}/udev/scsi_id \
597 ${rootlibexecdir}/udev/v4l_id \
598 ${rootlibexecdir}/udev/keymaps \
599 ${rootlibexecdir}/udev/rules.d/*.rules \
600 ${sysconfdir}/udev \
601 ${sysconfdir}/init.d/systemd-udevd \
602 ${systemd_unitdir}/system/*udev* \
603 ${systemd_unitdir}/system/*.wants/*udev* \
604 ${base_bindir}/udevadm \
605 ${libexecdir}/${MLPREFIX}udevadm \
606 ${datadir}/bash-completion/completions/udevadm \
607 "
608
609FILES_udev-hwdb = "${rootlibexecdir}/udev/hwdb.d"
610
Brad Bishop15ae2502019-06-18 21:44:24 -0400611RCONFLICTS_${PN} = "tiny-init ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'resolvconf', '', d)}"
612
Brad Bishopc342db32019-05-15 21:57:59 -0400613INITSCRIPT_PACKAGES = "udev"
614INITSCRIPT_NAME_udev = "systemd-udevd"
615INITSCRIPT_PARAMS_udev = "start 03 S ."
616
617python __anonymous() {
618 if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
619 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
620}
621
622ALTERNATIVE_${PN} = "halt reboot shutdown poweroff runlevel resolv-conf"
623
624ALTERNATIVE_TARGET[resolv-conf] = "${sysconfdir}/resolv-conf.systemd"
625ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/resolv.conf"
626ALTERNATIVE_PRIORITY[resolv-conf] ?= "50"
627
628ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl"
629ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt"
630ALTERNATIVE_PRIORITY[halt] ?= "300"
631
632ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl"
633ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
634ALTERNATIVE_PRIORITY[reboot] ?= "300"
635
636ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl"
637ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown"
638ALTERNATIVE_PRIORITY[shutdown] ?= "300"
639
640ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl"
641ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
642ALTERNATIVE_PRIORITY[poweroff] ?= "300"
643
644ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"
645ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
646ALTERNATIVE_PRIORITY[runlevel] ?= "300"
647
648pkg_postinst_${PN} () {
649 sed -e '/^hosts:/s/\s*\<myhostname\>//' \
650 -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \
651 -i $D${sysconfdir}/nsswitch.conf
652}
653
654pkg_prerm_${PN} () {
655 sed -e '/^hosts:/s/\s*\<myhostname\>//' \
656 -e '/^hosts:/s/\s*myhostname//' \
657 -i $D${sysconfdir}/nsswitch.conf
658}
659
660PACKAGE_WRITE_DEPS += "qemu-native"
661pkg_postinst_udev-hwdb () {
662 if test -n "$D"; then
663 $INTERCEPT_DIR/postinst_intercept update_udev_hwdb ${PKG} mlprefix=${MLPREFIX} binprefix=${MLPREFIX}
664 else
665 udevadm hwdb --update
666 fi
667}
668
669pkg_prerm_udev-hwdb () {
670 rm -f $D${sysconfdir}/udev/hwdb.bin
671}