systemd_250.4.bb 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796
  1. require systemd.inc
  2. PROVIDES = "udev"
  3. PE = "1"
  4. DEPENDS = "intltool-native gperf-native libcap util-linux python3-jinja2-native"
  5. SECTION = "base/shell"
  6. inherit useradd pkgconfig meson perlnative update-rc.d update-alternatives qemu systemd gettext bash-completion manpages 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. ${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', 'file://org.freedesktop.hostname1_no_polkit.conf', '', d)} \
  13. ${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', 'file://00-hostnamed-network-user.conf', '', d)} \
  14. file://init \
  15. file://99-default.preset \
  16. file://systemd-pager.sh \
  17. file://0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch \
  18. file://0003-implment-systemd-sysv-install-for-OE.patch \
  19. file://0001-systemd.pc.in-use-ROOTPREFIX-without-suffixed-slash.patch \
  20. file://0001-test-parse-argument-Include-signal.h.patch \
  21. file://0029-network-enable-KeepConfiguration-when-running-on-net.patch \
  22. "
  23. # patches needed by musl
  24. SRC_URI:append:libc-musl = " ${SRC_URI_MUSL}"
  25. SRC_URI_MUSL = "\
  26. file://0002-don-t-use-glibc-specific-qsort_r.patch \
  27. file://0003-missing_type.h-add-__compare_fn_t-and-comparison_fn_.patch \
  28. file://0004-add-fallback-parse_printf_format-implementation.patch \
  29. file://0005-src-basic-missing.h-check-for-missing-strndupa.patch \
  30. file://0007-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch \
  31. file://0008-add-missing-FTW_-macros-for-musl.patch \
  32. file://0009-fix-missing-of-__register_atfork-for-non-glibc-build.patch \
  33. file://0010-Use-uintmax_t-for-handling-rlim_t.patch \
  34. file://0011-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch \
  35. file://0012-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch \
  36. file://0013-Define-glibc-compatible-basename-for-non-glibc-syste.patch \
  37. file://0014-Do-not-disable-buffering-when-writing-to-oom_score_a.patch \
  38. file://0015-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch \
  39. file://0016-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch \
  40. file://0017-missing_type.h-add-__compar_d_fn_t-definition.patch \
  41. file://0018-avoid-redefinition-of-prctl_mm_map-structure.patch \
  42. file://0019-Handle-missing-LOCK_EX.patch \
  43. file://0020-Fix-incompatible-pointer-type-struct-sockaddr_un.patch \
  44. file://0021-test-json.c-define-M_PIl.patch \
  45. file://0022-do-not-disable-buffer-in-writing-files.patch \
  46. file://0025-Handle-__cpu_mask-usage.patch \
  47. file://0026-Handle-missing-gshadow.patch \
  48. file://0028-missing_syscall.h-Define-MIPS-ABI-defines-for-musl.patch \
  49. file://0001-pass-correct-parameters-to-getdents64.patch \
  50. file://0002-Add-sys-stat.h-for-S_IFDIR.patch \
  51. file://0001-Adjust-for-musl-headers.patch \
  52. "
  53. PAM_PLUGINS = " \
  54. pam-plugin-unix \
  55. pam-plugin-loginuid \
  56. pam-plugin-keyinit \
  57. "
  58. PACKAGECONFIG ??= " \
  59. ${@bb.utils.filter('DISTRO_FEATURES', 'acl audit efi ldconfig pam selinux smack usrmerge polkit seccomp', d)} \
  60. ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \
  61. ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \
  62. ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', '', 'link-udev-shared', d)} \
  63. backlight \
  64. binfmt \
  65. gshadow \
  66. hibernate \
  67. hostnamed \
  68. idn \
  69. ima \
  70. kmod \
  71. localed \
  72. logind \
  73. machined \
  74. myhostname \
  75. networkd \
  76. nss \
  77. nss-mymachines \
  78. nss-resolve \
  79. quotacheck \
  80. randomseed \
  81. resolved \
  82. set-time-epoch \
  83. sysusers \
  84. sysvinit \
  85. timedated \
  86. timesyncd \
  87. userdb \
  88. utmp \
  89. vconsole \
  90. wheel-group \
  91. zstd \
  92. "
  93. PACKAGECONFIG:remove:libc-musl = " \
  94. gshadow \
  95. idn \
  96. localed \
  97. myhostname \
  98. nss \
  99. nss-mymachines \
  100. nss-resolve \
  101. sysusers \
  102. userdb \
  103. utmp \
  104. "
  105. # https://github.com/seccomp/libseccomp/issues/347
  106. PACKAGECONFIG:remove:mipsarch = "seccomp"
  107. CFLAGS:append:libc-musl = " -D__UAPI_DEF_ETHHDR=0 "
  108. # Some of the dependencies are weak-style recommends - if not available at runtime,
  109. # systemd won't fail but the library-related feature will be skipped with a warning.
  110. # Use the upstream systemd serial-getty@.service and rely on
  111. # systemd-getty-generator instead of using the OE-core specific
  112. # systemd-serialgetty.bb - not enabled by default.
  113. PACKAGECONFIG[serial-getty-generator] = ""
  114. PACKAGECONFIG[acl] = "-Dacl=true,-Dacl=false,acl"
  115. PACKAGECONFIG[audit] = "-Daudit=true,-Daudit=false,audit"
  116. PACKAGECONFIG[backlight] = "-Dbacklight=true,-Dbacklight=false"
  117. PACKAGECONFIG[binfmt] = "-Dbinfmt=true,-Dbinfmt=false"
  118. PACKAGECONFIG[bzip2] = "-Dbzip2=true,-Dbzip2=false,bzip2"
  119. PACKAGECONFIG[cgroupv2] = "-Ddefault-hierarchy=unified,-Ddefault-hierarchy=hybrid"
  120. PACKAGECONFIG[coredump] = "-Dcoredump=true,-Dcoredump=false"
  121. PACKAGECONFIG[cryptsetup] = "-Dlibcryptsetup=true,-Dlibcryptsetup=false,cryptsetup,,cryptsetup"
  122. PACKAGECONFIG[tpm2] = "-Dtpm2=true,-Dtpm2=false,tpm2-tss,tpm2-tss libtss2 libtss2-tcti-device"
  123. PACKAGECONFIG[dbus] = "-Ddbus=true,-Ddbus=false,dbus"
  124. PACKAGECONFIG[efi] = "-Defi=true,-Defi=false"
  125. PACKAGECONFIG[gnu-efi] = "-Dgnu-efi=true -Defi-libdir=${STAGING_LIBDIR} -Defi-includedir=${STAGING_INCDIR}/efi,-Dgnu-efi=false,gnu-efi"
  126. PACKAGECONFIG[elfutils] = "-Delfutils=true,-Delfutils=false,elfutils"
  127. PACKAGECONFIG[firstboot] = "-Dfirstboot=true,-Dfirstboot=false"
  128. PACKAGECONFIG[repart] = "-Drepart=true,-Drepart=false"
  129. PACKAGECONFIG[homed] = "-Dhomed=true,-Dhomed=false"
  130. # Sign the journal for anti-tampering
  131. PACKAGECONFIG[gcrypt] = "-Dgcrypt=true,-Dgcrypt=false,libgcrypt"
  132. PACKAGECONFIG[gnutls] = "-Dgnutls=true,-Dgnutls=false,gnutls"
  133. PACKAGECONFIG[gshadow] = "-Dgshadow=true,-Dgshadow=false"
  134. PACKAGECONFIG[hibernate] = "-Dhibernate=true,-Dhibernate=false"
  135. PACKAGECONFIG[hostnamed] = "-Dhostnamed=true,-Dhostnamed=false"
  136. PACKAGECONFIG[idn] = "-Didn=true,-Didn=false"
  137. PACKAGECONFIG[ima] = "-Dima=true,-Dima=false"
  138. # importd requires journal-upload/xz/zlib/bzip2/gcrypt
  139. PACKAGECONFIG[importd] = "-Dimportd=true,-Dimportd=false"
  140. # Update NAT firewall rules
  141. PACKAGECONFIG[iptc] = "-Dlibiptc=true,-Dlibiptc=false,iptables"
  142. PACKAGECONFIG[journal-upload] = "-Dlibcurl=true,-Dlibcurl=false,curl"
  143. PACKAGECONFIG[kmod] = "-Dkmod=true,-Dkmod=false,kmod"
  144. PACKAGECONFIG[ldconfig] = "-Dldconfig=true,-Dldconfig=false,,ldconfig"
  145. PACKAGECONFIG[libidn] = "-Dlibidn=true,-Dlibidn=false,libidn,,libidn"
  146. PACKAGECONFIG[libidn2] = "-Dlibidn2=true,-Dlibidn2=false,libidn2,,libidn2"
  147. # Link udev shared with systemd helper library.
  148. # If enabled the udev package depends on the systemd package (which has the needed shared library).
  149. PACKAGECONFIG[link-udev-shared] = "-Dlink-udev-shared=true,-Dlink-udev-shared=false"
  150. PACKAGECONFIG[localed] = "-Dlocaled=true,-Dlocaled=false"
  151. PACKAGECONFIG[logind] = "-Dlogind=true,-Dlogind=false"
  152. PACKAGECONFIG[lz4] = "-Dlz4=true,-Dlz4=false,lz4"
  153. PACKAGECONFIG[machined] = "-Dmachined=true,-Dmachined=false"
  154. PACKAGECONFIG[manpages] = "-Dman=true,-Dman=false,libxslt-native xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
  155. PACKAGECONFIG[microhttpd] = "-Dmicrohttpd=true,-Dmicrohttpd=false,libmicrohttpd"
  156. PACKAGECONFIG[myhostname] = "-Dnss-myhostname=true,-Dnss-myhostname=false,,libnss-myhostname"
  157. PACKAGECONFIG[networkd] = "-Dnetworkd=true,-Dnetworkd=false"
  158. PACKAGECONFIG[nss] = "-Dnss-systemd=true,-Dnss-systemd=false"
  159. PACKAGECONFIG[nss-mymachines] = "-Dnss-mymachines=true,-Dnss-mymachines=false"
  160. PACKAGECONFIG[nss-resolve] = "-Dnss-resolve=true,-Dnss-resolve=false"
  161. PACKAGECONFIG[oomd] = "-Doomd=true,-Doomd=false"
  162. PACKAGECONFIG[openssl] = "-Dopenssl=true,-Dopenssl=false,openssl"
  163. PACKAGECONFIG[pam] = "-Dpam=true,-Dpam=false,libpam,${PAM_PLUGINS}"
  164. PACKAGECONFIG[pcre2] = "-Dpcre2=true,-Dpcre2=false,libpcre2"
  165. PACKAGECONFIG[polkit] = "-Dpolkit=true,-Dpolkit=false"
  166. # If polkit is disabled and networkd+hostnamed are in use, enabling this option and
  167. # using dbus-broker will allow networkd to be authorized to change the
  168. # hostname without acquiring additional privileges
  169. PACKAGECONFIG[polkit_hostnamed_fallback] = ",,,,dbus-broker,polkit"
  170. PACKAGECONFIG[portabled] = "-Dportabled=true,-Dportabled=false"
  171. PACKAGECONFIG[qrencode] = "-Dqrencode=true,-Dqrencode=false,qrencode,,qrencode"
  172. PACKAGECONFIG[quotacheck] = "-Dquotacheck=true,-Dquotacheck=false"
  173. PACKAGECONFIG[randomseed] = "-Drandomseed=true,-Drandomseed=false"
  174. PACKAGECONFIG[resolved] = "-Dresolve=true,-Dresolve=false"
  175. PACKAGECONFIG[rfkill] = "-Drfkill=true,-Drfkill=false"
  176. PACKAGECONFIG[seccomp] = "-Dseccomp=true,-Dseccomp=false,libseccomp"
  177. PACKAGECONFIG[selinux] = "-Dselinux=true,-Dselinux=false,libselinux,initscripts-sushell"
  178. PACKAGECONFIG[smack] = "-Dsmack=true,-Dsmack=false"
  179. PACKAGECONFIG[sysusers] = "-Dsysusers=true,-Dsysusers=false"
  180. PACKAGECONFIG[sysvinit] = "-Dsysvinit-path=${sysconfdir}/init.d -Dsysvrcnd-path=${sysconfdir},-Dsysvinit-path= -Dsysvrcnd-path=,,systemd-compat-units update-rc.d"
  181. # When enabled use reproducble build timestamp if set as time epoch,
  182. # or build time if not. When disabled, time epoch is unset.
  183. def build_epoch(d):
  184. epoch = d.getVar('SOURCE_DATE_EPOCH') or "-1"
  185. return '-Dtime-epoch=%d' % int(epoch)
  186. PACKAGECONFIG[set-time-epoch] = "${@build_epoch(d)},-Dtime-epoch=0"
  187. PACKAGECONFIG[timedated] = "-Dtimedated=true,-Dtimedated=false"
  188. PACKAGECONFIG[timesyncd] = "-Dtimesyncd=true,-Dtimesyncd=false"
  189. PACKAGECONFIG[usrmerge] = "-Dsplit-usr=false,-Dsplit-usr=true"
  190. PACKAGECONFIG[sbinmerge] = "-Dsplit-bin=false,-Dsplit-bin=true"
  191. PACKAGECONFIG[userdb] = "-Duserdb=true,-Duserdb=false"
  192. PACKAGECONFIG[utmp] = "-Dutmp=true,-Dutmp=false"
  193. PACKAGECONFIG[valgrind] = "-DVALGRIND=1,,valgrind"
  194. PACKAGECONFIG[vconsole] = "-Dvconsole=true,-Dvconsole=false,,${PN}-vconsole-setup"
  195. PACKAGECONFIG[wheel-group] = "-Dwheel-group=true, -Dwheel-group=false"
  196. PACKAGECONFIG[xdg-autostart] = "-Dxdg-autostart=true,-Dxdg-autostart=false"
  197. # Verify keymaps on locale change
  198. PACKAGECONFIG[xkbcommon] = "-Dxkbcommon=true,-Dxkbcommon=false,libxkbcommon"
  199. PACKAGECONFIG[xz] = "-Dxz=true,-Dxz=false,xz"
  200. PACKAGECONFIG[zlib] = "-Dzlib=true,-Dzlib=false,zlib"
  201. PACKAGECONFIG[zstd] = "-Dzstd=true,-Dzstd=false,zstd"
  202. # Helper variables to clarify locations. This mirrors the logic in systemd's
  203. # build system.
  204. rootprefix ?= "${root_prefix}"
  205. rootlibdir ?= "${base_libdir}"
  206. rootlibexecdir = "${rootprefix}/lib"
  207. EXTRA_OEMESON += "-Dnobody-user=nobody \
  208. -Dnobody-group=nobody \
  209. -Drootlibdir=${rootlibdir} \
  210. -Drootprefix=${rootprefix} \
  211. -Ddefault-locale=C \
  212. -Dmode=release \
  213. -Dsystem-alloc-uid-min=101 \
  214. -Dsystem-uid-max=999 \
  215. -Dsystem-alloc-gid-min=101 \
  216. -Dsystem-gid-max=999 \
  217. "
  218. # Hardcode target binary paths to avoid using paths from sysroot
  219. EXTRA_OEMESON += "-Dkexec-path=${sbindir}/kexec \
  220. -Dkmod-path=${base_bindir}/kmod \
  221. -Dmount-path=${base_bindir}/mount \
  222. -Dquotacheck-path=${sbindir}/quotacheck \
  223. -Dquotaon-path=${sbindir}/quotaon \
  224. -Dsulogin-path=${base_sbindir}/sulogin \
  225. -Dnologin-path=${base_sbindir}/nologin \
  226. -Dumount-path=${base_bindir}/umount"
  227. do_install() {
  228. meson_do_install
  229. install -d ${D}/${base_sbindir}
  230. if ${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', 'false', 'true', d)}; then
  231. # Provided by a separate recipe
  232. rm ${D}${systemd_system_unitdir}/serial-getty* -f
  233. fi
  234. # Provide support for initramfs
  235. [ ! -e ${D}/init ] && ln -s ${rootlibexecdir}/systemd/systemd ${D}/init
  236. [ ! -e ${D}/${base_sbindir}/udevd ] && ln -s ${rootlibexecdir}/systemd/systemd-udevd ${D}/${base_sbindir}/udevd
  237. install -d ${D}${sysconfdir}/udev/rules.d/
  238. install -d ${D}${sysconfdir}/tmpfiles.d
  239. for rule in $(find ${WORKDIR} -maxdepth 1 -type f -name "*.rules"); do
  240. install -m 0644 $rule ${D}${sysconfdir}/udev/rules.d/
  241. done
  242. install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
  243. if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
  244. install -d ${D}${sysconfdir}/init.d
  245. install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd
  246. sed -i s%@UDEVD@%${rootlibexecdir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd
  247. install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${systemd_unitdir}/systemd-sysv-install
  248. fi
  249. if "${@'true' if oe.types.boolean(d.getVar('VOLATILE_LOG_DIR')) else 'false'}"; then
  250. # /var/log is typically a symbolic link to inside /var/volatile,
  251. # which is expected to be empty.
  252. rm -rf ${D}${localstatedir}/log
  253. else
  254. chown root:systemd-journal ${D}${localstatedir}/log/journal
  255. # journal-remote creates this at start
  256. rm -rf ${D}${localstatedir}/log/journal/remote
  257. fi
  258. install -d ${D}${systemd_system_unitdir}/graphical.target.wants
  259. install -d ${D}${systemd_system_unitdir}/multi-user.target.wants
  260. install -d ${D}${systemd_system_unitdir}/poweroff.target.wants
  261. install -d ${D}${systemd_system_unitdir}/reboot.target.wants
  262. install -d ${D}${systemd_system_unitdir}/rescue.target.wants
  263. # Create symlinks for systemd-update-utmp-runlevel.service
  264. if ${@bb.utils.contains('PACKAGECONFIG', 'utmp', 'true', 'false', d)}; then
  265. ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_system_unitdir}/graphical.target.wants/systemd-update-utmp-runlevel.service
  266. ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_system_unitdir}/multi-user.target.wants/systemd-update-utmp-runlevel.service
  267. ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_system_unitdir}/poweroff.target.wants/systemd-update-utmp-runlevel.service
  268. ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_system_unitdir}/reboot.target.wants/systemd-update-utmp-runlevel.service
  269. ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_system_unitdir}/rescue.target.wants/systemd-update-utmp-runlevel.service
  270. fi
  271. # this file is needed to exist if networkd is disabled but timesyncd is still in use since timesyncd checks it
  272. # for existence else it fails
  273. if [ -s ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf ] &&
  274. ! ${@bb.utils.contains('PACKAGECONFIG', 'networkd', 'true', 'false', d)}; then
  275. echo 'd /run/systemd/netif/links 0755 root root -' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
  276. fi
  277. if ! ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'true', 'false', d)}; then
  278. echo 'L! ${sysconfdir}/resolv.conf - - - - ../run/systemd/resolve/resolv.conf' >>${D}${exec_prefix}/lib/tmpfiles.d/etc.conf
  279. echo 'd /run/systemd/resolve 0755 root root -' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
  280. echo 'f /run/systemd/resolve/resolv.conf 0644 root root' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf
  281. ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd
  282. else
  283. 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
  284. ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd
  285. fi
  286. if ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'false', 'true', d)}; then
  287. rm ${D}${exec_prefix}/lib/tmpfiles.d/x11.conf
  288. rm -r ${D}${sysconfdir}/X11
  289. fi
  290. # If polkit is setup fixup permissions and ownership
  291. if ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'true', 'false', d)}; then
  292. if [ -d ${D}${datadir}/polkit-1/rules.d ]; then
  293. chmod 700 ${D}${datadir}/polkit-1/rules.d
  294. chown polkitd:root ${D}${datadir}/polkit-1/rules.d
  295. fi
  296. fi
  297. # If polkit is not available and a fallback was requested, install a drop-in that allows networkd to
  298. # request hostname changes via DBUS without elevating its privileges
  299. if ${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', 'true', 'false', d)}; then
  300. install -d ${D}${systemd_system_unitdir}/systemd-hostnamed.service.d/
  301. install -m 0644 ${WORKDIR}/00-hostnamed-network-user.conf ${D}${systemd_system_unitdir}/systemd-hostnamed.service.d/
  302. install -d ${D}${datadir}/dbus-1/system.d/
  303. install -m 0644 ${WORKDIR}/org.freedesktop.hostname1_no_polkit.conf ${D}${datadir}/dbus-1/system.d/
  304. fi
  305. # create link for existing udev rules
  306. ln -s ${base_bindir}/udevadm ${D}${base_sbindir}/udevadm
  307. # install default policy for presets
  308. # https://www.freedesktop.org/wiki/Software/systemd/Preset/#howto
  309. install -Dm 0644 ${WORKDIR}/99-default.preset ${D}${systemd_unitdir}/system-preset/99-default.preset
  310. # add a profile fragment to disable systemd pager with busybox less
  311. install -Dm 0644 ${WORKDIR}/systemd-pager.sh ${D}${sysconfdir}/profile.d/systemd-pager.sh
  312. }
  313. python populate_packages:prepend (){
  314. systemdlibdir = d.getVar("rootlibdir")
  315. do_split_packages(d, systemdlibdir, r'^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True)
  316. }
  317. PACKAGES_DYNAMIC += "^lib(udev|systemd|nss).*"
  318. PACKAGE_BEFORE_PN = "\
  319. ${PN}-gui \
  320. ${PN}-vconsole-setup \
  321. ${PN}-initramfs \
  322. ${PN}-analyze \
  323. ${PN}-kernel-install \
  324. ${PN}-rpm-macros \
  325. ${PN}-binfmt \
  326. ${PN}-zsh-completion \
  327. ${PN}-container \
  328. ${PN}-journal-gatewayd \
  329. ${PN}-journal-upload \
  330. ${PN}-journal-remote \
  331. ${PN}-extra-utils \
  332. ${PN}-udev-rules \
  333. libsystemd-shared \
  334. udev \
  335. udev-hwdb \
  336. "
  337. SUMMARY:${PN}-container = "Tools for containers and VMs"
  338. DESCRIPTION:${PN}-container = "Systemd tools to spawn and manage containers and virtual machines."
  339. SUMMARY:${PN}-journal-gatewayd = "HTTP server for journal events"
  340. 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."
  341. SUMMARY:${PN}-journal-upload = "Send journal messages over the network"
  342. DESCRIPTION:${PN}-journal-upload = "systemd-journal-upload uploads journal entries to a specified URL."
  343. SUMMARY:${PN}-journal-remote = "Receive journal messages over the network"
  344. DESCRIPTION:${PN}-journal-remote = "systemd-journal-remote is a command to receive serialized journal events and store them to journal files."
  345. SUMMARY:libsystemd-shared = "Systemd shared library"
  346. SYSTEMD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'binfmt', '${PN}-binfmt', '', d)} \
  347. ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-gatewayd', '', d)} \
  348. ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-remote', '', d)} \
  349. ${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '${PN}-journal-upload', '', d)} \
  350. "
  351. SYSTEMD_SERVICE:${PN}-binfmt = "systemd-binfmt.service"
  352. USERADD_PACKAGES = "${PN} ${PN}-extra-utils \
  353. ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-gatewayd', '', d)} \
  354. ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-remote', '', d)} \
  355. ${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '${PN}-journal-upload', '', d)} \
  356. "
  357. GROUPADD_PARAM:${PN} = "-r systemd-journal;"
  358. GROUPADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', '-r systemd-hostname;', '', d)}"
  359. USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'coredump', '--system -d / -M --shell /sbin/nologin systemd-coredump;', '', d)}"
  360. USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'networkd', '--system -d / -M --shell /sbin/nologin systemd-network;', '', d)}"
  361. USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'polkit', '--system --no-create-home --user-group --home-dir ${sysconfdir}/polkit-1 polkitd;', '', d)}"
  362. USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'resolved', '--system -d / -M --shell /sbin/nologin systemd-resolve;', '', d)}"
  363. USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'timesyncd', '--system -d / -M --shell /sbin/nologin systemd-timesync;', '', d)}"
  364. USERADD_PARAM:${PN}-extra-utils = "--system -d / -M --shell /sbin/nologin systemd-bus-proxy"
  365. USERADD_PARAM:${PN}-journal-gatewayd = "--system -d / -M --shell /sbin/nologin systemd-journal-gateway"
  366. USERADD_PARAM:${PN}-journal-remote = "--system -d / -M --shell /sbin/nologin systemd-journal-remote"
  367. USERADD_PARAM:${PN}-journal-upload = "--system -d / -M --shell /sbin/nologin systemd-journal-upload"
  368. FILES:${PN}-analyze = "${bindir}/systemd-analyze"
  369. FILES:${PN}-initramfs = "/init"
  370. RDEPENDS:${PN}-initramfs = "${PN}"
  371. FILES:${PN}-gui = "${bindir}/systemadm"
  372. FILES:${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \
  373. ${systemd_system_unitdir}/systemd-vconsole-setup.service \
  374. ${systemd_system_unitdir}/sysinit.target.wants/systemd-vconsole-setup.service"
  375. RDEPENDS:${PN}-kernel-install += "bash"
  376. FILES:${PN}-kernel-install = "${bindir}/kernel-install \
  377. ${sysconfdir}/kernel/ \
  378. ${exec_prefix}/lib/kernel \
  379. "
  380. FILES:${PN}-rpm-macros = "${exec_prefix}/lib/rpm \
  381. "
  382. FILES:${PN}-zsh-completion = "${datadir}/zsh/site-functions"
  383. FILES:${PN}-binfmt = "${sysconfdir}/binfmt.d/ \
  384. ${exec_prefix}/lib/binfmt.d \
  385. ${rootlibexecdir}/systemd/systemd-binfmt \
  386. ${systemd_system_unitdir}/proc-sys-fs-binfmt_misc.* \
  387. ${systemd_system_unitdir}/systemd-binfmt.service"
  388. RRECOMMENDS:${PN}-binfmt = "kernel-module-binfmt-misc"
  389. RRECOMMENDS:${PN}-vconsole-setup = "kbd kbd-consolefonts kbd-keymaps"
  390. FILES:${PN}-journal-gatewayd = "${rootlibexecdir}/systemd/systemd-journal-gatewayd \
  391. ${systemd_system_unitdir}/systemd-journal-gatewayd.service \
  392. ${systemd_system_unitdir}/systemd-journal-gatewayd.socket \
  393. ${systemd_system_unitdir}/sockets.target.wants/systemd-journal-gatewayd.socket \
  394. ${datadir}/systemd/gatewayd/browse.html \
  395. "
  396. SYSTEMD_SERVICE:${PN}-journal-gatewayd = "systemd-journal-gatewayd.socket"
  397. FILES:${PN}-journal-upload = "${rootlibexecdir}/systemd/systemd-journal-upload \
  398. ${systemd_system_unitdir}/systemd-journal-upload.service \
  399. ${sysconfdir}/systemd/journal-upload.conf \
  400. "
  401. SYSTEMD_SERVICE:${PN}-journal-upload = "systemd-journal-upload.service"
  402. FILES:${PN}-journal-remote = "${rootlibexecdir}/systemd/systemd-journal-remote \
  403. ${sysconfdir}/systemd/journal-remote.conf \
  404. ${systemd_system_unitdir}/systemd-journal-remote.service \
  405. ${systemd_system_unitdir}/systemd-journal-remote.socket \
  406. "
  407. SYSTEMD_SERVICE:${PN}-journal-remote = "systemd-journal-remote.socket"
  408. FILES:${PN}-container = "${sysconfdir}/dbus-1/system.d/org.freedesktop.import1.conf \
  409. ${sysconfdir}/dbus-1/system.d/org.freedesktop.machine1.conf \
  410. ${sysconfdir}/systemd/system/multi-user.target.wants/machines.target \
  411. ${base_bindir}/machinectl \
  412. ${bindir}/systemd-nspawn \
  413. ${nonarch_libdir}/systemd/import-pubring.gpg \
  414. ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.import1.busname \
  415. ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.machine1.busname \
  416. ${systemd_system_unitdir}/local-fs.target.wants/var-lib-machines.mount \
  417. ${systemd_system_unitdir}/machines.target.wants/var-lib-machines.mount \
  418. ${systemd_system_unitdir}/remote-fs.target.wants/var-lib-machines.mount \
  419. ${systemd_system_unitdir}/machine.slice \
  420. ${systemd_system_unitdir}/machines.target \
  421. ${systemd_system_unitdir}/org.freedesktop.import1.busname \
  422. ${systemd_system_unitdir}/org.freedesktop.machine1.busname \
  423. ${systemd_system_unitdir}/systemd-importd.service \
  424. ${systemd_system_unitdir}/systemd-machined.service \
  425. ${systemd_system_unitdir}/dbus-org.freedesktop.machine1.service \
  426. ${systemd_system_unitdir}/var-lib-machines.mount \
  427. ${rootlibexecdir}/systemd/systemd-import \
  428. ${rootlibexecdir}/systemd/systemd-importd \
  429. ${rootlibexecdir}/systemd/systemd-machined \
  430. ${rootlibexecdir}/systemd/systemd-pull \
  431. ${exec_prefix}/lib/tmpfiles.d/systemd-nspawn.conf \
  432. ${exec_prefix}/lib/tmpfiles.d/README \
  433. ${systemd_system_unitdir}/systemd-nspawn@.service \
  434. ${libdir}/libnss_mymachines.so.2 \
  435. ${datadir}/dbus-1/system-services/org.freedesktop.import1.service \
  436. ${datadir}/dbus-1/system-services/org.freedesktop.machine1.service \
  437. ${datadir}/dbus-1/system.d/org.freedesktop.import1.conf \
  438. ${datadir}/dbus-1/system.d/org.freedesktop.machine1.conf \
  439. ${datadir}/polkit-1/actions/org.freedesktop.import1.policy \
  440. ${datadir}/polkit-1/actions/org.freedesktop.machine1.policy \
  441. "
  442. # "machinectl import-tar" uses "tar --numeric-owner", not supported by busybox.
  443. RRECOMMENDS:${PN}-container += "\
  444. ${PN}-journal-gatewayd \
  445. ${PN}-journal-remote \
  446. ${PN}-journal-upload \
  447. kernel-module-dm-mod \
  448. kernel-module-loop \
  449. kernel-module-tun \
  450. tar \
  451. "
  452. FILES:${PN}-extra-utils = "\
  453. ${base_bindir}/systemd-escape \
  454. ${base_bindir}/systemd-inhibit \
  455. ${bindir}/systemd-detect-virt \
  456. ${bindir}/systemd-dissect \
  457. ${bindir}/systemd-path \
  458. ${bindir}/systemd-run \
  459. ${bindir}/systemd-cat \
  460. ${bindir}/systemd-delta \
  461. ${bindir}/systemd-cgls \
  462. ${bindir}/systemd-cgtop \
  463. ${bindir}/systemd-stdio-bridge \
  464. ${bindir}/systemd-sysext \
  465. ${base_bindir}/systemd-ask-password \
  466. ${base_bindir}/systemd-tty-ask-password-agent \
  467. ${systemd_system_unitdir}/systemd-ask-password-console.path \
  468. ${systemd_system_unitdir}/systemd-ask-password-console.service \
  469. ${systemd_system_unitdir}/systemd-ask-password-wall.path \
  470. ${systemd_system_unitdir}/systemd-ask-password-wall.service \
  471. ${systemd_system_unitdir}/sysinit.target.wants/systemd-ask-password-console.path \
  472. ${systemd_system_unitdir}/sysinit.target.wants/systemd-ask-password-wall.path \
  473. ${systemd_system_unitdir}/multi-user.target.wants/systemd-ask-password-wall.path \
  474. ${rootlibexecdir}/systemd/systemd-resolve-host \
  475. ${rootlibexecdir}/systemd/systemd-ac-power \
  476. ${rootlibexecdir}/systemd/systemd-activate \
  477. ${rootlibexecdir}/systemd/systemd-bus-proxyd \
  478. ${systemd_system_unitdir}/systemd-bus-proxyd.service \
  479. ${systemd_system_unitdir}/systemd-bus-proxyd.socket \
  480. ${rootlibexecdir}/systemd/systemd-socket-proxyd \
  481. ${rootlibexecdir}/systemd/systemd-reply-password \
  482. ${rootlibexecdir}/systemd/systemd-sleep \
  483. ${rootlibexecdir}/systemd/system-sleep \
  484. ${systemd_system_unitdir}/systemd-hibernate.service \
  485. ${systemd_system_unitdir}/systemd-hybrid-sleep.service \
  486. ${systemd_system_unitdir}/systemd-suspend.service \
  487. ${systemd_system_unitdir}/sleep.target \
  488. ${rootlibexecdir}/systemd/systemd-initctl \
  489. ${systemd_system_unitdir}/systemd-initctl.service \
  490. ${systemd_system_unitdir}/systemd-initctl.socket \
  491. ${systemd_system_unitdir}/sockets.target.wants/systemd-initctl.socket \
  492. ${rootlibexecdir}/systemd/system-generators/systemd-gpt-auto-generator \
  493. ${rootlibexecdir}/systemd/systemd-cgroups-agent \
  494. "
  495. FILES:${PN}-udev-rules = "\
  496. ${rootlibexecdir}/udev/rules.d/70-uaccess.rules \
  497. ${rootlibexecdir}/udev/rules.d/71-seat.rules \
  498. ${rootlibexecdir}/udev/rules.d/73-seat-late.rules \
  499. ${rootlibexecdir}/udev/rules.d/99-systemd.rules \
  500. "
  501. CONFFILES:${PN} = "${sysconfdir}/systemd/coredump.conf \
  502. ${sysconfdir}/systemd/journald.conf \
  503. ${sysconfdir}/systemd/logind.conf \
  504. ${sysconfdir}/systemd/networkd.conf \
  505. ${sysconfdir}/systemd/pstore.conf \
  506. ${sysconfdir}/systemd/resolved.conf \
  507. ${sysconfdir}/systemd/sleep.conf \
  508. ${sysconfdir}/systemd/system.conf \
  509. ${sysconfdir}/systemd/timesyncd.conf \
  510. ${sysconfdir}/systemd/user.conf \
  511. "
  512. FILES:${PN} = " ${base_bindir}/* \
  513. ${base_sbindir}/shutdown \
  514. ${base_sbindir}/halt \
  515. ${base_sbindir}/poweroff \
  516. ${base_sbindir}/runlevel \
  517. ${base_sbindir}/telinit \
  518. ${base_sbindir}/resolvconf \
  519. ${base_sbindir}/reboot \
  520. ${base_sbindir}/init \
  521. ${datadir}/dbus-1/services \
  522. ${datadir}/dbus-1/system-services \
  523. ${datadir}/polkit-1 \
  524. ${datadir}/${BPN} \
  525. ${datadir}/factory \
  526. ${sysconfdir}/dbus-1/ \
  527. ${sysconfdir}/modules-load.d/ \
  528. ${sysconfdir}/pam.d/ \
  529. ${sysconfdir}/profile.d/ \
  530. ${sysconfdir}/sysctl.d/ \
  531. ${sysconfdir}/systemd/ \
  532. ${sysconfdir}/tmpfiles.d/ \
  533. ${sysconfdir}/xdg/ \
  534. ${sysconfdir}/init.d/README \
  535. ${sysconfdir}/resolv-conf.systemd \
  536. ${sysconfdir}/X11/xinit/xinitrc.d/* \
  537. ${rootlibexecdir}/systemd/* \
  538. ${libdir}/pam.d \
  539. ${nonarch_libdir}/pam.d \
  540. ${systemd_unitdir}/* \
  541. ${base_libdir}/security/*.so \
  542. /cgroup \
  543. ${bindir}/systemd* \
  544. ${bindir}/busctl \
  545. ${bindir}/coredumpctl \
  546. ${bindir}/localectl \
  547. ${bindir}/hostnamectl \
  548. ${bindir}/resolvectl \
  549. ${bindir}/timedatectl \
  550. ${bindir}/bootctl \
  551. ${bindir}/oomctl \
  552. ${exec_prefix}/lib/tmpfiles.d/*.conf \
  553. ${exec_prefix}/lib/systemd \
  554. ${exec_prefix}/lib/modules-load.d \
  555. ${exec_prefix}/lib/sysctl.d \
  556. ${exec_prefix}/lib/sysusers.d \
  557. ${exec_prefix}/lib/environment.d \
  558. ${localstatedir} \
  559. ${rootlibexecdir}/modprobe.d/systemd.conf \
  560. ${rootlibexecdir}/modprobe.d/README \
  561. ${datadir}/dbus-1/system.d/org.freedesktop.timedate1.conf \
  562. ${datadir}/dbus-1/system.d/org.freedesktop.locale1.conf \
  563. ${datadir}/dbus-1/system.d/org.freedesktop.network1.conf \
  564. ${datadir}/dbus-1/system.d/org.freedesktop.resolve1.conf \
  565. ${datadir}/dbus-1/system.d/org.freedesktop.systemd1.conf \
  566. ${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', '${datadir}/dbus-1/system.d/org.freedesktop.hostname1_no_polkit.conf', '', d)} \
  567. ${datadir}/dbus-1/system.d/org.freedesktop.hostname1.conf \
  568. ${datadir}/dbus-1/system.d/org.freedesktop.login1.conf \
  569. ${datadir}/dbus-1/system.d/org.freedesktop.timesync1.conf \
  570. ${datadir}/dbus-1/system.d/org.freedesktop.portable1.conf \
  571. ${datadir}/dbus-1/system.d/org.freedesktop.oom1.conf \
  572. ${datadir}/dbus-1/system.d/org.freedesktop.home1.conf \
  573. "
  574. FILES:${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
  575. RDEPENDS:${PN} += "kmod dbus util-linux-mount util-linux-umount udev (= ${EXTENDPKGV}) systemd-udev-rules util-linux-agetty util-linux-fsck"
  576. RDEPENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', '', 'systemd-serialgetty', d)}"
  577. RDEPENDS:${PN} += "volatile-binds"
  578. RRECOMMENDS:${PN} += "systemd-extra-utils \
  579. udev-hwdb \
  580. e2fsprogs-e2fsck \
  581. kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 kernel-module-sch-fq-codel \
  582. os-release \
  583. systemd-conf \
  584. "
  585. INSANE_SKIP:${PN} += "dev-so libdir"
  586. INSANE_SKIP:${PN}-dbg += "libdir"
  587. INSANE_SKIP:${PN}-doc += " libdir"
  588. INSANE_SKIP:libsystemd-shared += "libdir"
  589. FILES:libsystemd-shared = "${rootlibexecdir}/systemd/libsystemd-shared*.so"
  590. RPROVIDES:udev = "hotplug"
  591. RDEPENDS:udev-hwdb += "udev"
  592. FILES:udev += "${base_sbindir}/udevd \
  593. ${rootlibexecdir}/systemd/network/99-default.link \
  594. ${rootlibexecdir}/systemd/systemd-udevd \
  595. ${rootlibexecdir}/udev/accelerometer \
  596. ${rootlibexecdir}/udev/ata_id \
  597. ${rootlibexecdir}/udev/cdrom_id \
  598. ${rootlibexecdir}/udev/collect \
  599. ${rootlibexecdir}/udev/dmi_memory_id \
  600. ${rootlibexecdir}/udev/fido_id \
  601. ${rootlibexecdir}/udev/findkeyboards \
  602. ${rootlibexecdir}/udev/keyboard-force-release.sh \
  603. ${rootlibexecdir}/udev/keymap \
  604. ${rootlibexecdir}/udev/mtd_probe \
  605. ${rootlibexecdir}/udev/scsi_id \
  606. ${rootlibexecdir}/udev/v4l_id \
  607. ${rootlibexecdir}/udev/keymaps \
  608. ${rootlibexecdir}/udev/rules.d/50-udev-default.rules \
  609. ${rootlibexecdir}/udev/rules.d/60-autosuspend.rules \
  610. ${rootlibexecdir}/udev/rules.d/60-autosuspend-chromiumos.rules \
  611. ${rootlibexecdir}/udev/rules.d/60-block.rules \
  612. ${rootlibexecdir}/udev/rules.d/60-cdrom_id.rules \
  613. ${rootlibexecdir}/udev/rules.d/60-drm.rules \
  614. ${rootlibexecdir}/udev/rules.d/60-evdev.rules \
  615. ${rootlibexecdir}/udev/rules.d/60-fido-id.rules \
  616. ${rootlibexecdir}/udev/rules.d/60-input-id.rules \
  617. ${rootlibexecdir}/udev/rules.d/60-persistent-alsa.rules \
  618. ${rootlibexecdir}/udev/rules.d/60-persistent-input.rules \
  619. ${rootlibexecdir}/udev/rules.d/60-persistent-storage.rules \
  620. ${rootlibexecdir}/udev/rules.d/60-persistent-storage-tape.rules \
  621. ${rootlibexecdir}/udev/rules.d/60-persistent-v4l.rules \
  622. ${rootlibexecdir}/udev/rules.d/60-sensor.rules \
  623. ${rootlibexecdir}/udev/rules.d/60-serial.rules \
  624. ${rootlibexecdir}/udev/rules.d/61-autosuspend-manual.rules \
  625. ${rootlibexecdir}/udev/rules.d/64-btrfs.rules \
  626. ${rootlibexecdir}/udev/rules.d/70-camera.rules \
  627. ${rootlibexecdir}/udev/rules.d/70-joystick.rules \
  628. ${rootlibexecdir}/udev/rules.d/70-memory.rules \
  629. ${rootlibexecdir}/udev/rules.d/70-mouse.rules \
  630. ${rootlibexecdir}/udev/rules.d/70-power-switch.rules \
  631. ${rootlibexecdir}/udev/rules.d/70-touchpad.rules \
  632. ${rootlibexecdir}/udev/rules.d/75-net-description.rules \
  633. ${rootlibexecdir}/udev/rules.d/75-probe_mtd.rules \
  634. ${rootlibexecdir}/udev/rules.d/78-sound-card.rules \
  635. ${rootlibexecdir}/udev/rules.d/80-drivers.rules \
  636. ${rootlibexecdir}/udev/rules.d/80-net-setup-link.rules \
  637. ${rootlibexecdir}/udev/rules.d/81-net-dhcp.rules \
  638. ${rootlibexecdir}/udev/rules.d/90-vconsole.rules \
  639. ${rootlibexecdir}/udev/rules.d/README \
  640. ${sysconfdir}/udev \
  641. ${sysconfdir}/init.d/systemd-udevd \
  642. ${systemd_system_unitdir}/*udev* \
  643. ${systemd_system_unitdir}/*.wants/*udev* \
  644. ${base_bindir}/systemd-hwdb \
  645. ${base_bindir}/udevadm \
  646. ${base_sbindir}/udevadm \
  647. ${datadir}/bash-completion/completions/udevadm \
  648. ${systemd_system_unitdir}/systemd-hwdb-update.service \
  649. "
  650. FILES:udev-hwdb = "${rootlibexecdir}/udev/hwdb.d \
  651. "
  652. RCONFLICTS:${PN} = "tiny-init ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'resolvconf', '', d)}"
  653. INITSCRIPT_PACKAGES = "udev"
  654. INITSCRIPT_NAME:udev = "systemd-udevd"
  655. INITSCRIPT_PARAMS:udev = "start 03 S ."
  656. python __anonymous() {
  657. if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
  658. d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
  659. if bb.utils.contains('PACKAGECONFIG', 'repart', True, False, d) and not bb.utils.contains('PACKAGECONFIG', 'openssl', True, False, d):
  660. bb.error("PACKAGECONFIG[repart] requires PACKAGECONFIG[openssl]")
  661. if bb.utils.contains('PACKAGECONFIG', 'homed', True, False, d) and not bb.utils.contains('PACKAGECONFIG', 'userdb openssl cryptsetup', True, False, d):
  662. bb.error("PACKAGECONFIG[homed] requires PACKAGECONFIG[userdb], PACKAGECONFIG[openssl] and PACKAGECONFIG[cryptsetup]")
  663. }
  664. python do_warn_musl() {
  665. if d.getVar('TCLIBC') == "musl":
  666. bb.warn("Using systemd with musl is not recommended since it is not supported upstream and some patches are known to be problematic.")
  667. }
  668. addtask warn_musl before do_configure
  669. ALTERNATIVE:${PN} = "halt reboot shutdown poweroff runlevel ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'resolv-conf', '', d)}"
  670. ALTERNATIVE_TARGET[resolv-conf] = "${sysconfdir}/resolv-conf.systemd"
  671. ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/resolv.conf"
  672. ALTERNATIVE_PRIORITY[resolv-conf] ?= "50"
  673. ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl"
  674. ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt"
  675. ALTERNATIVE_PRIORITY[halt] ?= "300"
  676. ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl"
  677. ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
  678. ALTERNATIVE_PRIORITY[reboot] ?= "300"
  679. ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl"
  680. ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown"
  681. ALTERNATIVE_PRIORITY[shutdown] ?= "300"
  682. ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl"
  683. ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
  684. ALTERNATIVE_PRIORITY[poweroff] ?= "300"
  685. ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"
  686. ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
  687. ALTERNATIVE_PRIORITY[runlevel] ?= "300"
  688. pkg_postinst:${PN}:libc-glibc () {
  689. sed -e '/^hosts:/s/\s*\<myhostname\>//' \
  690. -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \
  691. -i $D${sysconfdir}/nsswitch.conf
  692. }
  693. pkg_prerm:${PN}:libc-glibc () {
  694. sed -e '/^hosts:/s/\s*\<myhostname\>//' \
  695. -e '/^hosts:/s/\s*myhostname//' \
  696. -i $D${sysconfdir}/nsswitch.conf
  697. }
  698. PACKAGE_WRITE_DEPS += "qemu-native"
  699. pkg_postinst:udev-hwdb () {
  700. if test -n "$D"; then
  701. $INTERCEPT_DIR/postinst_intercept update_udev_hwdb ${PKG} mlprefix=${MLPREFIX} binprefix=${MLPREFIX} rootlibexecdir="${rootlibexecdir}" PREFERRED_PROVIDER_udev="${PREFERRED_PROVIDER_udev}"
  702. else
  703. udevadm hwdb --update
  704. fi
  705. }
  706. pkg_prerm:udev-hwdb () {
  707. rm -f $D${sysconfdir}/udev/hwdb.bin
  708. }