systemd_257.4.bb 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950
  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 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. 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[dbus] = "-Ddbus=enabled,-Ddbus=disabled,dbus"
  134. PACKAGECONFIG[efi] = "-Defi=true -Dbootloader=enabled,-Defi=false -Dbootloader=disabled,python3-pyelftools-native"
  135. PACKAGECONFIG[elfutils] = "-Delfutils=enabled,-Delfutils=disabled,elfutils,,libelf libdw"
  136. PACKAGECONFIG[fido] = "-Dlibfido2=enabled,-Dlibfido2=disabled,libfido2"
  137. PACKAGECONFIG[firstboot] = "-Dfirstboot=true,-Dfirstboot=false"
  138. PACKAGECONFIG[repart] = "-Drepart=enabled,-Drepart=disabled"
  139. PACKAGECONFIG[homed] = "-Dhomed=enabled,-Dhomed=disabled"
  140. # Sign the journal for anti-tampering
  141. PACKAGECONFIG[gcrypt] = "-Dgcrypt=enabled,-Dgcrypt=disabled,libgcrypt"
  142. PACKAGECONFIG[gnutls] = "-Dgnutls=enabled,-Dgnutls=disabled,gnutls"
  143. PACKAGECONFIG[gshadow] = "-Dgshadow=true,-Dgshadow=false"
  144. PACKAGECONFIG[hibernate] = "-Dhibernate=true,-Dhibernate=false"
  145. PACKAGECONFIG[hostnamed] = "-Dhostnamed=true,-Dhostnamed=false"
  146. PACKAGECONFIG[idn] = "-Didn=true,-Didn=false"
  147. PACKAGECONFIG[ima] = "-Dima=true,-Dima=false"
  148. # importd requires journal-upload/xz/zlib/bzip2/gcrypt
  149. PACKAGECONFIG[importd] = "-Dimportd=enabled,-Dimportd=disabled,glib-2.0"
  150. # Update NAT firewall rules
  151. PACKAGECONFIG[iptc] = "-Dlibiptc=enabled,-Dlibiptc=disabled,iptables"
  152. PACKAGECONFIG[journal-color] = ",,,less"
  153. PACKAGECONFIG[journal-upload] = "-Dlibcurl=enabled,-Dlibcurl=disabled,curl"
  154. PACKAGECONFIG[kmod] = "-Dkmod=enabled,-Dkmod=disabled,kmod,libkmod"
  155. PACKAGECONFIG[ldconfig] = "-Dldconfig=true,-Dldconfig=false,,ldconfig"
  156. PACKAGECONFIG[libidn] = "-Dlibidn=enabled,-Dlibidn=disabled,libidn,,libidn"
  157. PACKAGECONFIG[libidn2] = "-Dlibidn2=enabled,-Dlibidn2=disabled,libidn2,,libidn2"
  158. # Link udev shared with systemd helper library.
  159. # If enabled the udev package depends on the systemd package (which has the needed shared library).
  160. PACKAGECONFIG[link-udev-shared] = "-Dlink-udev-shared=true,-Dlink-udev-shared=false"
  161. PACKAGECONFIG[localed] = "-Dlocaled=true,-Dlocaled=false"
  162. PACKAGECONFIG[logind] = "-Dlogind=true,-Dlogind=false"
  163. PACKAGECONFIG[lz4] = "-Dlz4=enabled,-Dlz4=disabled,lz4"
  164. PACKAGECONFIG[machined] = "-Dmachined=true,-Dmachined=false"
  165. PACKAGECONFIG[manpages] = "-Dman=enabled,-Dman=disabled,python3-lxml-native libxslt-native xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
  166. PACKAGECONFIG[microhttpd] = "-Dmicrohttpd=enabled,-Dmicrohttpd=disabled,libmicrohttpd"
  167. PACKAGECONFIG[mountfsd] = "-Dmountfsd=true,-Dmountfsd=false"
  168. PACKAGECONFIG[myhostname] = "-Dnss-myhostname=true,-Dnss-myhostname=false,,libnss-myhostname"
  169. PACKAGECONFIG[nsresourced] = "-Dnsresourced=true,-Dnsresourced=false"
  170. PACKAGECONFIG[networkd] = "-Dnetworkd=true,-Dnetworkd=false"
  171. PACKAGECONFIG[no-dns-fallback] = "-Ddns-servers="
  172. PACKAGECONFIG[no-ntp-fallback] = "-Dntp-servers="
  173. PACKAGECONFIG[nss] = "-Dnss-systemd=true,-Dnss-systemd=false,,libnss-systemd"
  174. PACKAGECONFIG[nss-mymachines] = "-Dnss-mymachines=enabled,-Dnss-mymachines=disabled"
  175. PACKAGECONFIG[nss-resolve] = "-Dnss-resolve=enabled,-Dnss-resolve=disabled"
  176. PACKAGECONFIG[oomd] = "-Doomd=true,-Doomd=false"
  177. PACKAGECONFIG[openssl] = "-Dopenssl=enabled,-Dopenssl=disabled,openssl"
  178. PACKAGECONFIG[p11kit] = "-Dp11kit=enabled,-Dp11kit=disabled,p11-kit"
  179. PACKAGECONFIG[pam] = "-Dpam=enabled,-Dpam=disabled,libpam,${PAM_PLUGINS}"
  180. PACKAGECONFIG[pcre2] = "-Dpcre2=enabled,-Dpcre2=disabled,libpcre2"
  181. PACKAGECONFIG[polkit] = "-Dpolkit=enabled,-Dpolkit=disabled"
  182. # If polkit is disabled and networkd+hostnamed are in use, enabling this option and
  183. # using dbus-broker will allow networkd to be authorized to change the
  184. # hostname without acquiring additional privileges
  185. PACKAGECONFIG[polkit_hostnamed_fallback] = ",,,,dbus-broker,polkit"
  186. PACKAGECONFIG[portabled] = "-Dportabled=true,-Dportabled=false"
  187. PACKAGECONFIG[pstore] = "-Dpstore=true,-Dpstore=false"
  188. PACKAGECONFIG[pni-names] = ",,,"
  189. PACKAGECONFIG[qrencode] = "-Dqrencode=enabled,-Dqrencode=disabled,qrencode,,qrencode"
  190. PACKAGECONFIG[quotacheck] = "-Dquotacheck=true,-Dquotacheck=false"
  191. PACKAGECONFIG[randomseed] = "-Drandomseed=true,-Drandomseed=false"
  192. PACKAGECONFIG[resolved] = "-Dresolve=true,-Dresolve=false"
  193. PACKAGECONFIG[rfkill] = "-Drfkill=true,-Drfkill=false"
  194. PACKAGECONFIG[seccomp] = "-Dseccomp=enabled,-Dseccomp=disabled,libseccomp"
  195. PACKAGECONFIG[selinux] = "-Dselinux=enabled,-Dselinux=disabled,libselinux,initscripts-sushell"
  196. PACKAGECONFIG[smack] = "-Dsmack=true,-Dsmack=false"
  197. PACKAGECONFIG[sysext] = "-Dsysext=true, -Dsysext=false"
  198. PACKAGECONFIG[sysusers] = "-Dsysusers=true,-Dsysusers=false"
  199. PACKAGECONFIG[sysvinit] = "-Dsysvinit-path=${sysconfdir}/init.d -Dsysvrcnd-path=${sysconfdir},-Dsysvinit-path= -Dsysvrcnd-path=,,systemd-compat-units update-rc.d"
  200. # When enabled use reproducible build timestamp if set as time epoch,
  201. # or build time if not. When disabled, time epoch is unset.
  202. def build_epoch(d):
  203. epoch = d.getVar('SOURCE_DATE_EPOCH') or "-1"
  204. return '-Dtime-epoch=%d' % int(epoch)
  205. PACKAGECONFIG[set-time-epoch] = "${@build_epoch(d)},-Dtime-epoch=0"
  206. PACKAGECONFIG[timedated] = "-Dtimedated=true,-Dtimedated=false"
  207. PACKAGECONFIG[timesyncd] = "-Dtimesyncd=true,-Dtimesyncd=false"
  208. PACKAGECONFIG[sbinmerge] = "-Dsplit-bin=false,-Dsplit-bin=true"
  209. PACKAGECONFIG[userdb] = "-Duserdb=true,-Duserdb=false"
  210. PACKAGECONFIG[utmp] = "-Dutmp=true,-Dutmp=false"
  211. PACKAGECONFIG[valgrind] = "-DVALGRIND=1,,valgrind"
  212. PACKAGECONFIG[vconsole] = "-Dvconsole=true,-Dvconsole=false,,${PN}-vconsole-setup"
  213. PACKAGECONFIG[wheel-group] = "-Dwheel-group=true, -Dwheel-group=false"
  214. PACKAGECONFIG[xdg-autostart] = "-Dxdg-autostart=true,-Dxdg-autostart=false"
  215. # Verify keymaps on locale change
  216. PACKAGECONFIG[xkbcommon] = "-Dxkbcommon=enabled,-Dxkbcommon=disabled,libxkbcommon"
  217. PACKAGECONFIG[xz] = "-Dxz=enabled,-Dxz=disabled,xz"
  218. PACKAGECONFIG[zlib] = "-Dzlib=enabled,-Dzlib=disabled,zlib"
  219. PACKAGECONFIG[zstd] = "-Dzstd=enabled,-Dzstd=disabled,zstd"
  220. RESOLV_CONF ??= ""
  221. # bpf-framework: pass the recipe-sysroot to the compiler used to build
  222. # the eBPFs, so that it can find needed system includes in there.
  223. CFLAGS:append = " --sysroot=${STAGING_DIR_TARGET}"
  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. ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', '-Ddefault-mdns=no -Ddefault-llmnr=no', '', d)} \
  233. "
  234. # Hardcode target binary paths to avoid using paths from sysroot or worse
  235. # it pokes for these binaries on build host and encodes that distro assumption
  236. # into target
  237. EXTRA_OEMESON += "-Dkexec-path=${sbindir}/kexec \
  238. -Dkmod-path=${base_bindir}/kmod \
  239. -Dmount-path=${base_bindir}/mount \
  240. -Dquotacheck-path=${sbindir}/quotacheck \
  241. -Dquotaon-path=${sbindir}/quotaon \
  242. -Dsulogin-path=${base_sbindir}/sulogin \
  243. -Dnologin-path=${base_sbindir}/nologin \
  244. -Dumount-path=${base_bindir}/umount \
  245. -Dloadkeys-path=${bindir}/loadkeys \
  246. -Dsetfont-path=${bindir}/setfont"
  247. # The 60 seconds is watchdog's default vaule.
  248. WATCHDOG_TIMEOUT ??= "60"
  249. # To make use of the hardware watchdog it is sufficient to set WATCHDOG_RUNTIME_SEC
  250. # (RuntimeWatchdogSec= option in /etc/systemd/system.conf) to a value like 20s
  251. # and the watchdog is enabled. (defaults is no hardware watchdog use)
  252. WATCHDOG_RUNTIME_SEC ??= ""
  253. do_install() {
  254. meson_do_install
  255. if ${@bb.utils.contains('PACKAGECONFIG', 'sysusers', 'true', 'false', d)}; then
  256. # Change the root user's home directory in /lib/sysusers.d/basic.conf.
  257. # This is done merely for backward compatibility with previous systemd recipes.
  258. # systemd hardcodes root user's HOME to be "/root". Changing to use other values
  259. # may have unexpected runtime behaviors.
  260. if [ "${ROOT_HOME}" != "/root" ]; then
  261. bbwarn "Using ${ROOT_HOME} as root user's home directory is not fully supported by systemd"
  262. sed -i -e 's#/root#${ROOT_HOME}#g' ${D}${exec_prefix}/lib/sysusers.d/basic.conf
  263. fi
  264. fi
  265. install -d ${D}/${base_sbindir}
  266. if ! ${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', 'true', 'false', d)}; then
  267. # Remove the serial-getty generator and instead use explicit services
  268. # created by the systemd-serialgetty recipe
  269. find ${D} -name \*getty-generator\* -delete
  270. fi
  271. # Provide support for initramfs
  272. [ ! -e ${D}/init ] && ln -s ${nonarch_libdir}/systemd/systemd ${D}/init
  273. [ ! -e ${D}/${base_sbindir}/udevd ] && ln -s ${nonarch_libdir}/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@%${nonarch_libdir}/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 ! ${@bb.utils.contains('FILESYSTEM_PERMS_TABLES', 'files/fs-perms-volatile-tmp.txt', 'true', 'false', d)}; then
  299. rm -f ${D}${nonarch_libdir}/systemd/system/tmp.mount
  300. rm -f ${D}${nonarch_libdir}/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)} && ${@bb.utils.contains('PACKAGECONFIG', 'sysvinit', '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 not available and a fallback was requested, install a drop-in that allows networkd to
  336. # request hostname changes via DBUS without elevating its privileges
  337. if ${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', 'true', 'false', d)}; then
  338. install -d ${D}${systemd_system_unitdir}/systemd-hostnamed.service.d/
  339. install -m 0644 ${UNPACKDIR}/00-hostnamed-network-user.conf ${D}${systemd_system_unitdir}/systemd-hostnamed.service.d/
  340. install -d ${D}${datadir}/dbus-1/system.d/
  341. install -m 0644 ${UNPACKDIR}/org.freedesktop.hostname1_no_polkit.conf ${D}${datadir}/dbus-1/system.d/
  342. fi
  343. # create link for existing udev rules
  344. ln -s ${base_bindir}/udevadm ${D}${base_sbindir}/udevadm
  345. # install default policy for presets
  346. # https://www.freedesktop.org/wiki/Software/systemd/Preset/#howto
  347. install -Dm 0644 ${UNPACKDIR}/99-default.preset ${D}${systemd_unitdir}/system-preset/99-default.preset
  348. # add a profile fragment to disable systemd pager with busybox less
  349. install -Dm 0644 ${UNPACKDIR}/systemd-pager.sh ${D}${sysconfdir}/profile.d/systemd-pager.sh
  350. if [ -n "${WATCHDOG_TIMEOUT}" ]; then
  351. sed -i -e 's/#RebootWatchdogSec=10min/RebootWatchdogSec=${WATCHDOG_TIMEOUT}/' \
  352. ${D}/${sysconfdir}/systemd/system.conf
  353. fi
  354. if [ -n "${WATCHDOG_RUNTIME_SEC}" ]; then
  355. sed -i -e 's/#RuntimeWatchdogSec=off/RuntimeWatchdogSec=${WATCHDOG_RUNTIME_SEC}/' \
  356. ${D}/${sysconfdir}/systemd/system.conf
  357. fi
  358. if ${@bb.utils.contains('PACKAGECONFIG', 'pni-names', 'true', 'false', d)}; then
  359. if ! grep -q '^NamePolicy=.*mac' ${D}${nonarch_libdir}/systemd/network/99-default.link; then
  360. sed -i '/^NamePolicy=/s/$/ mac/' ${D}${nonarch_libdir}/systemd/network/99-default.link
  361. fi
  362. if ! grep -q 'AlternativeNamesPolicy=.*mac' ${D}${nonarch_libdir}/systemd/network/99-default.link; then
  363. sed -i '/AlternativeNamesPolicy=/s/$/ mac/' ${D}${nonarch_libdir}/systemd/network/99-default.link
  364. fi
  365. else
  366. # Actively disable Predictable Network Interface Names
  367. sed -i 's/^NamePolicy=.*/NamePolicy=/;s/^AlternativeNamesPolicy=.*/AlternativeNamesPolicy=/' ${D}${nonarch_libdir}/systemd/network/99-default.link
  368. fi
  369. }
  370. python populate_packages:prepend (){
  371. systemdlibdir = d.getVar("libdir")
  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}-networkd \
  389. ${PN}-rpm-macros \
  390. ${PN}-udev-rules \
  391. ${PN}-vconsole-setup \
  392. ${PN}-zsh-completion \
  393. libsystemd-shared \
  394. udev \
  395. udev-bash-completion \
  396. udev-hwdb \
  397. "
  398. SUMMARY:${PN}-container = "Tools for containers and VMs"
  399. DESCRIPTION:${PN}-container = "Systemd tools to spawn and manage containers and virtual machines."
  400. SUMMARY:${PN}-journal-gatewayd = "HTTP server for journal events"
  401. 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."
  402. SUMMARY:${PN}-journal-upload = "Send journal messages over the network"
  403. DESCRIPTION:${PN}-journal-upload = "systemd-journal-upload uploads journal entries to a specified URL."
  404. SUMMARY:${PN}-journal-remote = "Receive journal messages over the network"
  405. DESCRIPTION:${PN}-journal-remote = "systemd-journal-remote is a command to receive serialized journal events and store them to journal files."
  406. SUMMARY:libsystemd-shared = "Systemd shared library"
  407. SYSTEMD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'binfmt', '${PN}-binfmt', '', d)} \
  408. ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-gatewayd', '', d)} \
  409. ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-remote', '', d)} \
  410. ${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '${PN}-journal-upload', '', d)} \
  411. ${@bb.utils.contains('PACKAGECONFIG', 'networkd', '${PN}-networkd', '', d)} \
  412. "
  413. SYSTEMD_SERVICE:${PN}-binfmt = "systemd-binfmt.service"
  414. USERADD_PACKAGES = "${PN} \
  415. udev \
  416. ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-gatewayd', '', d)} \
  417. ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-remote', '', d)} \
  418. ${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '${PN}-journal-upload', '', d)} \
  419. ${@bb.utils.contains('PACKAGECONFIG', 'networkd', '${PN}-networkd', '', d)} \
  420. "
  421. GROUPADD_PARAM:${PN} = "-r systemd-journal;"
  422. GROUPADD_PARAM:udev = "-r render"
  423. GROUPADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', '-r systemd-hostname;', '', d)}"
  424. USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'coredump', '--system -d / -M --shell /sbin/nologin systemd-coredump;', '', d)}"
  425. USERADD_PARAM:${PN}-networkd = "--system -d / -M --shell /sbin/nologin systemd-network"
  426. USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'polkit', '--system --no-create-home --user-group --home-dir ${datadir}/polkit-1 polkitd;', '', d)}"
  427. USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'resolved', '--system -d / -M --shell /sbin/nologin systemd-resolve;', '', d)}"
  428. USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'timesyncd', '--system -d / -M --shell /sbin/nologin systemd-timesync;', '', d)}"
  429. USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'oomd', '--system -d / -M --shell /sbin/nologin systemd-oom;', '', d)}"
  430. USERADD_PARAM:${PN}-journal-gatewayd = "--system -d / -M --shell /sbin/nologin systemd-journal-gateway"
  431. USERADD_PARAM:${PN}-journal-remote = "--system -d / -M --shell /sbin/nologin systemd-journal-remote"
  432. USERADD_PARAM:${PN}-journal-upload = "--system -d / -M --shell /sbin/nologin systemd-journal-upload"
  433. FILES:${PN}-analyze = "${bindir}/systemd-analyze"
  434. FILES:${PN}-crypt = "${bindir}/systemd-cryptenroll \
  435. ${libdir}/cryptsetup \
  436. "
  437. RRECOMMENDS:${PN} += "${PN}-crypt"
  438. FILES:${PN}-initramfs = "/init"
  439. RDEPENDS:${PN}-initramfs = "${PN}"
  440. FILES:${PN}-gui = "${bindir}/systemadm"
  441. FILES:${PN}-vconsole-setup = "${nonarch_libdir}/systemd/systemd-vconsole-setup \
  442. ${systemd_system_unitdir}/systemd-vconsole-setup.service \
  443. ${systemd_system_unitdir}/sysinit.target.wants/systemd-vconsole-setup.service"
  444. RDEPENDS:${PN}-kernel-install += "bash"
  445. FILES:${PN}-kernel-install = "${bindir}/kernel-install \
  446. ${sysconfdir}/kernel/ \
  447. ${exec_prefix}/lib/kernel \
  448. "
  449. FILES:${PN}-rpm-macros = "${exec_prefix}/lib/rpm \
  450. "
  451. FILES:${PN}-zsh-completion = "${datadir}/zsh/site-functions"
  452. FILES:${PN}-binfmt = "${sysconfdir}/binfmt.d/ \
  453. ${exec_prefix}/lib/binfmt.d \
  454. ${nonarch_libdir}/systemd/systemd-binfmt \
  455. ${systemd_system_unitdir}/proc-sys-fs-binfmt_misc.* \
  456. ${systemd_system_unitdir}/systemd-binfmt.service"
  457. RRECOMMENDS:${PN}-binfmt = "${@bb.utils.contains('PACKAGECONFIG', 'binfmt', 'kernel-module-binfmt-misc', '', d)}"
  458. RDEPENDS:${PN}-vconsole-setup = "${@bb.utils.contains('PACKAGECONFIG', 'vconsole', 'kbd kbd-consolefonts kbd-keymaps', '', d)}"
  459. FILES:${PN}-journal-gatewayd = "${nonarch_libdir}/systemd/systemd-journal-gatewayd \
  460. ${systemd_system_unitdir}/systemd-journal-gatewayd.service \
  461. ${systemd_system_unitdir}/systemd-journal-gatewayd.socket \
  462. ${systemd_system_unitdir}/sockets.target.wants/systemd-journal-gatewayd.socket \
  463. ${datadir}/systemd/gatewayd/browse.html \
  464. "
  465. SYSTEMD_SERVICE:${PN}-journal-gatewayd = "systemd-journal-gatewayd.socket"
  466. FILES:${PN}-journal-upload = "${nonarch_libdir}/systemd/systemd-journal-upload \
  467. ${systemd_system_unitdir}/systemd-journal-upload.service \
  468. ${sysconfdir}/systemd/journal-upload.conf \
  469. "
  470. SYSTEMD_SERVICE:${PN}-journal-upload = "systemd-journal-upload.service"
  471. FILES:${PN}-journal-remote = "${nonarch_libdir}/systemd/systemd-journal-remote \
  472. ${nonarch_libdir}/sysusers.d/systemd-remote.conf \
  473. ${sysconfdir}/systemd/journal-remote.conf \
  474. ${systemd_system_unitdir}/systemd-journal-remote.service \
  475. ${systemd_system_unitdir}/systemd-journal-remote.socket \
  476. "
  477. SYSTEMD_SERVICE:${PN}-journal-remote = "systemd-journal-remote.socket"
  478. FILES:${PN}-container = "${sysconfdir}/dbus-1/system.d/org.freedesktop.import1.conf \
  479. ${sysconfdir}/dbus-1/system.d/org.freedesktop.machine1.conf \
  480. ${sysconfdir}/systemd/system/multi-user.target.wants/machines.target \
  481. ${base_bindir}/machinectl \
  482. ${bindir}/systemd-nspawn \
  483. ${nonarch_libdir}/systemd/import-pubring.gpg \
  484. ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.import1.busname \
  485. ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.machine1.busname \
  486. ${systemd_system_unitdir}/local-fs.target.wants/var-lib-machines.mount \
  487. ${systemd_system_unitdir}/machines.target.wants/var-lib-machines.mount \
  488. ${systemd_system_unitdir}/remote-fs.target.wants/var-lib-machines.mount \
  489. ${systemd_system_unitdir}/machine.slice \
  490. ${systemd_system_unitdir}/machines.target \
  491. ${systemd_system_unitdir}/org.freedesktop.import1.busname \
  492. ${systemd_system_unitdir}/org.freedesktop.machine1.busname \
  493. ${systemd_system_unitdir}/systemd-importd.service \
  494. ${systemd_system_unitdir}/systemd-machined.service \
  495. ${systemd_system_unitdir}/dbus-org.freedesktop.machine1.service \
  496. ${systemd_system_unitdir}/var-lib-machines.mount \
  497. ${nonarch_libdir}/systemd/systemd-import \
  498. ${nonarch_libdir}/systemd/systemd-importd \
  499. ${nonarch_libdir}/systemd/systemd-machined \
  500. ${nonarch_libdir}/systemd/systemd-pull \
  501. ${exec_prefix}/lib/tmpfiles.d/systemd-nspawn.conf \
  502. ${exec_prefix}/lib/tmpfiles.d/README \
  503. ${systemd_system_unitdir}/systemd-nspawn@.service \
  504. ${datadir}/dbus-1/system-services/org.freedesktop.import1.service \
  505. ${datadir}/dbus-1/system-services/org.freedesktop.machine1.service \
  506. ${datadir}/dbus-1/system.d/org.freedesktop.import1.conf \
  507. ${datadir}/dbus-1/system.d/org.freedesktop.machine1.conf \
  508. ${datadir}/polkit-1/actions/org.freedesktop.import1.policy \
  509. ${datadir}/polkit-1/actions/org.freedesktop.machine1.policy \
  510. "
  511. RDEPENDS:${PN}-container = "${@bb.utils.contains('PACKAGECONFIG', 'nss-mymachines', 'libnss-mymachines', '', d)}"
  512. # "machinectl import-tar" uses "tar --numeric-owner", not supported by busybox.
  513. RRECOMMENDS:${PN}-container += "\
  514. ${PN}-journal-gatewayd \
  515. ${PN}-journal-remote \
  516. ${PN}-journal-upload \
  517. kernel-module-dm-mod \
  518. kernel-module-loop \
  519. kernel-module-tun \
  520. tar \
  521. "
  522. FILES:${PN}-extra-utils = "\
  523. ${base_bindir}/systemd-escape \
  524. ${base_bindir}/systemd-inhibit \
  525. ${bindir}/systemd-detect-virt \
  526. ${bindir}/systemd-dissect \
  527. ${bindir}/systemd-path \
  528. ${bindir}/systemd-run \
  529. ${bindir}/systemd-cat \
  530. ${bindir}/systemd-creds \
  531. ${bindir}/systemd-delta \
  532. ${bindir}/systemd-cgls \
  533. ${bindir}/systemd-cgtop \
  534. ${bindir}/systemd-stdio-bridge \
  535. ${base_bindir}/systemd-ask-password \
  536. ${base_bindir}/systemd-tty-ask-password-agent \
  537. ${base_sbindir}/mount.ddi \
  538. ${systemd_system_unitdir}/initrd.target.wants/systemd-pcrphase-initrd.path \
  539. ${systemd_system_unitdir}/systemd-ask-password-console.path \
  540. ${systemd_system_unitdir}/systemd-ask-password-console.service \
  541. ${systemd_system_unitdir}/systemd-ask-password-wall.path \
  542. ${systemd_system_unitdir}/systemd-ask-password-wall.service \
  543. ${systemd_system_unitdir}/sysinit.target.wants/systemd-ask-password-console.path \
  544. ${systemd_system_unitdir}/sysinit.target.wants/systemd-ask-password-wall.path \
  545. ${systemd_system_unitdir}/sysinit.target.wants/systemd-pcrphase.path \
  546. ${systemd_system_unitdir}/sysinit.target.wants/systemd-pcrphase-sysinit.path \
  547. ${systemd_system_unitdir}/multi-user.target.wants/systemd-ask-password-wall.path \
  548. ${nonarch_libdir}/systemd/systemd-resolve-host \
  549. ${nonarch_libdir}/systemd/systemd-ac-power \
  550. ${nonarch_libdir}/systemd/systemd-activate \
  551. ${nonarch_libdir}/systemd/systemd-measure \
  552. ${nonarch_libdir}/systemd/systemd-pcrphase \
  553. ${nonarch_libdir}/systemd/systemd-socket-proxyd \
  554. ${nonarch_libdir}/systemd/systemd-reply-password \
  555. ${nonarch_libdir}/systemd/systemd-sleep \
  556. ${nonarch_libdir}/systemd/system-sleep \
  557. ${systemd_system_unitdir}/systemd-hibernate.service \
  558. ${systemd_system_unitdir}/systemd-hybrid-sleep.service \
  559. ${systemd_system_unitdir}/systemd-pcrphase-initrd.service \
  560. ${systemd_system_unitdir}/systemd-pcrphase.service \
  561. ${systemd_system_unitdir}/systemd-pcrphase-sysinit.service \
  562. ${systemd_system_unitdir}/systemd-suspend.service \
  563. ${systemd_system_unitdir}/sleep.target \
  564. ${nonarch_libdir}/systemd/systemd-initctl \
  565. ${systemd_system_unitdir}/systemd-initctl.service \
  566. ${systemd_system_unitdir}/systemd-initctl.socket \
  567. ${systemd_system_unitdir}/sockets.target.wants/systemd-initctl.socket \
  568. ${nonarch_libdir}/systemd/system-generators/systemd-gpt-auto-generator \
  569. ${nonarch_libdir}/systemd/systemd-cgroups-agent \
  570. "
  571. FILES:${PN}-mime = "${MIMEDIR}"
  572. RRECOMMENDS:${PN} += "${PN}-mime"
  573. FILES:${PN}-networkd = "\
  574. ${bindir}/networkctl \
  575. ${datadir}/dbus-1/system-services/org.freedesktop.network1.service \
  576. ${datadir}/dbus-1/system.d/org.freedesktop.network1.conf \
  577. ${datadir}/polkit-1/actions/org.freedesktop.network1.policy \
  578. ${nonarch_libdir}/sysusers.d/systemd-network.conf \
  579. ${nonarch_libdir}/tmpfiles.d/systemd-network.conf \
  580. ${sysconfdir}/systemd/networkd.conf \
  581. ${systemd_system_unitdir}/systemd-networkd* \
  582. ${systemd_unitdir}/network/*.network \
  583. ${systemd_unitdir}/network/*.network.example \
  584. ${systemd_unitdir}/networkd.conf \
  585. ${systemd_unitdir}/systemd-networkd* \
  586. "
  587. # systemd-networkd-persistent-storage.service BindsTo=systemd-networkd.service
  588. # systemd-networkd.service has Also=systemd-networkd-wait-online.service
  589. SYSTEMD_SERVICE:${PN}-networkd = "systemd-networkd.service"
  590. CONFFILES:${PN}-networkd = "${sysconfdir}/systemd/networkd.conf"
  591. RDEPENDS:${PN}-networkd += "${PN}"
  592. RRECOMMENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'networkd', '${PN}-networkd', '', d)}"
  593. FILES:${PN}-udev-rules = "\
  594. ${nonarch_libdir}/udev/rules.d/70-uaccess.rules \
  595. ${nonarch_libdir}/udev/rules.d/71-seat.rules \
  596. ${nonarch_libdir}/udev/rules.d/73-seat-late.rules \
  597. ${nonarch_libdir}/udev/rules.d/99-systemd.rules \
  598. "
  599. CONFFILES:${PN} = "${sysconfdir}/systemd/coredump.conf \
  600. ${sysconfdir}/systemd/journald.conf \
  601. ${sysconfdir}/systemd/logind.conf \
  602. ${sysconfdir}/systemd/pstore.conf \
  603. ${sysconfdir}/systemd/resolved.conf \
  604. ${sysconfdir}/systemd/sleep.conf \
  605. ${sysconfdir}/systemd/system.conf \
  606. ${sysconfdir}/systemd/timesyncd.conf \
  607. ${sysconfdir}/systemd/user.conf \
  608. "
  609. FILES:${PN} = " ${base_bindir}/* \
  610. ${base_sbindir}/shutdown \
  611. ${base_sbindir}/halt \
  612. ${base_sbindir}/poweroff \
  613. ${base_sbindir}/runlevel \
  614. ${base_sbindir}/telinit \
  615. ${base_sbindir}/resolvconf \
  616. ${base_sbindir}/reboot \
  617. ${base_sbindir}/init \
  618. ${datadir}/dbus-1/services \
  619. ${datadir}/dbus-1/system-services \
  620. ${datadir}/polkit-1 \
  621. ${datadir}/${BPN} \
  622. ${datadir}/factory \
  623. ${sysconfdir}/credstore/ \
  624. ${sysconfdir}/credstore.encrypted/ \
  625. ${sysconfdir}/dbus-1/ \
  626. ${sysconfdir}/modules-load.d/ \
  627. ${sysconfdir}/pam.d/ \
  628. ${sysconfdir}/profile.d/ \
  629. ${sysconfdir}/sysctl.d/ \
  630. ${sysconfdir}/systemd/ \
  631. ${sysconfdir}/tmpfiles.d/ \
  632. ${sysconfdir}/xdg/ \
  633. ${sysconfdir}/init.d/README \
  634. ${sysconfdir}/resolv-conf.systemd \
  635. ${sysconfdir}/X11/xinit/xinitrc.d/* \
  636. ${sysconfdir}/ssh/ssh_config.d/20-systemd-ssh-proxy.conf \
  637. ${sysconfdir}/ssh/sshd_config.d/20-systemd-userdb.conf \
  638. ${nonarch_libdir}/systemd/* \
  639. ${libdir}/systemd/libsystemd-core* \
  640. ${libdir}/pam.d \
  641. ${nonarch_libdir}/pam.d \
  642. ${systemd_unitdir}/* \
  643. ${base_libdir}/security/*.so \
  644. /cgroup \
  645. ${bindir}/systemd* \
  646. ${bindir}/busctl \
  647. ${bindir}/coredumpctl \
  648. ${bindir}/localectl \
  649. ${bindir}/hostnamectl \
  650. ${bindir}/resolvectl \
  651. ${bindir}/timedatectl \
  652. ${bindir}/bootctl \
  653. ${bindir}/oomctl \
  654. ${bindir}/userdbctl \
  655. ${exec_prefix}/lib/credstore \
  656. ${exec_prefix}/lib/tmpfiles.d/*.conf \
  657. ${exec_prefix}/lib/systemd \
  658. ${exec_prefix}/lib/modules-load.d \
  659. ${exec_prefix}/lib/sysctl.d \
  660. ${exec_prefix}/lib/sysusers.d \
  661. ${exec_prefix}/lib/environment.d \
  662. ${exec_prefix}/lib/pcrlock.d \
  663. ${localstatedir} \
  664. ${nonarch_libdir}/modprobe.d/systemd.conf \
  665. ${nonarch_libdir}/modprobe.d/README \
  666. ${datadir}/dbus-1/system.d/org.freedesktop.timedate1.conf \
  667. ${datadir}/dbus-1/system.d/org.freedesktop.locale1.conf \
  668. ${datadir}/dbus-1/system.d/org.freedesktop.resolve1.conf \
  669. ${datadir}/dbus-1/system.d/org.freedesktop.systemd1.conf \
  670. ${@bb.utils.contains('PACKAGECONFIG', 'polkit_hostnamed_fallback', '${datadir}/dbus-1/system.d/org.freedesktop.hostname1_no_polkit.conf', '', d)} \
  671. ${datadir}/dbus-1/system.d/org.freedesktop.hostname1.conf \
  672. ${datadir}/dbus-1/system.d/org.freedesktop.login1.conf \
  673. ${datadir}/dbus-1/system.d/org.freedesktop.timesync1.conf \
  674. ${datadir}/dbus-1/system.d/org.freedesktop.portable1.conf \
  675. ${datadir}/dbus-1/system.d/org.freedesktop.oom1.conf \
  676. ${datadir}/dbus-1/system.d/org.freedesktop.home1.conf \
  677. "
  678. FILES:${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
  679. RDEPENDS:${PN} += "kmod dbus util-linux-mount util-linux-umount udev (= ${EXTENDPKGV}) systemd-udev-rules util-linux-agetty util-linux-fsck util-linux-swaponoff util-linux-mkswap"
  680. RDEPENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', '', 'systemd-serialgetty', d)}"
  681. RDEPENDS:${PN} += "volatile-binds"
  682. RRECOMMENDS:${PN} += "${PN}-extra-utils \
  683. udev-hwdb \
  684. e2fsprogs-e2fsck \
  685. kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 kernel-module-sch-fq-codel \
  686. os-release \
  687. systemd-conf \
  688. ${@bb.utils.contains('PACKAGECONFIG', 'logind', 'pam-plugin-umask', '', d)} \
  689. "
  690. INSANE_SKIP:${PN} += "dev-so libdir"
  691. INSANE_SKIP:${PN}-dbg += "libdir"
  692. INSANE_SKIP:${PN}-doc += " libdir"
  693. INSANE_SKIP:libsystemd-shared += "libdir"
  694. FILES:libsystemd-shared = "${libdir}/systemd/libsystemd-shared*.so"
  695. RPROVIDES:udev = "hotplug"
  696. RDEPENDS:udev-bash-completion += "bash-completion"
  697. RDEPENDS:udev-hwdb += "udev"
  698. FILES:udev += "${base_sbindir}/udevd \
  699. ${nonarch_libdir}/systemd/network/99-default.link \
  700. ${nonarch_libdir}/systemd/systemd-udevd \
  701. ${nonarch_libdir}/udev/accelerometer \
  702. ${nonarch_libdir}/udev/ata_id \
  703. ${nonarch_libdir}/udev/cdrom_id \
  704. ${nonarch_libdir}/udev/collect \
  705. ${nonarch_libdir}/udev/dmi_memory_id \
  706. ${nonarch_libdir}/udev/fido_id \
  707. ${nonarch_libdir}/udev/findkeyboards \
  708. ${nonarch_libdir}/udev/iocost \
  709. ${nonarch_libdir}/udev/keyboard-force-release.sh \
  710. ${nonarch_libdir}/udev/keymap \
  711. ${nonarch_libdir}/udev/mtd_probe \
  712. ${nonarch_libdir}/udev/scsi_id \
  713. ${nonarch_libdir}/udev/v4l_id \
  714. ${nonarch_libdir}/udev/keymaps \
  715. ${nonarch_libdir}/udev/rules.d/50-udev-default.rules \
  716. ${nonarch_libdir}/udev/rules.d/60-autosuspend.rules \
  717. ${nonarch_libdir}/udev/rules.d/60-autosuspend-chromiumos.rules \
  718. ${nonarch_libdir}/udev/rules.d/60-block.rules \
  719. ${nonarch_libdir}/udev/rules.d/60-cdrom_id.rules \
  720. ${nonarch_libdir}/udev/rules.d/60-dmi-id.rules \
  721. ${nonarch_libdir}/udev/rules.d/60-drm.rules \
  722. ${nonarch_libdir}/udev/rules.d/60-evdev.rules \
  723. ${nonarch_libdir}/udev/rules.d/60-fido-id.rules \
  724. ${nonarch_libdir}/udev/rules.d/60-infiniband.rules \
  725. ${nonarch_libdir}/udev/rules.d/60-input-id.rules \
  726. ${nonarch_libdir}/udev/rules.d/60-persistent-alsa.rules \
  727. ${nonarch_libdir}/udev/rules.d/60-persistent-input.rules \
  728. ${nonarch_libdir}/udev/rules.d/60-persistent-storage.rules \
  729. ${nonarch_libdir}/udev/rules.d/60-persistent-storage-mtd.rules \
  730. ${nonarch_libdir}/udev/rules.d/60-persistent-storage-tape.rules \
  731. ${nonarch_libdir}/udev/rules.d/60-persistent-v4l.rules \
  732. ${nonarch_libdir}/udev/rules.d/60-sensor.rules \
  733. ${nonarch_libdir}/udev/rules.d/60-serial.rules \
  734. ${nonarch_libdir}/udev/rules.d/61-autosuspend-manual.rules \
  735. ${nonarch_libdir}/udev/rules.d/64-btrfs.rules \
  736. ${nonarch_libdir}/udev/rules.d/70-camera.rules \
  737. ${nonarch_libdir}/udev/rules.d/70-joystick.rules \
  738. ${nonarch_libdir}/udev/rules.d/70-memory.rules \
  739. ${nonarch_libdir}/udev/rules.d/70-mouse.rules \
  740. ${nonarch_libdir}/udev/rules.d/70-power-switch.rules \
  741. ${nonarch_libdir}/udev/rules.d/70-touchpad.rules \
  742. ${nonarch_libdir}/udev/rules.d/75-net-description.rules \
  743. ${nonarch_libdir}/udev/rules.d/75-probe_mtd.rules \
  744. ${nonarch_libdir}/udev/rules.d/78-sound-card.rules \
  745. ${nonarch_libdir}/udev/rules.d/80-drivers.rules \
  746. ${nonarch_libdir}/udev/rules.d/80-net-setup-link.rules \
  747. ${nonarch_libdir}/udev/rules.d/81-net-dhcp.rules \
  748. ${nonarch_libdir}/udev/rules.d/90-vconsole.rules \
  749. ${nonarch_libdir}/udev/rules.d/90-iocost.rules \
  750. ${nonarch_libdir}/udev/rules.d/README \
  751. ${sysconfdir}/udev \
  752. ${sysconfdir}/init.d/systemd-udevd \
  753. ${systemd_system_unitdir}/*udev* \
  754. ${systemd_system_unitdir}/*.wants/*udev* \
  755. ${base_bindir}/systemd-hwdb \
  756. ${base_bindir}/udevadm \
  757. ${base_sbindir}/udevadm \
  758. ${systemd_system_unitdir}/systemd-hwdb-update.service \
  759. "
  760. FILES:udev-bash-completion = "${datadir}/bash-completion/completions/udevadm"
  761. FILES:udev-hwdb = "${nonarch_libdir}/udev/hwdb.d \
  762. "
  763. RCONFLICTS:${PN} = "tiny-init ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'resolvconf', '', d)}"
  764. INITSCRIPT_PACKAGES = "udev"
  765. INITSCRIPT_NAME:udev = "systemd-udevd"
  766. INITSCRIPT_PARAMS:udev = "start 03 S ."
  767. python __anonymous() {
  768. if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
  769. d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
  770. if bb.utils.contains('DISTRO_FEATURES', 'systemd-resolved', True, False, d) and not bb.utils.contains('PACKAGECONFIG', 'nss-resolve resolved', True, False, d):
  771. bb.error("DISTRO_FEATURES[systemd-resolved] requires PACKAGECONFIG[nss-resolve, resolved]")
  772. if bb.utils.contains('PACKAGECONFIG', 'repart', True, False, d) and not bb.utils.contains('PACKAGECONFIG', 'openssl', True, False, d):
  773. bb.error("PACKAGECONFIG[repart] requires PACKAGECONFIG[openssl]")
  774. if bb.utils.contains('PACKAGECONFIG', 'homed', True, False, d) and not bb.utils.contains('PACKAGECONFIG', 'userdb openssl cryptsetup', True, False, d):
  775. bb.error("PACKAGECONFIG[homed] requires PACKAGECONFIG[userdb], PACKAGECONFIG[openssl] and PACKAGECONFIG[cryptsetup]")
  776. }
  777. python do_warn_musl() {
  778. if d.getVar('TCLIBC') == "musl":
  779. bb.warn("Using systemd with musl is not recommended since it is not supported upstream and some patches are known to be problematic.")
  780. }
  781. addtask warn_musl before do_configure
  782. ALTERNATIVE:${PN} = "halt reboot shutdown poweroff \
  783. ${@bb.utils.contains('PACKAGECONFIG', 'sysvinit', 'runlevel', '', d)} \
  784. ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'resolv-conf', '', d)}"
  785. ALTERNATIVE_TARGET[resolv-conf] = "${sysconfdir}/resolv-conf.systemd"
  786. ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/resolv.conf"
  787. ALTERNATIVE_PRIORITY[resolv-conf] ?= "50"
  788. ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl"
  789. ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt"
  790. ALTERNATIVE_PRIORITY[halt] ?= "300"
  791. ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl"
  792. ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
  793. ALTERNATIVE_PRIORITY[reboot] ?= "300"
  794. ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl"
  795. ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown"
  796. ALTERNATIVE_PRIORITY[shutdown] ?= "300"
  797. ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl"
  798. ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
  799. ALTERNATIVE_PRIORITY[poweroff] ?= "300"
  800. ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"
  801. ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
  802. ALTERNATIVE_PRIORITY[runlevel] ?= "300"
  803. pkg_postinst:${PN}:append () {
  804. if ${@bb.utils.contains('PACKAGECONFIG', 'set-time-epoch', 'true', 'false', d)}; then
  805. touch $D${nonarch_libdir}/clock-epoch
  806. fi
  807. }
  808. pkg_postinst:${PN}:libc-glibc () {
  809. if ${@bb.utils.contains('PACKAGECONFIG', 'myhostname', 'true', 'false', d)}; then
  810. sed -e '/^hosts:/s/\s*\<myhostname\>//' \
  811. -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \
  812. -i $D${sysconfdir}/nsswitch.conf
  813. fi
  814. if ${@bb.utils.contains('PACKAGECONFIG', 'nss', 'true', 'false', d)}; then
  815. sed -e 's#\(^passwd:.*\)#\1 systemd#' \
  816. -e 's#\(^group:.*\)#\1 systemd#' \
  817. -e 's#\(^shadow:.*\)#\1 systemd#' \
  818. -i $D${sysconfdir}/nsswitch.conf
  819. fi
  820. }
  821. pkg_prerm:${PN}:libc-glibc () {
  822. if ${@bb.utils.contains('PACKAGECONFIG', 'myhostname', 'true', 'false', d)}; then
  823. sed -e '/^hosts:/s/\s*\<myhostname\>//' \
  824. -e '/^hosts:/s/\s*myhostname//' \
  825. -i $D${sysconfdir}/nsswitch.conf
  826. fi
  827. if ${@bb.utils.contains('PACKAGECONFIG', 'nss', 'true', 'false', d)}; then
  828. sed -e '/^passwd:/s#\s*systemd##' \
  829. -e '/^group:/s#\s*systemd##' \
  830. -e '/^shadow:/s#\s*systemd##' \
  831. -i $D${sysconfdir}/nsswitch.conf
  832. fi
  833. }
  834. PACKAGE_WRITE_DEPS += "qemu-native"
  835. pkg_postinst:udev-hwdb () {
  836. if test -n "$D"; then
  837. $INTERCEPT_DIR/postinst_intercept update_udev_hwdb ${PKG} mlprefix=${MLPREFIX} binprefix=${MLPREFIX} \
  838. rootlibexecdir="${nonarch_libdir}" PREFERRED_PROVIDER_udev="${PREFERRED_PROVIDER_udev}" base_bindir="${base_bindir}"
  839. else
  840. systemd-hwdb update
  841. fi
  842. }
  843. pkg_prerm:udev-hwdb () {
  844. rm -f $D${sysconfdir}/udev/hwdb.bin
  845. }
  846. require dlopen-deps.inc