systemd_256.5.bb 47 KB

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