blob: a07f3ce2142369c29300219b6067a13935b6b72e [file] [log] [blame]
Deepak Kodihallif98bd112017-03-24 07:44:16 -05001SUMMARY = "OpenPOWER OCC controller"
2DESCRIPTION = "Application to contol the OpenPOWER On-Chip-Controller"
3HOMEPAGE = "https://github.com/openbmc/openpower-occ-control"
4PR = "r1"
5
Deepak Kodihalli615bdc12017-04-06 23:50:34 -05006inherit autotools \
7 pkgconfig \
Vishwanatha Subbanna359eee82017-05-04 09:45:29 -05008 obmc-phosphor-dbus-service \
Marri Devender Raobdaa6d22018-01-17 11:34:02 -06009 pythonnative \
10 phosphor-dbus-yaml
Deepak Kodihallif98bd112017-03-24 07:44:16 -050011
12require ${PN}.inc
13
Andrew Geissler4cd9d0a2017-08-15 14:04:51 -050014SRC_URI += "file://occ-active.sh"
15do_install_append() {
16 install -d ${D}${bindir}
17 install -m 0755 ${WORKDIR}/occ-active.sh \
18 ${D}${bindir}/occ-active.sh
19}
20
Vishwanatha Subbanna5f74f132017-07-07 02:55:58 -050021DBUS_SERVICE_${PN} += "org.open_power.OCC.Control.service"
Vishwanatha Subbanna79bc0a42017-08-22 21:34:43 +053022SYSTEMD_SERVICE_${PN} += "op-occ-enable@.service"
Andrew Geissler4cd9d0a2017-08-15 14:04:51 -050023SYSTEMD_SERVICE_${PN} += "op-occ-disable@.service"
Deepak Kodihallif98bd112017-03-24 07:44:16 -050024
Vishwanatha Subbannafcf50762017-08-09 15:00:34 +053025DEPENDS += "virtual/${PN}-config-native"
Deepak Kodihallif98bd112017-03-24 07:44:16 -050026DEPENDS += " \
27 sdbusplus \
28 sdbusplus-native \
29 phosphor-logging \
30 openpower-dbus-interfaces \
Vishwanatha Subbanna5f74f132017-07-07 02:55:58 -050031 phosphor-dbus-interfaces \
Deepak Kodihallif98bd112017-03-24 07:44:16 -050032 openpower-dbus-interfaces-native \
33 autoconf-archive-native \
Andrew Geissler4cd9d0a2017-08-15 14:04:51 -050034 obmc-targets \
35 systemd \
Deepak Kodihallif98bd112017-03-24 07:44:16 -050036 "
37
38RDEPENDS_${PN} += " \
39 sdbusplus \
40 phosphor-logging \
41 openpower-dbus-interfaces \
Vishwanatha Subbanna5f74f132017-07-07 02:55:58 -050042 phosphor-dbus-interfaces \
Deepak Kodihallif98bd112017-03-24 07:44:16 -050043 "
44
Matt Spinler25c9a632018-03-09 10:54:09 -060045EXTRA_OECONF = " \
46 YAML_PATH=${STAGING_DATADIR_NATIVE}/${PN} \
47 PS_DERATING_FACTOR=${POWER_SUPPLY_DERATING_FACTOR} \
48 "
Lei YU80caf062017-07-20 15:25:28 +080049EXTRA_OECONF_append = "${@bb.utils.contains('OBMC_MACHINE_FEATURES', 'i2c-occ', ' --enable-i2c-occ', '', d)}"
50
Vishwanatha Subbanna79bc0a42017-08-22 21:34:43 +053051OCC_ENABLE = "enable"
52OCC_DISABLE = "disable"
Andrew Geissler5c76e0c2018-03-27 13:56:26 -070053HOST_START = "startmin"
Vishwanatha Subbanna79bc0a42017-08-22 21:34:43 +053054HOST_STOP = "stop"
55
Andrew Geissler5c76e0c2018-03-27 13:56:26 -070056# Ensure host-stop and host-startmin targets require needed occ states
Vishwanatha Subbanna79bc0a42017-08-22 21:34:43 +053057OCC_TMPL = "op-occ-{0}@.service"
58HOST_TGTFMT = "obmc-host-{1}@{2}.target"
59OCC_INSTFMT = "op-occ-{0}@{2}.service"
60HOST_OCC_FMT = "../${OCC_TMPL}:${HOST_TGTFMT}.requires/${OCC_INSTFMT}"
61SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_OCC_FMT', 'OCC_ENABLE', 'HOST_START', 'OBMC_HOST_INSTANCES')}"
62SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_OCC_FMT', 'OCC_DISABLE', 'HOST_STOP', 'OBMC_HOST_INSTANCES')}"
Andrew Geissler4cd9d0a2017-08-15 14:04:51 -050063
Edward A. Jamesbb022b92017-11-01 16:26:54 -050064# Set the occ disable service to be executed on host error
65HOST_ERROR_TARGETS = "crash timeout"
66
67OCC_DISABLE_TMPL = "op-occ-disable@.service"
68HOST_ERROR_TGTFMT = "obmc-host-{0}@{1}.target"
69OCC_DISABLE_INSTFMT = "op-occ-disable@{1}.service"
70HOST_ERROR_FMT = "../${OCC_DISABLE_TMPL}:${HOST_ERROR_TGTFMT}.wants/${OCC_DISABLE_INSTFMT}"
71
72SYSTEMD_LINK_${PN} += "${@compose_list(d, 'HOST_ERROR_FMT', 'HOST_ERROR_TARGETS', 'OBMC_HOST_INSTANCES')}"
73
Deepak Kodihallif98bd112017-03-24 07:44:16 -050074S = "${WORKDIR}/git"
Marri Devender Raob867da72017-12-29 06:01:11 -060075
76# Remove packages not required for native build
77DEPENDS_remove_class-native = " \
78 phosphor-logging \
79 obmc-targets \
80 systemd \
81 virtual/${PN}-config-native \
82 "
83# Remove packages not required for native SDK build
84DEPENDS_remove_class-nativesdk = " \
85 phosphor-logging \
86 obmc-targets \
87 systemd \
88 virtual/${PN}-config-native \
89 "
90
91# Provide a means to enable/disable install_error_yaml feature
92PACKAGECONFIG ??= "install_error_yaml"
93PACKAGECONFIG[install_error_yaml] = "\
94 --enable-install_error_yaml,\
95 --disable-install_error_yaml,\
96 ,\
97 "
98
99# Enable install_error_yaml during native and native SDK build
100PACKAGECONFIG_add_class-native = "install_error_yaml"
101PACKAGECONFIG_add_class-nativesdk = "install_error_yaml"
102
103# Disable install_error_yaml during target build
104PACKAGECONFIG_remove_class-target = "install_error_yaml"
105
106# Disable generating elog error header file during bitbake. Applications
107# should be using the elog header generated by phosphor-logging recipe
108EXTRA_OECONF += "--disable-gen_errors"
109
110BBCLASSEXTEND += "native nativesdk"
111