diff options
4 files changed, 98 insertions, 45 deletions
diff --git a/meta-phosphor/recipes-phosphor/power/phosphor-power-systemd-links-monitor.bb b/meta-phosphor/recipes-phosphor/power/phosphor-power-systemd-links-monitor.bb new file mode 100644 index 000000000..77df3acf5 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/power/phosphor-power-systemd-links-monitor.bb @@ -0,0 +1,33 @@ +SUMMARY = "Phosphor Power Monitor services installation" +PR = "r1" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" + +inherit allarch + +RDEPENDS_${PN}-monitor += "phosphor-power-monitor" + +ALLOW_EMPTY_${PN} = "1" + + +pkg_postinst_${PN}() { + mkdir -p $D$systemd_system_unitdir/multi-user.target.requires + + [ -z "${OBMC_POWER_SUPPLY_INSTANCES}" ] && echo "No power supply instance defined" && exit 1 + + for inst in ${OBMC_POWER_SUPPLY_INSTANCES}; do + LINK="$D$systemd_system_unitdir/multi-user.target.requires/power-supply-monitor@$inst.service" + TARGET="../power-supply-monitor@.service" + ln -s $TARGET $LINK + done +} + +pkg_prerm_${PN}() { + [ -z "${OBMC_POWER_SUPPLY_INSTANCES}" ] && echo "No power supply instance defined" && exit 1 + + for inst in ${OBMC_POWER_SUPPLY_INSTANCES}; do + LINK="$D$systemd_system_unitdir/multi-user.target.requires/power-supply-monitor@$inst.service" + rm $LINK + done +} diff --git a/meta-phosphor/recipes-phosphor/power/phosphor-power-systemd-links-sequencer.bb b/meta-phosphor/recipes-phosphor/power/phosphor-power-systemd-links-sequencer.bb new file mode 100644 index 000000000..ac91c353e --- /dev/null +++ b/meta-phosphor/recipes-phosphor/power/phosphor-power-systemd-links-sequencer.bb @@ -0,0 +1,31 @@ +SUMMARY = "Phosphor Power Sequencer services installation" +PR = "r1" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" + +inherit allarch + +RDEPENDS_${PN} += "phosphor-power-sequencer" + +ALLOW_EMPTY_${PN} = "1" + +pkg_postinst_${PN}() { + mkdir -p $D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants + mkdir -p $D$systemd_system_unitdir/multi-user.target.requires + + LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants/pseq-monitor.service" + TARGET="../pseq-monitor.service" + ln -s $TARGET $LINK + + LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants/pseq-monitor-pgood.service" + TARGET="../pseq-monitor-pgood.service" + ln -s $TARGET $LINK +} + +pkg_prerm_${PN}() { + LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants/pseq-monitor.service" + rm $LINK + LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants/pseq-monitor-pgood.service" + rm $LINK +} diff --git a/meta-phosphor/recipes-phosphor/power/phosphor-power-systemd-links.bb b/meta-phosphor/recipes-phosphor/power/phosphor-power-systemd-links.bb index 2baaf0d70..f84ad2826 100644 --- a/meta-phosphor/recipes-phosphor/power/phosphor-power-systemd-links.bb +++ b/meta-phosphor/recipes-phosphor/power/phosphor-power-systemd-links.bb @@ -1,3 +1,7 @@ +# TODO: This is splitted into two recipes; +# To avoid build error, this is kept for now. +# Remove me when the refactor of phosphor-power recipe is finished + SUMMARY = "Phosphor Power services installation" PR = "r1" @@ -9,38 +13,3 @@ inherit allarch RDEPENDS_${PN} += "phosphor-power" ALLOW_EMPTY_${PN} = "1" - -pkg_postinst_${PN}() { - mkdir -p $D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants - mkdir -p $D$systemd_system_unitdir/multi-user.target.requires - - LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants/pseq-monitor.service" - TARGET="../pseq-monitor.service" - ln -s $TARGET $LINK - - LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants/pseq-monitor-pgood.service" - TARGET="../pseq-monitor-pgood.service" - ln -s $TARGET $LINK - - [ -z "${OBMC_POWER_SUPPLY_INSTANCES}" ] && echo "No power supply instance defined" && exit 1 - - for inst in ${OBMC_POWER_SUPPLY_INSTANCES}; do - LINK="$D$systemd_system_unitdir/multi-user.target.requires/power-supply-monitor@$inst.service" - TARGET="../power-supply-monitor@.service" - ln -s $TARGET $LINK - done -} - -pkg_prerm_${PN}() { - LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants/pseq-monitor.service" - rm $LINK - LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants/pseq-monitor-pgood.service" - rm $LINK - - [ -z "${OBMC_POWER_SUPPLY_INSTANCES}" ] && echo "No power supply instance defined" && exit 1 - - for inst in ${OBMC_POWER_SUPPLY_INSTANCES}; do - LINK="$D$systemd_system_unitdir/multi-user.target.requires/power-supply-monitor@$inst.service" - rm $LINK - done -} diff --git a/meta-phosphor/recipes-phosphor/power/phosphor-power_git.bb b/meta-phosphor/recipes-phosphor/power/phosphor-power_git.bb index c71064558..3a296b706 100644 --- a/meta-phosphor/recipes-phosphor/power/phosphor-power_git.bb +++ b/meta-phosphor/recipes-phosphor/power/phosphor-power_git.bb @@ -13,6 +13,20 @@ require ${PN}.inc S = "${WORKDIR}/git" +POWER_SERVICE_PACKAGES = " \ + ${PN}-cold-redundancy \ + ${PN}-monitor \ + ${PN}-psu-monitor \ + ${PN}-regulators \ + ${PN}-sequencer \ +" +POWER_UTIL_PACKAGES = "${PN}-utils" + +PACKAGE_BEFORE_PN = "${POWER_SERVICE_PACKAGES} ${POWER_UTIL_PACKAGES}" +ALLOW_EMPTY_${PN} = "1" + +SYSTEMD_PACKAGES = "${POWER_SERVICE_PACKAGES}" + # TODO: in future when openpower-dbus-interfaces is removed from # phosphor-power, remove the dependency here. DEPENDS += " \ @@ -25,18 +39,24 @@ DEPENDS += " \ i2c-tools \ " -PACKAGE_BEFORE_PN = "phosphor-psu-monitor" -FILES_phosphor-psu-monitor = "${bindir}/phosphor-psu-monitor \ - ${systemd_system_unitdir}/phosphor-psu-monitor.service" - SEQ_MONITOR_SVC = "pseq-monitor.service" SEQ_PGOOD_SVC = "pseq-monitor-pgood.service" PSU_MONITOR_TMPL = "power-supply-monitor@.service" -SYSTEMD_SERVICE_${PN} += "${SEQ_MONITOR_SVC} ${SEQ_PGOOD_SVC} ${PSU_MONITOR_TMPL}" +PSU_MONITOR_SVC = "phosphor-psu-monitor.service" +REGS_SVC = "phosphor-regulators.service" -# Package all phosphor-regulators config files -FILES_${PN} += "${datadir}/phosphor-regulators" +SYSTEMD_SERVICE_${PN}-sequencer = "${SEQ_MONITOR_SVC} ${SEQ_PGOOD_SVC}" +SYSTEMD_SERVICE_${PN}-monitor = "${PSU_MONITOR_TMPL}" +SYSTEMD_SERVICE_${PN}-psu-monitor = "${PSU_MONITOR_SVC}" +SYSTEMD_SERVICE_${PN}-regulators = "${REGS_SVC}" -# ${PN}-regulators service/systemd setup -REGS_SVC = "phosphor-regulators.service" -SYSTEMD_SERVICE_${PN} += "${REGS_SVC}" + +# TODO: cold-redundancy is not installed in the repo yet +# FILES_${PN}-cold-redundancy = "${bindir}/cold-redundancy" + +FILES_${PN}-monitor = "${bindir}/psu-monitor" +FILES_${PN}-psu-monitor = "${bindir}/phosphor-psu-monitor" +FILES_${PN}-regulators = "${bindir}/phosphor-regulators" +FILES_${PN}-sequencer = "${bindir}/pseq-monitor" +FILES_${PN}-utils = "${bindir}/psutils" +FILES_${PN}-regulators = "${datadir}/phosphor-regulators" |