systemd_239.bb 28 KB

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