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