diff options
author | Lei YU <mine260309@gmail.com> | 2019-11-21 11:12:26 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2020-01-23 17:25:57 +0300 |
commit | e86f57469fffbd1ad312fe486d52ff1bf177b131 (patch) | |
tree | 7353d27870bef2601c6b475e3134b5e3b7b9a28a /meta-phosphor/recipes-phosphor | |
parent | 0feba83637c4f66b55f3752ab2697e6c033e36d2 (diff) | |
download | openbmc-e86f57469fffbd1ad312fe486d52ff1bf177b131.tar.xz |
phosphor-power: Fix pkg_postinst script
The pkg_postinst script uses the variable OBMC_POWER_SUPPLY_INSTANCES
that is not availabe during the post installation. This results in the
links of power-supply-monitor@.service are not created.
Use `@d.getVar()` to get the variable from bitbake fixed the issue.
Also removes the default OBMC_POWER_SUPPLY_INSTANCES, let the build fail
when OBMC_POWER_SUPPLY_INSTANCES is not defined. Otherwise such issues
are only found at runtime.
Tested: Verify the witherspoon build contains the
power-supply-monitor@.service links;
Unset OBMC_POWER_SUPPLY_INSTANCES, verify the build fails due to
installation failure.
(From meta-phosphor rev: 2e6bda873f9c96c71da0103310f3e970d1a5b999)
Change-Id: Id70ea4c05b937bb93e7d93bcabf3a961cf295435
Signed-off-by: Lei YU <mine260309@gmail.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-phosphor/recipes-phosphor')
-rw-r--r-- | meta-phosphor/recipes-phosphor/power/phosphor-power-systemd-links.bb | 11 |
1 files changed, 7 insertions, 4 deletions
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 0ee5e8303..2baaf0d70 100644 --- a/meta-phosphor/recipes-phosphor/power/phosphor-power-systemd-links.bb +++ b/meta-phosphor/recipes-phosphor/power/phosphor-power-systemd-links.bb @@ -8,8 +8,6 @@ inherit allarch RDEPENDS_${PN} += "phosphor-power" -OBMC_POWER_SUPPLY_INSTANCES ?= "0" - ALLOW_EMPTY_${PN} = "1" pkg_postinst_${PN}() { @@ -24,7 +22,9 @@ pkg_postinst_${PN}() { TARGET="../pseq-monitor-pgood.service" ln -s $TARGET $LINK - for inst in $OBMC_POWER_SUPPLY_INSTANCES; do + [ -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 @@ -36,7 +36,10 @@ pkg_prerm_${PN}() { rm $LINK LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants/pseq-monitor-pgood.service" rm $LINK - for inst in $OBMC_POWER_SUPPLY_INSTANCES; do + + [ -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 |