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