systemd_239.bb 33 KB

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