blob: 33ebb4676373548d2b289a5fc9063796c04c83ce [file] [log] [blame]
Deepak Kodihallia9cbc7e2017-03-24 07:44:16 -05001SUMMARY = "OpenPOWER OCC controller"
Gunnar Mills4bb2a982018-06-13 15:54:55 -05002DESCRIPTION = "Application to control the OpenPOWER On-Chip-Controller"
Deepak Kodihallia9cbc7e2017-03-24 07:44:16 -05003HOMEPAGE = "https://github.com/openbmc/openpower-occ-control"
4PR = "r1"
Patrick Venture091dad12018-10-17 07:51:18 -07005PV = "1.0+git${SRCPV}"
Deepak Kodihallia9cbc7e2017-03-24 07:44:16 -05006
Deepak Kodihallib9c004f2017-04-06 23:50:34 -05007inherit autotools \
8 pkgconfig \
Vishwanatha Subbannaf434c6e2017-05-04 09:45:29 -05009 obmc-phosphor-dbus-service \
Marri Devender Raoab348f82018-01-17 11:34:02 -060010 pythonnative \
11 phosphor-dbus-yaml
Deepak Kodihallia9cbc7e2017-03-24 07:44:16 -050012
13require ${PN}.inc
14
Andrew Geisslereef81012017-08-15 14:04:51 -050015SRC_URI += "file://occ-active.sh"
16do_install_append() {
17 install -d ${D}${bindir}
18 install -m 0755 ${WORKDIR}/occ-active.sh \
19 ${D}${bindir}/occ-active.sh
20}
21
Vishwanatha Subbanna12767a52017-07-07 02:55:58 -050022DBUS_SERVICE_${PN} += "org.open_power.OCC.Control.service"
Vishwanatha Subbanna5890fa72017-08-22 21:34:43 +053023SYSTEMD_SERVICE_${PN} += "op-occ-enable@.service"
Andrew Geisslereef81012017-08-15 14:04:51 -050024SYSTEMD_SERVICE_${PN} += "op-occ-disable@.service"
Deepak Kodihallia9cbc7e2017-03-24 07:44:16 -050025
Vishwanatha Subbanna11631c72017-08-09 15:00:34 +053026DEPENDS += "virtual/${PN}-config-native"
Deepak Kodihallia9cbc7e2017-03-24 07:44:16 -050027DEPENDS += " \
28 sdbusplus \
29 sdbusplus-native \
30 phosphor-logging \
31 openpower-dbus-interfaces \
Vishwanatha Subbanna12767a52017-07-07 02:55:58 -050032 phosphor-dbus-interfaces \
Deepak Kodihallia9cbc7e2017-03-24 07:44:16 -050033 openpower-dbus-interfaces-native \
34 autoconf-archive-native \
Andrew Geisslereef81012017-08-15 14:04:51 -050035 systemd \
Deepak Kodihallia9cbc7e2017-03-24 07:44:16 -050036 "
37
Andrew Geissler72aea702020-02-10 08:19:46 -060038RDEPENDS_${PN} += "phosphor-state-manager-obmc-targets"
39
Matt Spinler7fcd43e2018-03-09 10:54:09 -060040EXTRA_OECONF = " \
41 YAML_PATH=${STAGING_DATADIR_NATIVE}/${PN} \
42 PS_DERATING_FACTOR=${POWER_SUPPLY_DERATING_FACTOR} \
43 "
Lei YU093d51d2017-07-20 15:25:28 +080044EXTRA_OECONF_append = "${@bb.utils.contains('OBMC_MACHINE_FEATURES', 'i2c-occ', ' --enable-i2c-occ', '', d)}"
45
Vishwanatha Subbanna5890fa72017-08-22 21:34:43 +053046OCC_ENABLE = "enable"
47OCC_DISABLE = "disable"
Andrew Geissler571ce442018-03-27 13:56:26 -070048HOST_START = "startmin"
Vishwanatha Subbanna5890fa72017-08-22 21:34:43 +053049HOST_STOP = "stop"
50
Andrew Geissler571ce442018-03-27 13:56:26 -070051# Ensure host-stop and host-startmin targets require needed occ states
Vishwanatha Subbanna5890fa72017-08-22 21:34:43 +053052OCC_TMPL = "op-occ-{0}@.service"
53HOST_TGTFMT = "obmc-host-{1}@{2}.target"
54OCC_INSTFMT = "op-occ-{0}@{2}.service"
55HOST_OCC_FMT = "../${OCC_TMPL}:${HOST_TGTFMT}.requires/${OCC_INSTFMT}"
56SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_OCC_FMT', 'OCC_ENABLE', 'HOST_START', 'OBMC_HOST_INSTANCES')}"
57SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_OCC_FMT', 'OCC_DISABLE', 'HOST_STOP', 'OBMC_HOST_INSTANCES')}"
Andrew Geisslereef81012017-08-15 14:04:51 -050058
Edward A. James6b2eb072017-11-01 16:26:54 -050059# Set the occ disable service to be executed on host error
60HOST_ERROR_TARGETS = "crash timeout"
61
62OCC_DISABLE_TMPL = "op-occ-disable@.service"
63HOST_ERROR_TGTFMT = "obmc-host-{0}@{1}.target"
64OCC_DISABLE_INSTFMT = "op-occ-disable@{1}.service"
65HOST_ERROR_FMT = "../${OCC_DISABLE_TMPL}:${HOST_ERROR_TGTFMT}.wants/${OCC_DISABLE_INSTFMT}"
66
67SYSTEMD_LINK_${PN} += "${@compose_list(d, 'HOST_ERROR_FMT', 'HOST_ERROR_TARGETS', 'OBMC_HOST_INSTANCES')}"
68
Deepak Kodihallia9cbc7e2017-03-24 07:44:16 -050069S = "${WORKDIR}/git"
Marri Devender Raod5f15f82017-12-29 06:01:11 -060070
71# Remove packages not required for native build
72DEPENDS_remove_class-native = " \
73 phosphor-logging \
Marri Devender Raod5f15f82017-12-29 06:01:11 -060074 systemd \
75 virtual/${PN}-config-native \
76 "
Andrew Geissler72aea702020-02-10 08:19:46 -060077RDEPENDS_${PN}_remove_class-native += "phosphor-state-manager-obmc-targets"
78
Marri Devender Raod5f15f82017-12-29 06:01:11 -060079# Remove packages not required for native SDK build
80DEPENDS_remove_class-nativesdk = " \
81 phosphor-logging \
Marri Devender Raod5f15f82017-12-29 06:01:11 -060082 systemd \
83 virtual/${PN}-config-native \
84 "
Andrew Geissler72aea702020-02-10 08:19:46 -060085RDEPENDS_${PN}_remove_class-nativesdk += "phosphor-state-manager-obmc-targets"
Marri Devender Raod5f15f82017-12-29 06:01:11 -060086
87# Provide a means to enable/disable install_error_yaml feature
88PACKAGECONFIG ??= "install_error_yaml"
89PACKAGECONFIG[install_error_yaml] = "\
90 --enable-install_error_yaml,\
91 --disable-install_error_yaml,\
92 ,\
93 "
94
95# Enable install_error_yaml during native and native SDK build
96PACKAGECONFIG_add_class-native = "install_error_yaml"
97PACKAGECONFIG_add_class-nativesdk = "install_error_yaml"
98
99# Disable install_error_yaml during target build
100PACKAGECONFIG_remove_class-target = "install_error_yaml"
101
Marri Devender Raod5f15f82017-12-29 06:01:11 -0600102BBCLASSEXTEND += "native nativesdk"