systemd_257.8.bb 47 KB

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