blob: cc0b56c6446667397a41b75cb79c4271de6187a4 [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 \
Vishwanatha Subbanna5f74f132017-07-07 02:55:58 -050031 phosphor-dbus-interfaces \
Deepak Kodihallif98bd112017-03-24 07:44:16 -050032 autoconf-archive-native \
Andrew Geissler4cd9d0a2017-08-15 14:04:51 -050033 systemd \
Deepak Kodihallif98bd112017-03-24 07:44:16 -050034 "
35
Andrew Geissler5c459852020-02-10 08:19:46 -060036RDEPENDS_${PN} += "phosphor-state-manager-obmc-targets"
37
Matt Spinler25c9a632018-03-09 10:54:09 -060038EXTRA_OECONF = " \
39 YAML_PATH=${STAGING_DATADIR_NATIVE}/${PN} \
40 PS_DERATING_FACTOR=${POWER_SUPPLY_DERATING_FACTOR} \
41 "
Lei YU80caf062017-07-20 15:25:28 +080042EXTRA_OECONF_append = "${@bb.utils.contains('OBMC_MACHINE_FEATURES', 'i2c-occ', ' --enable-i2c-occ', '', d)}"
43
Vishwanatha Subbanna79bc0a42017-08-22 21:34:43 +053044OCC_ENABLE = "enable"
45OCC_DISABLE = "disable"
Andrew Geissler5c76e0c2018-03-27 13:56:26 -070046HOST_START = "startmin"
Vishwanatha Subbanna79bc0a42017-08-22 21:34:43 +053047HOST_STOP = "stop"
48
Andrew Geissler5c76e0c2018-03-27 13:56:26 -070049# Ensure host-stop and host-startmin targets require needed occ states
Vishwanatha Subbanna79bc0a42017-08-22 21:34:43 +053050OCC_TMPL = "op-occ-{0}@.service"
51HOST_TGTFMT = "obmc-host-{1}@{2}.target"
52OCC_INSTFMT = "op-occ-{0}@{2}.service"
53HOST_OCC_FMT = "../${OCC_TMPL}:${HOST_TGTFMT}.requires/${OCC_INSTFMT}"
54SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_OCC_FMT', 'OCC_ENABLE', 'HOST_START', 'OBMC_HOST_INSTANCES')}"
55SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_OCC_FMT', 'OCC_DISABLE', 'HOST_STOP', 'OBMC_HOST_INSTANCES')}"
Andrew Geissler4cd9d0a2017-08-15 14:04:51 -050056
Edward A. Jamesbb022b92017-11-01 16:26:54 -050057# Set the occ disable service to be executed on host error
58HOST_ERROR_TARGETS = "crash timeout"
59
60OCC_DISABLE_TMPL = "op-occ-disable@.service"
61HOST_ERROR_TGTFMT = "obmc-host-{0}@{1}.target"
62OCC_DISABLE_INSTFMT = "op-occ-disable@{1}.service"
63HOST_ERROR_FMT = "../${OCC_DISABLE_TMPL}:${HOST_ERROR_TGTFMT}.wants/${OCC_DISABLE_INSTFMT}"
64
65SYSTEMD_LINK_${PN} += "${@compose_list(d, 'HOST_ERROR_FMT', 'HOST_ERROR_TARGETS', 'OBMC_HOST_INSTANCES')}"
66
Deepak Kodihallif98bd112017-03-24 07:44:16 -050067S = "${WORKDIR}/git"
Marri Devender Raob867da72017-12-29 06:01:11 -060068
69# Remove packages not required for native build
70DEPENDS_remove_class-native = " \
71 phosphor-logging \
Marri Devender Raob867da72017-12-29 06:01:11 -060072 systemd \
73 virtual/${PN}-config-native \
74 "
Andrew Geissler5c459852020-02-10 08:19:46 -060075RDEPENDS_${PN}_remove_class-native += "phosphor-state-manager-obmc-targets"
76
Marri Devender Raob867da72017-12-29 06:01:11 -060077# Remove packages not required for native SDK build
78DEPENDS_remove_class-nativesdk = " \
79 phosphor-logging \
Marri Devender Raob867da72017-12-29 06:01:11 -060080 systemd \
81 virtual/${PN}-config-native \
82 "
Andrew Geissler5c459852020-02-10 08:19:46 -060083RDEPENDS_${PN}_remove_class-nativesdk += "phosphor-state-manager-obmc-targets"
Marri Devender Raob867da72017-12-29 06:01:11 -060084
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"