Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 1 | require systemd.inc |
| 2 | |
| 3 | PROVIDES = "udev" |
| 4 | |
| 5 | PE = "1" |
| 6 | |
| 7 | DEPENDS = "intltool-native gperf-native libcap util-linux" |
| 8 | |
| 9 | SECTION = "base/shell" |
| 10 | |
| 11 | inherit useradd pkgconfig meson perlnative update-rc.d update-alternatives qemu systemd gettext bash-completion manpages distro_features_check |
| 12 | |
| 13 | # As this recipe builds udev, respect systemd being in DISTRO_FEATURES so |
| 14 | # that we don't build both udev and systemd in world builds. |
| 15 | REQUIRED_DISTRO_FEATURES = "systemd" |
| 16 | |
| 17 | SRC_URI += "file://touchscreen.rules \ |
| 18 | file://00-create-volatile.conf \ |
| 19 | file://init \ |
| 20 | file://0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch \ |
| 21 | file://0002-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch \ |
| 22 | file://0003-implment-systemd-sysv-install-for-OE.patch \ |
| 23 | file://0004-rules-whitelist-hd-devices.patch \ |
| 24 | file://0005-rules-watch-metadata-changes-in-ide-devices.patch \ |
| 25 | file://0006-network-remove-redunant-link-name-in-message.patch \ |
| 26 | file://99-default.preset \ |
| 27 | " |
| 28 | |
| 29 | # patches needed by musl |
| 30 | SRC_URI += "${SRC_URI_MUSL}" |
| 31 | SRC_URI_MUSL = "file://0001-Use-getenv-when-secure-versions-are-not-available.patch \ |
| 32 | file://0002-don-t-use-glibc-specific-qsort_r.patch \ |
| 33 | file://0003-missing_type.h-add-__compare_fn_t-and-comparison_fn_.patch \ |
| 34 | file://0004-add-fallback-parse_printf_format-implementation.patch \ |
| 35 | file://0005-src-basic-missing.h-check-for-missing-strndupa.patch \ |
| 36 | file://0006-Include-netinet-if_ether.h.patch \ |
| 37 | file://0007-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not.patch \ |
| 38 | file://0008-add-missing-FTW_-macros-for-musl.patch \ |
| 39 | file://0009-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch \ |
| 40 | file://0010-fix-missing-of-__register_atfork-for-non-glibc-build.patch \ |
| 41 | file://0011-Use-uintmax_t-for-handling-rlim_t.patch \ |
| 42 | file://0012-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch \ |
| 43 | file://0014-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch \ |
| 44 | file://0015-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch \ |
| 45 | file://0016-Define-glibc-compatible-basename-for-non-glibc-syste.patch \ |
| 46 | file://0017-Do-not-disable-buffering-when-writing-to-oom_score_a.patch \ |
| 47 | file://0018-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch \ |
| 48 | file://0019-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch \ |
| 49 | file://0020-missing_type.h-add-__compar_d_fn_t-definition.patch \ |
| 50 | file://0021-avoid-redefinition-of-prctl_mm_map-structure.patch \ |
| 51 | file://0022-include-sys-wait.h-to-avoid-compile-failure.patch \ |
| 52 | file://0023-socket-util.h-include-string.h.patch \ |
| 53 | file://0024-test-json.c-define-M_PIl.patch \ |
| 54 | file://0025-fs-utilh-add-missing-sys-stat-include.patch \ |
| 55 | file://0001-do-not-disable-buffer-in-writing-files.patch \ |
| 56 | " |
| 57 | |
| 58 | PAM_PLUGINS = " \ |
| 59 | pam-plugin-unix \ |
| 60 | pam-plugin-loginuid \ |
| 61 | pam-plugin-keyinit \ |
| 62 | " |
| 63 | |
| 64 | PACKAGECONFIG ??= " \ |
| 65 | ${@bb.utils.filter('DISTRO_FEATURES', 'efi ldconfig pam selinux usrmerge polkit', d)} \ |
| 66 | ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \ |
| 67 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \ |
| 68 | acl \ |
| 69 | backlight \ |
| 70 | binfmt \ |
| 71 | gshadow \ |
| 72 | hibernate \ |
| 73 | hostnamed \ |
| 74 | ima \ |
| 75 | kmod \ |
| 76 | localed \ |
| 77 | logind \ |
| 78 | machined \ |
| 79 | myhostname \ |
| 80 | networkd \ |
| 81 | nss \ |
| 82 | nss-mymachines \ |
| 83 | nss-resolve \ |
| 84 | quotacheck \ |
| 85 | randomseed \ |
| 86 | resolved \ |
| 87 | smack \ |
| 88 | sysusers \ |
| 89 | timedated \ |
| 90 | timesyncd \ |
| 91 | utmp \ |
| 92 | vconsole \ |
| 93 | xz \ |
| 94 | " |
| 95 | |
| 96 | PACKAGECONFIG_remove_libc-musl = " \ |
| 97 | gshadow \ |
| 98 | localed \ |
| 99 | myhostname \ |
| 100 | nss \ |
| 101 | nss-mymachines \ |
| 102 | nss-resolve \ |
| 103 | resolved \ |
| 104 | smack \ |
| 105 | sysusers \ |
| 106 | utmp \ |
| 107 | " |
| 108 | |
| 109 | # Use the upstream systemd serial-getty@.service and rely on |
| 110 | # systemd-getty-generator instead of using the OE-core specific |
| 111 | # systemd-serialgetty.bb - not enabled by default. |
| 112 | PACKAGECONFIG[serial-getty-generator] = "" |
| 113 | |
| 114 | PACKAGECONFIG[acl] = "-Dacl=true,-Dacl=false,acl" |
| 115 | PACKAGECONFIG[audit] = "-Daudit=true,-Daudit=false,audit" |
| 116 | PACKAGECONFIG[backlight] = "-Dbacklight=true,-Dbacklight=false" |
| 117 | PACKAGECONFIG[binfmt] = "-Dbinfmt=true,-Dbinfmt=false" |
| 118 | PACKAGECONFIG[bzip2] = "-Dbzip2=true,-Dbzip2=false,bzip2" |
| 119 | PACKAGECONFIG[cgroupv2] = "-Ddefault-hierarchy=unified,-Ddefault-hierarchy=hybrid" |
| 120 | PACKAGECONFIG[coredump] = "-Dcoredump=true,-Dcoredump=false" |
| 121 | PACKAGECONFIG[cryptsetup] = "-Dlibcryptsetup=true,-Dlibcryptsetup=false,cryptsetup" |
| 122 | PACKAGECONFIG[dbus] = "-Ddbus=true,-Ddbus=false,dbus" |
| 123 | PACKAGECONFIG[efi] = "-Defi=true,-Defi=false" |
| 124 | PACKAGECONFIG[elfutils] = "-Delfutils=true,-Delfutils=false,elfutils" |
| 125 | PACKAGECONFIG[firstboot] = "-Dfirstboot=true,-Dfirstboot=false" |
| 126 | # Sign the journal for anti-tampering |
| 127 | PACKAGECONFIG[gcrypt] = "-Dgcrypt=true,-Dgcrypt=false,libgcrypt" |
| 128 | PACKAGECONFIG[gnutls] = "-Dgnutls=true,-Dgnutls=false,gnutls" |
| 129 | PACKAGECONFIG[gshadow] = "-Dgshadow=true,-Dgshadow=false" |
| 130 | PACKAGECONFIG[hibernate] = "-Dhibernate=true,-Dhibernate=false" |
| 131 | PACKAGECONFIG[hostnamed] = "-Dhostnamed=true,-Dhostnamed=false" |
| 132 | PACKAGECONFIG[ima] = "-Dima=true,-Dima=false" |
| 133 | # importd requires curl/xz/zlib/bzip2/gcrypt |
| 134 | PACKAGECONFIG[importd] = "-Dimportd=true,-Dimportd=false" |
| 135 | # Update NAT firewall rules |
| 136 | PACKAGECONFIG[iptc] = "-Dlibiptc=true,-Dlibiptc=false,iptables" |
| 137 | PACKAGECONFIG[journal-upload] = "-Dlibcurl=true,-Dlibcurl=false,curl" |
| 138 | PACKAGECONFIG[kmod] = "-Dkmod=true,-Dkmod=false,kmod" |
| 139 | PACKAGECONFIG[ldconfig] = "-Dldconfig=true,-Dldconfig=false" |
| 140 | PACKAGECONFIG[libidn] = "-Dlibidn=true,-Dlibidn=false,libidn" |
| 141 | PACKAGECONFIG[localed] = "-Dlocaled=true,-Dlocaled=false" |
| 142 | PACKAGECONFIG[logind] = "-Dlogind=true,-Dlogind=false" |
| 143 | PACKAGECONFIG[lz4] = "-Dlz4=true,-Dlz4=false,lz4" |
| 144 | PACKAGECONFIG[machined] = "-Dmachined=true,-Dmachined=false" |
| 145 | PACKAGECONFIG[manpages] = "-Dman=true,-Dman=false,libxslt-native xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native" |
| 146 | PACKAGECONFIG[microhttpd] = "-Dmicrohttpd=true,-Dmicrohttpd=false,libmicrohttpd" |
| 147 | PACKAGECONFIG[myhostname] = "-Dnss-myhostname=true,-Dnss-myhostname=false,,libnss-myhostname" |
| 148 | PACKAGECONFIG[networkd] = "-Dnetworkd=true,-Dnetworkd=false" |
| 149 | PACKAGECONFIG[nss] = "-Dnss-systemd=true,-Dnss-systemd=false" |
| 150 | PACKAGECONFIG[nss-mymachines] = "-Dnss-mymachines=true,-Dnss-mymachines=false" |
| 151 | PACKAGECONFIG[nss-resolve] = "-Dnss-resolve=true,-Dnss-resolve=false" |
| 152 | PACKAGECONFIG[openssl] = "-Dopenssl=true,-Dopenssl=false,openssl" |
| 153 | PACKAGECONFIG[pam] = "-Dpam=true,-Dpam=false,libpam,${PAM_PLUGINS}" |
| 154 | PACKAGECONFIG[pcre2] = "-Dpcre2=true,-Dpcre2=false,libpcre2" |
| 155 | PACKAGECONFIG[polkit] = "-Dpolkit=true,-Dpolkit=false" |
| 156 | PACKAGECONFIG[portabled] = "-Dportabled=true,-Dportabled=false" |
| 157 | PACKAGECONFIG[qrencode] = "-Dqrencode=true,-Dqrencode=false,qrencode" |
| 158 | PACKAGECONFIG[quotacheck] = "-Dquotacheck=true,-Dquotacheck=false" |
| 159 | PACKAGECONFIG[randomseed] = "-Drandomseed=true,-Drandomseed=false" |
| 160 | PACKAGECONFIG[resolved] = "-Dresolve=true,-Dresolve=false" |
| 161 | PACKAGECONFIG[rfkill] = "-Drfkill=true,-Drfkill=false" |
| 162 | # libseccomp is found in meta-security |
| 163 | PACKAGECONFIG[seccomp] = "-Dseccomp=true,-Dseccomp=false,libseccomp" |
| 164 | PACKAGECONFIG[selinux] = "-Dselinux=true,-Dselinux=false,libselinux,initscripts-sushell" |
| 165 | PACKAGECONFIG[smack] = "-Dsmack=true,-Dsmack=false" |
| 166 | PACKAGECONFIG[sysusers] = "-Dsysusers=true,-Dsysusers=false" |
| 167 | PACKAGECONFIG[time-epoch] = "-Dtime-epoch=0,," |
| 168 | PACKAGECONFIG[timedated] = "-Dtimedated=true,-Dtimedated=false" |
| 169 | PACKAGECONFIG[timesyncd] = "-Dtimesyncd=true,-Dtimesyncd=false" |
| 170 | PACKAGECONFIG[usrmerge] = "-Dsplit-usr=false,-Dsplit-usr=true" |
| 171 | PACKAGECONFIG[sbinmerge] = "-Dsplit-bin=false,-Dsplit-bin=true" |
| 172 | PACKAGECONFIG[utmp] = "-Dutmp=true,-Dutmp=false" |
| 173 | PACKAGECONFIG[valgrind] = "-DVALGRIND=1,,valgrind" |
| 174 | PACKAGECONFIG[vconsole] = "-Dvconsole=true,-Dvconsole=false,,${PN}-vconsole-setup" |
| 175 | # Verify keymaps on locale change |
| 176 | PACKAGECONFIG[xkbcommon] = "-Dxkbcommon=true,-Dxkbcommon=false,libxkbcommon" |
| 177 | PACKAGECONFIG[xz] = "-Dxz=true,-Dxz=false,xz" |
| 178 | PACKAGECONFIG[zlib] = "-Dzlib=true,-Dzlib=false,zlib" |
| 179 | |
| 180 | # Helper variables to clarify locations. This mirrors the logic in systemd's |
| 181 | # build system. |
| 182 | rootprefix ?= "${root_prefix}" |
| 183 | rootlibdir ?= "${base_libdir}" |
| 184 | rootlibexecdir = "${rootprefix}/lib" |
| 185 | |
| 186 | # This links udev statically with systemd helper library. |
| 187 | # Otherwise udev package would depend on systemd package (which has the needed shared library), |
| 188 | # and always pull it into images. |
| 189 | EXTRA_OEMESON += "-Dlink-udev-shared=false" |
| 190 | |
| 191 | EXTRA_OEMESON += "-Dnobody-user=nobody \ |
| 192 | -Dnobody-group=nobody \ |
| 193 | -Drootlibdir=${rootlibdir} \ |
| 194 | -Drootprefix=${rootprefix} \ |
| 195 | -Dsysvrcnd-path=${sysconfdir} \ |
| 196 | -Ddefault-locale=C \ |
| 197 | " |
| 198 | |
| 199 | # Hardcode target binary paths to avoid using paths from sysroot |
| 200 | EXTRA_OEMESON += "-Dkexec-path=${sbindir}/kexec \ |
| 201 | -Dkmod-path=${base_bindir}/kmod \ |
| 202 | -Dmount-path=${base_bindir}/mount \ |
| 203 | -Dquotacheck-path=${sbindir}/quotacheck \ |
| 204 | -Dquotaon-path=${sbindir}/quotaon \ |
| 205 | -Dsulogin-path=${base_sbindir}/sulogin \ |
| 206 | -Dumount-path=${base_bindir}/umount" |
| 207 | |
| 208 | do_install() { |
| 209 | meson_do_install |
| 210 | install -d ${D}/${base_sbindir} |
| 211 | if ${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', 'false', 'true', d)}; then |
| 212 | # Provided by a separate recipe |
| 213 | rm ${D}${systemd_unitdir}/system/serial-getty* -f |
| 214 | fi |
| 215 | |
| 216 | # Provide support for initramfs |
| 217 | [ ! -e ${D}/init ] && ln -s ${rootlibexecdir}/systemd/systemd ${D}/init |
| 218 | [ ! -e ${D}/${base_sbindir}/udevd ] && ln -s ${rootlibexecdir}/systemd/systemd-udevd ${D}/${base_sbindir}/udevd |
| 219 | |
| 220 | install -d ${D}${sysconfdir}/udev/rules.d/ |
| 221 | install -d ${D}${sysconfdir}/tmpfiles.d |
| 222 | install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/ |
| 223 | install -d ${D}${libdir}/pkgconfig |
| 224 | install -m 0644 ${B}/src/udev/udev.pc ${D}${libdir}/pkgconfig/ |
| 225 | |
| 226 | install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/ |
| 227 | |
| 228 | if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then |
| 229 | install -d ${D}${sysconfdir}/init.d |
| 230 | install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd |
| 231 | sed -i s%@UDEVD@%${rootlibexecdir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd |
| 232 | fi |
| 233 | |
| 234 | chown root:systemd-journal ${D}/${localstatedir}/log/journal |
| 235 | |
| 236 | # Delete journal README, as log can be symlinked inside volatile. |
| 237 | rm -f ${D}/${localstatedir}/log/README |
| 238 | |
| 239 | # journal-remote creates this at start |
| 240 | rm -rf ${D}/${localstatedir}/log/journal/remote |
| 241 | |
| 242 | install -d ${D}${systemd_unitdir}/system/graphical.target.wants |
| 243 | install -d ${D}${systemd_unitdir}/system/multi-user.target.wants |
| 244 | install -d ${D}${systemd_unitdir}/system/poweroff.target.wants |
| 245 | install -d ${D}${systemd_unitdir}/system/reboot.target.wants |
| 246 | install -d ${D}${systemd_unitdir}/system/rescue.target.wants |
| 247 | |
| 248 | # Create symlinks for systemd-update-utmp-runlevel.service |
| 249 | if ${@bb.utils.contains('PACKAGECONFIG', 'utmp', 'true', 'false', d)}; then |
| 250 | ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/graphical.target.wants/systemd-update-utmp-runlevel.service |
| 251 | ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/multi-user.target.wants/systemd-update-utmp-runlevel.service |
| 252 | ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/poweroff.target.wants/systemd-update-utmp-runlevel.service |
| 253 | ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/reboot.target.wants/systemd-update-utmp-runlevel.service |
| 254 | ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/rescue.target.wants/systemd-update-utmp-runlevel.service |
| 255 | fi |
| 256 | |
| 257 | # this file is needed to exist if networkd is disabled but timesyncd is still in use since timesyncd checks it |
| 258 | # for existence else it fails |
| 259 | if [ -s ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf ]; then |
| 260 | ${@bb.utils.contains('PACKAGECONFIG', 'networkd', ':', 'sed -i -e "\$ad /run/systemd/netif/links 0755 root root -" ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf', d)} |
| 261 | fi |
| 262 | if ! ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'true', 'false', d)}; then |
| 263 | echo 'L! ${sysconfdir}/resolv.conf - - - - ../run/systemd/resolve/resolv.conf' >>${D}${exec_prefix}/lib/tmpfiles.d/etc.conf |
| 264 | echo 'd /run/systemd/resolve 0755 root root -' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf |
| 265 | echo 'f /run/systemd/resolve/resolv.conf 0644 root root' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf |
| 266 | ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd |
| 267 | else |
| 268 | sed -i -e "s%^L! /etc/resolv.conf.*$%L! /etc/resolv.conf - - - - ../run/systemd/resolve/resolv.conf%g" ${D}${exec_prefix}/lib/tmpfiles.d/etc.conf |
| 269 | ln -s ../run/systemd/resolve/resolv.conf ${D}${sysconfdir}/resolv-conf.systemd |
| 270 | fi |
| 271 | install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${systemd_unitdir}/systemd-sysv-install |
| 272 | |
| 273 | # If polkit is setup fixup permissions and ownership |
| 274 | if ${@bb.utils.contains('PACKAGECONFIG', 'polkit', 'true', 'false', d)}; then |
| 275 | if [ -d ${D}${datadir}/polkit-1/rules.d ]; then |
| 276 | chmod 700 ${D}${datadir}/polkit-1/rules.d |
| 277 | chown polkitd:root ${D}${datadir}/polkit-1/rules.d |
| 278 | fi |
| 279 | fi |
| 280 | |
| 281 | # duplicate udevadm for postinst script |
| 282 | install -d ${D}${libexecdir} |
| 283 | ln ${D}${base_bindir}/udevadm ${D}${libexecdir}/${MLPREFIX}udevadm |
| 284 | |
| 285 | # install default policy for presets |
| 286 | # https://www.freedesktop.org/wiki/Software/systemd/Preset/#howto |
| 287 | install -Dm 0644 ${WORKDIR}/99-default.preset ${D}${systemd_unitdir}/system-preset/99-default.preset |
| 288 | } |
| 289 | |
| 290 | |
| 291 | python populate_packages_prepend (){ |
| 292 | systemdlibdir = d.getVar("rootlibdir") |
| 293 | do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True) |
| 294 | } |
| 295 | PACKAGES_DYNAMIC += "^lib(udev|systemd|nss).*" |
| 296 | |
| 297 | PACKAGES =+ "\ |
| 298 | ${PN}-gui \ |
| 299 | ${PN}-vconsole-setup \ |
| 300 | ${PN}-initramfs \ |
| 301 | ${PN}-analyze \ |
| 302 | ${PN}-kernel-install \ |
| 303 | ${PN}-rpm-macros \ |
| 304 | ${PN}-binfmt \ |
| 305 | ${PN}-zsh-completion \ |
| 306 | ${PN}-xorg-xinitrc \ |
| 307 | ${PN}-container \ |
| 308 | ${PN}-journal-gatewayd \ |
| 309 | ${PN}-journal-upload \ |
| 310 | ${PN}-journal-remote \ |
| 311 | ${PN}-extra-utils \ |
| 312 | " |
| 313 | |
| 314 | SUMMARY_${PN}-container = "Tools for containers and VMs" |
| 315 | DESCRIPTION_${PN}-container = "Systemd tools to spawn and manage containers and virtual machines." |
| 316 | |
| 317 | SUMMARY_${PN}-journal-gatewayd = "HTTP server for journal events" |
| 318 | 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." |
| 319 | |
| 320 | SUMMARY_${PN}-journal-upload = "Send journal messages over the network" |
| 321 | DESCRIPTION_${PN}-journal-upload = "systemd-journal-upload uploads journal entries to a specified URL." |
| 322 | |
| 323 | SUMMARY_${PN}-journal-remote = "Receive journal messages over the network" |
| 324 | DESCRIPTION_${PN}-journal-remote = "systemd-journal-remote is a command to receive serialized journal events and store them to journal files." |
| 325 | |
| 326 | SYSTEMD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'binfmt', '${PN}-binfmt', '', d)} \ |
| 327 | ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-gatewayd', '', d)} \ |
| 328 | ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-remote', '', d)} \ |
| 329 | ${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '${PN}-journal-upload', '', d)} \ |
| 330 | " |
| 331 | SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service" |
| 332 | |
| 333 | USERADD_PACKAGES = "${PN} ${PN}-extra-utils \ |
| 334 | ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-gateway', '', d)} \ |
| 335 | ${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '${PN}-journal-remote', '', d)} \ |
| 336 | ${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '${PN}-journal-upload', '', d)} \ |
| 337 | " |
| 338 | GROUPADD_PARAM_${PN} = "-r systemd-journal" |
| 339 | USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'coredump', '--system -d / -M --shell /bin/nologin systemd-coredump;', '', d)}" |
| 340 | USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'networkd', '--system -d / -M --shell /bin/nologin systemd-network;', '', d)}" |
| 341 | USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'polkit', '--system --no-create-home --user-group --home-dir ${sysconfdir}/polkit-1 polkitd;', '', d)}" |
| 342 | USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'resolved', '--system -d / -M --shell /bin/nologin systemd-resolve;', '', d)}" |
| 343 | USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'timesyncd', '--system -d / -M --shell /bin/nologin systemd-timesync;', '', d)}" |
| 344 | USERADD_PARAM_${PN}-extra-utils = "--system -d / -M --shell /bin/nologin systemd-bus-proxy" |
| 345 | USERADD_PARAM_${PN}-journal-gateway = "--system -d / -M --shell /bin/nologin systemd-journal-gateway" |
| 346 | USERADD_PARAM_${PN}-journal-remote = "--system -d / -M --shell /bin/nologin systemd-journal-remote" |
| 347 | USERADD_PARAM_${PN}-journal-upload = "--system -d / -M --shell /bin/nologin systemd-journal-upload" |
| 348 | |
| 349 | FILES_${PN}-analyze = "${bindir}/systemd-analyze" |
| 350 | |
| 351 | FILES_${PN}-initramfs = "/init" |
| 352 | RDEPENDS_${PN}-initramfs = "${PN}" |
| 353 | |
| 354 | FILES_${PN}-gui = "${bindir}/systemadm" |
| 355 | |
| 356 | FILES_${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \ |
| 357 | ${systemd_unitdir}/system/systemd-vconsole-setup.service \ |
| 358 | ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service" |
| 359 | |
| 360 | RDEPENDS_${PN}-kernel-install += "bash" |
| 361 | FILES_${PN}-kernel-install = "${bindir}/kernel-install \ |
| 362 | ${sysconfdir}/kernel/ \ |
| 363 | ${exec_prefix}/lib/kernel \ |
| 364 | " |
| 365 | FILES_${PN}-rpm-macros = "${exec_prefix}/lib/rpm \ |
| 366 | " |
| 367 | |
| 368 | FILES_${PN}-xorg-xinitrc = "${sysconfdir}/X11/xinit/xinitrc.d/*" |
| 369 | |
| 370 | FILES_${PN}-zsh-completion = "${datadir}/zsh/site-functions" |
| 371 | |
| 372 | FILES_${PN}-binfmt = "${sysconfdir}/binfmt.d/ \ |
| 373 | ${exec_prefix}/lib/binfmt.d \ |
| 374 | ${rootlibexecdir}/systemd/systemd-binfmt \ |
| 375 | ${systemd_unitdir}/system/proc-sys-fs-binfmt_misc.* \ |
| 376 | ${systemd_unitdir}/system/systemd-binfmt.service" |
| 377 | RRECOMMENDS_${PN}-binfmt = "kernel-module-binfmt-misc" |
| 378 | |
| 379 | RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts kbd-keymaps" |
| 380 | |
| 381 | |
| 382 | FILES_${PN}-journal-gatewayd = "${rootlibexecdir}/systemd/systemd-journal-gatewayd \ |
| 383 | ${systemd_system_unitdir}/systemd-journal-gatewayd.service \ |
| 384 | ${systemd_system_unitdir}/systemd-journal-gatewayd.socket \ |
| 385 | ${systemd_system_unitdir}/sockets.target.wants/systemd-journal-gatewayd.socket \ |
| 386 | ${datadir}/systemd/gatewayd/browse.html \ |
| 387 | " |
| 388 | SYSTEMD_SERVICE_${PN}-journal-gatewayd = "systemd-journal-gatewayd.socket" |
| 389 | |
| 390 | FILES_${PN}-journal-upload = "${rootlibexecdir}/systemd/systemd-journal-upload \ |
| 391 | ${systemd_system_unitdir}/systemd-journal-upload.service \ |
| 392 | ${sysconfdir}/systemd/journal-upload.conf \ |
| 393 | " |
| 394 | SYSTEMD_SERVICE_${PN}-journal-upload = "systemd-journal-upload.service" |
| 395 | |
| 396 | FILES_${PN}-journal-remote = "${rootlibexecdir}/systemd/systemd-journal-remote \ |
| 397 | ${sysconfdir}/systemd/journal-remote.conf \ |
| 398 | ${systemd_system_unitdir}/systemd-journal-remote.service \ |
| 399 | ${systemd_system_unitdir}/systemd-journal-remote.socket \ |
| 400 | " |
| 401 | SYSTEMD_SERVICE_${PN}-remote = "systemd-journal-remote.socket" |
| 402 | |
| 403 | |
| 404 | FILES_${PN}-container = "${sysconfdir}/dbus-1/system.d/org.freedesktop.import1.conf \ |
| 405 | ${sysconfdir}/dbus-1/system.d/org.freedesktop.machine1.conf \ |
| 406 | ${sysconfdir}/systemd/system/multi-user.target.wants/machines.target \ |
| 407 | ${base_bindir}/machinectl \ |
| 408 | ${bindir}/systemd-nspawn \ |
| 409 | ${nonarch_libdir}/systemd/import-pubring.gpg \ |
| 410 | ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.import1.busname \ |
| 411 | ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.machine1.busname \ |
| 412 | ${systemd_system_unitdir}/local-fs.target.wants/var-lib-machines.mount \ |
| 413 | ${systemd_system_unitdir}/machines.target.wants/var-lib-machines.mount \ |
| 414 | ${systemd_system_unitdir}/remote-fs.target.wants/var-lib-machines.mount \ |
| 415 | ${systemd_system_unitdir}/machine.slice \ |
| 416 | ${systemd_system_unitdir}/machines.target \ |
| 417 | ${systemd_system_unitdir}/org.freedesktop.import1.busname \ |
| 418 | ${systemd_system_unitdir}/org.freedesktop.machine1.busname \ |
| 419 | ${systemd_system_unitdir}/systemd-importd.service \ |
| 420 | ${systemd_system_unitdir}/systemd-machined.service \ |
| 421 | ${systemd_system_unitdir}/dbus-org.freedesktop.machine1.service \ |
| 422 | ${systemd_system_unitdir}/var-lib-machines.mount \ |
| 423 | ${rootlibexecdir}/systemd/systemd-import \ |
| 424 | ${rootlibexecdir}/systemd/systemd-importd \ |
| 425 | ${rootlibexecdir}/systemd/systemd-machined \ |
| 426 | ${rootlibexecdir}/systemd/systemd-pull \ |
| 427 | ${exec_prefix}/lib/tmpfiles.d/systemd-nspawn.conf \ |
| 428 | ${systemd_system_unitdir}/systemd-nspawn@.service \ |
| 429 | ${libdir}/libnss_mymachines.so.2 \ |
| 430 | ${datadir}/dbus-1/system-services/org.freedesktop.import1.service \ |
| 431 | ${datadir}/dbus-1/system-services/org.freedesktop.machine1.service \ |
| 432 | ${datadir}/dbus-1/system.d/org.freedesktop.import1.conf \ |
| 433 | ${datadir}/dbus-1/system.d/org.freedesktop.machine1.conf \ |
| 434 | ${datadir}/polkit-1/actions/org.freedesktop.import1.policy \ |
| 435 | ${datadir}/polkit-1/actions/org.freedesktop.machine1.policy \ |
| 436 | " |
| 437 | |
| 438 | RRECOMMENDS_${PN}-container += "\ |
| 439 | ${PN}-journal-upload \ |
| 440 | ${PN}-journal-remote \ |
| 441 | ${PN}-journal-gatewayd \ |
| 442 | " |
| 443 | |
| 444 | FILES_${PN}-extra-utils = "\ |
| 445 | ${base_bindir}/systemd-escape \ |
| 446 | ${base_bindir}/systemd-inhibit \ |
| 447 | ${bindir}/systemd-detect-virt \ |
| 448 | ${bindir}/systemd-path \ |
| 449 | ${bindir}/systemd-run \ |
| 450 | ${bindir}/systemd-cat \ |
| 451 | ${bindir}/systemd-delta \ |
| 452 | ${bindir}/systemd-cgls \ |
| 453 | ${bindir}/systemd-cgtop \ |
| 454 | ${bindir}/systemd-stdio-bridge \ |
| 455 | ${base_bindir}/systemd-ask-password \ |
| 456 | ${base_bindir}/systemd-tty-ask-password-agent \ |
| 457 | ${systemd_unitdir}/system/systemd-ask-password-console.path \ |
| 458 | ${systemd_unitdir}/system/systemd-ask-password-console.service \ |
| 459 | ${systemd_unitdir}/system/systemd-ask-password-wall.path \ |
| 460 | ${systemd_unitdir}/system/systemd-ask-password-wall.service \ |
| 461 | ${systemd_unitdir}/system/sysinit.target.wants/systemd-ask-password-console.path \ |
| 462 | ${systemd_unitdir}/system/sysinit.target.wants/systemd-ask-password-wall.path \ |
| 463 | ${systemd_unitdir}/system/multi-user.target.wants/systemd-ask-password-wall.path \ |
| 464 | ${rootlibexecdir}/systemd/systemd-resolve-host \ |
| 465 | ${rootlibexecdir}/systemd/systemd-ac-power \ |
| 466 | ${rootlibexecdir}/systemd/systemd-activate \ |
| 467 | ${rootlibexecdir}/systemd/systemd-bus-proxyd \ |
| 468 | ${systemd_unitdir}/system/systemd-bus-proxyd.service \ |
| 469 | ${systemd_unitdir}/system/systemd-bus-proxyd.socket \ |
| 470 | ${rootlibexecdir}/systemd/systemd-socket-proxyd \ |
| 471 | ${rootlibexecdir}/systemd/systemd-reply-password \ |
| 472 | ${rootlibexecdir}/systemd/systemd-sleep \ |
| 473 | ${rootlibexecdir}/systemd/system-sleep \ |
| 474 | ${systemd_unitdir}/system/systemd-hibernate.service \ |
| 475 | ${systemd_unitdir}/system/systemd-hybrid-sleep.service \ |
| 476 | ${systemd_unitdir}/system/systemd-suspend.service \ |
| 477 | ${systemd_unitdir}/system/sleep.target \ |
| 478 | ${rootlibexecdir}/systemd/systemd-initctl \ |
| 479 | ${systemd_unitdir}/system/systemd-initctl.service \ |
| 480 | ${systemd_unitdir}/system/systemd-initctl.socket \ |
| 481 | ${systemd_unitdir}/system/sockets.target.wants/systemd-initctl.socket \ |
| 482 | ${rootlibexecdir}/systemd/system-generators/systemd-gpt-auto-generator \ |
| 483 | ${rootlibexecdir}/systemd/systemd-cgroups-agent \ |
| 484 | " |
| 485 | |
| 486 | CONFFILES_${PN} = "${sysconfdir}/systemd/coredump.conf \ |
| 487 | ${sysconfdir}/systemd/journald.conf \ |
| 488 | ${sysconfdir}/systemd/logind.conf \ |
| 489 | ${sysconfdir}/systemd/system.conf \ |
| 490 | ${sysconfdir}/systemd/user.conf \ |
| 491 | ${sysconfdir}/systemd/resolved.conf \ |
| 492 | ${sysconfdir}/systemd/timesyncd.conf \ |
| 493 | " |
| 494 | |
| 495 | FILES_${PN} = " ${base_bindir}/* \ |
| 496 | ${base_sbindir}/shutdown \ |
| 497 | ${base_sbindir}/halt \ |
| 498 | ${base_sbindir}/poweroff \ |
| 499 | ${base_sbindir}/runlevel \ |
| 500 | ${base_sbindir}/telinit \ |
| 501 | ${base_sbindir}/resolvconf \ |
| 502 | ${base_sbindir}/reboot \ |
| 503 | ${base_sbindir}/init \ |
| 504 | ${datadir}/dbus-1/services \ |
| 505 | ${datadir}/dbus-1/system-services \ |
| 506 | ${datadir}/polkit-1 \ |
| 507 | ${datadir}/${BPN} \ |
| 508 | ${datadir}/factory \ |
| 509 | ${sysconfdir}/dbus-1/ \ |
| 510 | ${sysconfdir}/modules-load.d/ \ |
| 511 | ${sysconfdir}/pam.d/ \ |
| 512 | ${sysconfdir}/sysctl.d/ \ |
| 513 | ${sysconfdir}/systemd/ \ |
| 514 | ${sysconfdir}/tmpfiles.d/ \ |
| 515 | ${sysconfdir}/xdg/ \ |
| 516 | ${sysconfdir}/init.d/README \ |
| 517 | ${sysconfdir}/resolv-conf.systemd \ |
| 518 | ${rootlibexecdir}/systemd/* \ |
| 519 | ${systemd_unitdir}/* \ |
| 520 | ${base_libdir}/security/*.so \ |
| 521 | /cgroup \ |
| 522 | ${bindir}/systemd* \ |
| 523 | ${bindir}/busctl \ |
| 524 | ${bindir}/coredumpctl \ |
| 525 | ${bindir}/localectl \ |
| 526 | ${bindir}/hostnamectl \ |
| 527 | ${bindir}/resolvectl \ |
| 528 | ${bindir}/timedatectl \ |
| 529 | ${bindir}/bootctl \ |
| 530 | ${bindir}/kernel-install \ |
| 531 | ${exec_prefix}/lib/tmpfiles.d/*.conf \ |
| 532 | ${exec_prefix}/lib/systemd \ |
| 533 | ${exec_prefix}/lib/modules-load.d \ |
| 534 | ${exec_prefix}/lib/sysctl.d \ |
| 535 | ${exec_prefix}/lib/sysusers.d \ |
| 536 | ${exec_prefix}/lib/environment.d \ |
| 537 | ${localstatedir} \ |
| 538 | ${nonarch_base_libdir}/udev/rules.d/70-uaccess.rules \ |
| 539 | ${nonarch_base_libdir}/udev/rules.d/71-seat.rules \ |
| 540 | ${nonarch_base_libdir}/udev/rules.d/73-seat-late.rules \ |
| 541 | ${nonarch_base_libdir}/udev/rules.d/99-systemd.rules \ |
| 542 | ${nonarch_base_libdir}/modprobe.d/systemd.conf \ |
| 543 | ${datadir}/dbus-1/system.d/org.freedesktop.timedate1.conf \ |
| 544 | ${datadir}/dbus-1/system.d/org.freedesktop.locale1.conf \ |
| 545 | ${datadir}/dbus-1/system.d/org.freedesktop.network1.conf \ |
| 546 | ${datadir}/dbus-1/system.d/org.freedesktop.resolve1.conf \ |
| 547 | ${datadir}/dbus-1/system.d/org.freedesktop.systemd1.conf \ |
| 548 | ${datadir}/dbus-1/system.d/org.freedesktop.hostname1.conf \ |
| 549 | ${datadir}/dbus-1/system.d/org.freedesktop.login1.conf \ |
| 550 | ${datadir}/dbus-1/system.d/org.freedesktop.timesync1.conf \ |
| 551 | ${datadir}/dbus-1/system.d/org.freedesktop.portable1.conf \ |
| 552 | " |
| 553 | |
| 554 | FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd" |
| 555 | |
| 556 | RDEPENDS_${PN} += "kmod dbus util-linux-mount util-linux-umount udev (= ${EXTENDPKGV}) util-linux-agetty util-linux-fsck" |
| 557 | RDEPENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', '', 'systemd-serialgetty', d)}" |
| 558 | RDEPENDS_${PN} += "volatile-binds update-rc.d" |
| 559 | |
| 560 | RRECOMMENDS_${PN} += "systemd-extra-utils \ |
| 561 | systemd-compat-units udev-hwdb \ |
| 562 | e2fsprogs-e2fsck \ |
| 563 | kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \ |
| 564 | os-release \ |
| 565 | systemd-conf \ |
| 566 | " |
| 567 | |
| 568 | INSANE_SKIP_${PN} += "dev-so libdir" |
| 569 | INSANE_SKIP_${PN}-dbg += "libdir" |
| 570 | INSANE_SKIP_${PN}-doc += " libdir" |
| 571 | |
| 572 | PACKAGES =+ "udev udev-hwdb" |
| 573 | |
| 574 | RPROVIDES_udev = "hotplug" |
| 575 | |
| 576 | RDEPENDS_udev-hwdb += "udev" |
| 577 | |
| 578 | FILES_udev += "${base_sbindir}/udevd \ |
| 579 | ${rootlibexecdir}/systemd/network/99-default.link \ |
| 580 | ${rootlibexecdir}/systemd/systemd-udevd \ |
| 581 | ${rootlibexecdir}/udev/accelerometer \ |
| 582 | ${rootlibexecdir}/udev/ata_id \ |
| 583 | ${rootlibexecdir}/udev/cdrom_id \ |
| 584 | ${rootlibexecdir}/udev/collect \ |
| 585 | ${rootlibexecdir}/udev/findkeyboards \ |
| 586 | ${rootlibexecdir}/udev/keyboard-force-release.sh \ |
| 587 | ${rootlibexecdir}/udev/keymap \ |
| 588 | ${rootlibexecdir}/udev/mtd_probe \ |
| 589 | ${rootlibexecdir}/udev/scsi_id \ |
| 590 | ${rootlibexecdir}/udev/v4l_id \ |
| 591 | ${rootlibexecdir}/udev/keymaps \ |
| 592 | ${rootlibexecdir}/udev/rules.d/*.rules \ |
| 593 | ${sysconfdir}/udev \ |
| 594 | ${sysconfdir}/init.d/systemd-udevd \ |
| 595 | ${systemd_unitdir}/system/*udev* \ |
| 596 | ${systemd_unitdir}/system/*.wants/*udev* \ |
| 597 | ${base_bindir}/udevadm \ |
| 598 | ${libexecdir}/${MLPREFIX}udevadm \ |
| 599 | ${datadir}/bash-completion/completions/udevadm \ |
| 600 | " |
| 601 | |
| 602 | FILES_udev-hwdb = "${rootlibexecdir}/udev/hwdb.d" |
| 603 | |
| 604 | INITSCRIPT_PACKAGES = "udev" |
| 605 | INITSCRIPT_NAME_udev = "systemd-udevd" |
| 606 | INITSCRIPT_PARAMS_udev = "start 03 S ." |
| 607 | |
| 608 | python __anonymous() { |
| 609 | if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): |
| 610 | d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") |
| 611 | } |
| 612 | |
| 613 | ALTERNATIVE_${PN} = "halt reboot shutdown poweroff runlevel resolv-conf" |
| 614 | |
| 615 | ALTERNATIVE_TARGET[resolv-conf] = "${sysconfdir}/resolv-conf.systemd" |
| 616 | ALTERNATIVE_LINK_NAME[resolv-conf] = "${sysconfdir}/resolv.conf" |
| 617 | ALTERNATIVE_PRIORITY[resolv-conf] ?= "50" |
| 618 | |
| 619 | ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl" |
| 620 | ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt" |
| 621 | ALTERNATIVE_PRIORITY[halt] ?= "300" |
| 622 | |
| 623 | ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl" |
| 624 | ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot" |
| 625 | ALTERNATIVE_PRIORITY[reboot] ?= "300" |
| 626 | |
| 627 | ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl" |
| 628 | ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown" |
| 629 | ALTERNATIVE_PRIORITY[shutdown] ?= "300" |
| 630 | |
| 631 | ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl" |
| 632 | ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff" |
| 633 | ALTERNATIVE_PRIORITY[poweroff] ?= "300" |
| 634 | |
| 635 | ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl" |
| 636 | ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel" |
| 637 | ALTERNATIVE_PRIORITY[runlevel] ?= "300" |
| 638 | |
| 639 | pkg_postinst_${PN} () { |
| 640 | sed -e '/^hosts:/s/\s*\<myhostname\>//' \ |
| 641 | -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \ |
| 642 | -i $D${sysconfdir}/nsswitch.conf |
| 643 | } |
| 644 | |
| 645 | pkg_prerm_${PN} () { |
| 646 | sed -e '/^hosts:/s/\s*\<myhostname\>//' \ |
| 647 | -e '/^hosts:/s/\s*myhostname//' \ |
| 648 | -i $D${sysconfdir}/nsswitch.conf |
| 649 | } |
| 650 | |
| 651 | PACKAGE_WRITE_DEPS += "qemu-native" |
| 652 | pkg_postinst_udev-hwdb () { |
| 653 | if test -n "$D"; then |
| 654 | $INTERCEPT_DIR/postinst_intercept update_udev_hwdb ${PKG} mlprefix=${MLPREFIX} binprefix=${MLPREFIX} |
| 655 | else |
| 656 | udevadm hwdb --update |
| 657 | fi |
| 658 | } |
| 659 | |
| 660 | pkg_prerm_udev-hwdb () { |
| 661 | rm -f $D${sysconfdir}/udev/hwdb.bin |
| 662 | } |