summaryrefslogtreecommitdiff
path: root/meta-phosphor
diff options
context:
space:
mode:
authorLei YU <mine260309@gmail.com>2020-02-06 10:43:35 +0300
committerAndrew Geissler <geissonator@yahoo.com>2020-03-12 15:23:36 +0300
commit7307bedd3ff50091e35d9c1fffe23fbef84b01d1 (patch)
tree315de0b3378a724df7be746bf56bd066e47e9199 /meta-phosphor
parent8b2fe21e4b69fc1aaf2875f259c446bb6bab1d15 (diff)
downloadopenbmc-7307bedd3ff50091e35d9c1fffe23fbef84b01d1.tar.xz
phosphor-power: split into separated packages
phosphor-power consists of several separated services and utils. All of them are installed by default. Split them into separated packages, so that a machine layer could select which packages are needed. This is done by define PACKAGE_BEFORE_PN and specify the FILES_ for each package, and split the phosphor-power-systemd-links-monitor.bb into separated recipes to install services for the related package. The phosphor-power-systemd-links.bb is kept for now to avoid build error on existing systems. It will be removed when the meta-system layers' changes are done. Tested: Only include phosphor-power-monitor, verify that only the related binary and service unit file are installed into the image. Include all the packages, verify that all the services and utils are installed into the image. (From meta-phosphor rev: 2172cd128215683d1fd425b841e90b515aec04c9) Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: I83f436e51b33903a581bfc48541475711467bb61 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Diffstat (limited to 'meta-phosphor')
-rw-r--r--meta-phosphor/recipes-phosphor/power/phosphor-power-systemd-links-monitor.bb33
-rw-r--r--meta-phosphor/recipes-phosphor/power/phosphor-power-systemd-links-sequencer.bb31
-rw-r--r--meta-phosphor/recipes-phosphor/power/phosphor-power-systemd-links.bb39
-rw-r--r--meta-phosphor/recipes-phosphor/power/phosphor-power_git.bb40
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"