blob: f9527f1236f8747563f9c7a47fdede935145240c [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
Vishwanatha Subbannafcf50762017-08-09 15:00:34 +053045EXTRA_OECONF = "YAML_PATH=${STAGING_DATADIR_NATIVE}/${PN}"
Lei YU80caf062017-07-20 15:25:28 +080046EXTRA_OECONF_append = "${@bb.utils.contains('OBMC_MACHINE_FEATURES', 'i2c-occ', ' --enable-i2c-occ', '', d)}"
47
Vishwanatha Subbanna79bc0a42017-08-22 21:34:43 +053048OCC_ENABLE = "enable"
49OCC_DISABLE = "disable"
50HOST_START = "start"
51HOST_STOP = "stop"
52
53# Ensure host-stop and host-start targets require needed occ states
54OCC_TMPL = "op-occ-{0}@.service"
55HOST_TGTFMT = "obmc-host-{1}@{2}.target"
56OCC_INSTFMT = "op-occ-{0}@{2}.service"
57HOST_OCC_FMT = "../${OCC_TMPL}:${HOST_TGTFMT}.requires/${OCC_INSTFMT}"
58SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_OCC_FMT', 'OCC_ENABLE', 'HOST_START', 'OBMC_HOST_INSTANCES')}"
59SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_OCC_FMT', 'OCC_DISABLE', 'HOST_STOP', 'OBMC_HOST_INSTANCES')}"
Andrew Geissler4cd9d0a2017-08-15 14:04:51 -050060
Edward A. Jamesbb022b92017-11-01 16:26:54 -050061# Set the occ disable service to be executed on host error
62HOST_ERROR_TARGETS = "crash timeout"
63
64OCC_DISABLE_TMPL = "op-occ-disable@.service"
65HOST_ERROR_TGTFMT = "obmc-host-{0}@{1}.target"
66OCC_DISABLE_INSTFMT = "op-occ-disable@{1}.service"
67HOST_ERROR_FMT = "../${OCC_DISABLE_TMPL}:${HOST_ERROR_TGTFMT}.wants/${OCC_DISABLE_INSTFMT}"
68
69SYSTEMD_LINK_${PN} += "${@compose_list(d, 'HOST_ERROR_FMT', 'HOST_ERROR_TARGETS', 'OBMC_HOST_INSTANCES')}"
70
Deepak Kodihallif98bd112017-03-24 07:44:16 -050071S = "${WORKDIR}/git"
Marri Devender Raob867da72017-12-29 06:01:11 -060072
73# Remove packages not required for native build
74DEPENDS_remove_class-native = " \
75 phosphor-logging \
76 obmc-targets \
77 systemd \
78 virtual/${PN}-config-native \
79 "
80# Remove packages not required for native SDK build
81DEPENDS_remove_class-nativesdk = " \
82 phosphor-logging \
83 obmc-targets \
84 systemd \
85 virtual/${PN}-config-native \
86 "
87
88# Provide a means to enable/disable install_error_yaml feature
89PACKAGECONFIG ??= "install_error_yaml"
90PACKAGECONFIG[install_error_yaml] = "\
91 --enable-install_error_yaml,\
92 --disable-install_error_yaml,\
93 ,\
94 "
95
96# Enable install_error_yaml during native and native SDK build
97PACKAGECONFIG_add_class-native = "install_error_yaml"
98PACKAGECONFIG_add_class-nativesdk = "install_error_yaml"
99
100# Disable install_error_yaml during target build
101PACKAGECONFIG_remove_class-target = "install_error_yaml"
102
103# Disable generating elog error header file during bitbake. Applications
104# should be using the elog header generated by phosphor-logging recipe
105EXTRA_OECONF += "--disable-gen_errors"
106
107BBCLASSEXTEND += "native nativesdk"
108