blob: 21d44381d4c1982ec95afbf7f377902bc848dc35 [file] [log] [blame]
Deepak Kodihallif98bd112017-03-24 07:44:16 -05001SUMMARY = "OpenPOWER OCC controller"
Gunnar Mills8b8ba532018-06-13 15:54:55 -05002DESCRIPTION = "Application to control the OpenPOWER On-Chip-Controller"
Deepak Kodihallif98bd112017-03-24 07:44:16 -05003HOMEPAGE = "https://github.com/openbmc/openpower-occ-control"
4PR = "r1"
Patrick Venturef30336b2018-10-17 07:51:18 -07005PV = "1.0+git${SRCPV}"
Deepak Kodihallif98bd112017-03-24 07:44:16 -05006
Deepak Kodihalli615bdc12017-04-06 23:50:34 -05007inherit autotools \
8 pkgconfig \
Vishwanatha Subbanna359eee82017-05-04 09:45:29 -05009 obmc-phosphor-dbus-service \
Marri Devender Raobdaa6d22018-01-17 11:34:02 -060010 pythonnative \
11 phosphor-dbus-yaml
Deepak Kodihallif98bd112017-03-24 07:44:16 -050012
13require ${PN}.inc
14
Andrew Geissler4cd9d0a2017-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 Subbanna5f74f132017-07-07 02:55:58 -050022DBUS_SERVICE_${PN} += "org.open_power.OCC.Control.service"
Vishwanatha Subbanna79bc0a42017-08-22 21:34:43 +053023SYSTEMD_SERVICE_${PN} += "op-occ-enable@.service"
Andrew Geissler4cd9d0a2017-08-15 14:04:51 -050024SYSTEMD_SERVICE_${PN} += "op-occ-disable@.service"
Deepak Kodihallif98bd112017-03-24 07:44:16 -050025
Vishwanatha Subbannafcf50762017-08-09 15:00:34 +053026DEPENDS += "virtual/${PN}-config-native"
Deepak Kodihallif98bd112017-03-24 07:44:16 -050027DEPENDS += " \
28 sdbusplus \
29 sdbusplus-native \
30 phosphor-logging \
31 openpower-dbus-interfaces \
Vishwanatha Subbanna5f74f132017-07-07 02:55:58 -050032 phosphor-dbus-interfaces \
Deepak Kodihallif98bd112017-03-24 07:44:16 -050033 openpower-dbus-interfaces-native \
34 autoconf-archive-native \
Andrew Geissler4cd9d0a2017-08-15 14:04:51 -050035 obmc-targets \
36 systemd \
Deepak Kodihallif98bd112017-03-24 07:44:16 -050037 "
38
Matt Spinler25c9a632018-03-09 10:54:09 -060039EXTRA_OECONF = " \
40 YAML_PATH=${STAGING_DATADIR_NATIVE}/${PN} \
41 PS_DERATING_FACTOR=${POWER_SUPPLY_DERATING_FACTOR} \
42 "
Lei YU80caf062017-07-20 15:25:28 +080043EXTRA_OECONF_append = "${@bb.utils.contains('OBMC_MACHINE_FEATURES', 'i2c-occ', ' --enable-i2c-occ', '', d)}"
44
Vishwanatha Subbanna79bc0a42017-08-22 21:34:43 +053045OCC_ENABLE = "enable"
46OCC_DISABLE = "disable"
Andrew Geissler5c76e0c2018-03-27 13:56:26 -070047HOST_START = "startmin"
Vishwanatha Subbanna79bc0a42017-08-22 21:34:43 +053048HOST_STOP = "stop"
49
Andrew Geissler5c76e0c2018-03-27 13:56:26 -070050# Ensure host-stop and host-startmin targets require needed occ states
Vishwanatha Subbanna79bc0a42017-08-22 21:34:43 +053051OCC_TMPL = "op-occ-{0}@.service"
52HOST_TGTFMT = "obmc-host-{1}@{2}.target"
53OCC_INSTFMT = "op-occ-{0}@{2}.service"
54HOST_OCC_FMT = "../${OCC_TMPL}:${HOST_TGTFMT}.requires/${OCC_INSTFMT}"
55SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_OCC_FMT', 'OCC_ENABLE', 'HOST_START', 'OBMC_HOST_INSTANCES')}"
56SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_OCC_FMT', 'OCC_DISABLE', 'HOST_STOP', 'OBMC_HOST_INSTANCES')}"
Andrew Geissler4cd9d0a2017-08-15 14:04:51 -050057
Edward A. Jamesbb022b92017-11-01 16:26:54 -050058# Set the occ disable service to be executed on host error
59HOST_ERROR_TARGETS = "crash timeout"
60
61OCC_DISABLE_TMPL = "op-occ-disable@.service"
62HOST_ERROR_TGTFMT = "obmc-host-{0}@{1}.target"
63OCC_DISABLE_INSTFMT = "op-occ-disable@{1}.service"
64HOST_ERROR_FMT = "../${OCC_DISABLE_TMPL}:${HOST_ERROR_TGTFMT}.wants/${OCC_DISABLE_INSTFMT}"
65
66SYSTEMD_LINK_${PN} += "${@compose_list(d, 'HOST_ERROR_FMT', 'HOST_ERROR_TARGETS', 'OBMC_HOST_INSTANCES')}"
67
Deepak Kodihallif98bd112017-03-24 07:44:16 -050068S = "${WORKDIR}/git"
Marri Devender Raob867da72017-12-29 06:01:11 -060069
70# Remove packages not required for native build
71DEPENDS_remove_class-native = " \
72 phosphor-logging \
73 obmc-targets \
74 systemd \
75 virtual/${PN}-config-native \
76 "
77# Remove packages not required for native SDK build
78DEPENDS_remove_class-nativesdk = " \
79 phosphor-logging \
80 obmc-targets \
81 systemd \
82 virtual/${PN}-config-native \
83 "
84
85# Provide a means to enable/disable install_error_yaml feature
86PACKAGECONFIG ??= "install_error_yaml"
87PACKAGECONFIG[install_error_yaml] = "\
88 --enable-install_error_yaml,\
89 --disable-install_error_yaml,\
90 ,\
91 "
92
93# Enable install_error_yaml during native and native SDK build
94PACKAGECONFIG_add_class-native = "install_error_yaml"
95PACKAGECONFIG_add_class-nativesdk = "install_error_yaml"
96
97# Disable install_error_yaml during target build
98PACKAGECONFIG_remove_class-target = "install_error_yaml"
99
Marri Devender Raob867da72017-12-29 06:01:11 -0600100BBCLASSEXTEND += "native nativesdk"
101