blob: 521ff02b98e35d4f4e447833d92e13a86ed819f2 [file] [log] [blame]
Andrew Geissler82cfa662020-02-17 15:11:03 -06001SUMMARY = "OpenPOWER processor control services installation"
2PR = "r1"
3
4LICENSE = "Apache-2.0"
5LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
6
7inherit allarch
8
9RDEPENDS_${PN} += "op-proc-control"
10RDEPENDS_${PN} += "phosphor-state-manager-obmc-targets"
11
12ALLOW_EMPTY_${PN} = "1"
13
14pkg_postinst_${PN}() {
Andrew Geissler55bd4492020-03-31 13:43:46 -050015 mkdir -p $D$systemd_system_unitdir/obmc-host-stop@0.target.wants
Andrew Geissler82cfa662020-02-17 15:11:03 -060016 mkdir -p $D$systemd_system_unitdir/obmc-host-force-warm-reboot@0.target.requires
Dhruvaraj Subhashchandranc8aa6a12020-03-09 13:04:32 -050017 mkdir -p $D$systemd_system_unitdir/obmc-host-startmin@0.target.requires
18 mkdir -p $D$systemd_system_unitdir/obmc-host-diagnostic-mode@0.target.requires
Andrew Geisslerf95063e2020-04-14 15:08:43 -050019 mkdir -p $D$systemd_system_unitdir/obmc-chassis-poweron@0.target.requires
Andrew Geissler82cfa662020-02-17 15:11:03 -060020
Andrew Geissler55bd4492020-03-31 13:43:46 -050021 LINK="$D$systemd_system_unitdir/obmc-host-stop@0.target.wants/op-stop-instructions@0.service"
Andrew Geissler82cfa662020-02-17 15:11:03 -060022 TARGET="../op-stop-instructions@.service"
23 ln -s $TARGET $LINK
24
Andrew Geisslerf95063e2020-04-14 15:08:43 -050025 LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/op-cfam-reset.service"
26 TARGET="../op-cfam-reset.service"
27 ln -s $TARGET $LINK
28
29 LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.requires/op-cfam-reset.service"
Andrew Geissler82cfa662020-02-17 15:11:03 -060030 TARGET="../op-cfam-reset.service"
31 ln -s $TARGET $LINK
Andrew Geissler4e174d12020-02-26 14:11:53 -060032
33 # Only install cfam override if p9 system
34 if [ "${@bb.utils.contains("MACHINE_FEATURES", "p9-cfam-override", "True", "False", d)}" = True ]; then
35 mkdir -p $D$systemd_system_unitdir/obmc-host-startmin@0.target.requires
36 LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/cfam_override@0.service"
37 TARGET="../cfam_override@.service"
38 ln -s $TARGET $LINK
39 fi
Dhruvaraj Subhashchandranc8aa6a12020-03-09 13:04:32 -050040
41 LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/op-continue-mpreboot@0.service"
42 TARGET="../op-continue-mpreboot@.service"
43 ln -s $TARGET $LINK
44
45 LINK="$D$systemd_system_unitdir/obmc-host-diagnostic-mode@0.target.requires/op-enter-mpreboot@0.service"
46 TARGET="../op-enter-mpreboot@.service"
47 ln -s $TARGET $LINK
Ramesh Iyyard6d9b542020-09-17 10:02:08 -050048
49 # Only install phal reinit service if phal enabled
50 if [ "${@bb.utils.filter('OBMC_MACHINE_FEATURES', 'phal', d)}" = phal ]; then
51 mkdir -p $D$systemd_system_unitdir/obmc-host-start@0.target.requires
52 LINK="$D$systemd_system_unitdir/obmc-host-start@0.target.requires/phal-reinit-devtree.service"
53 TARGET="../phal-reinit-devtree.service"
54 ln -s $TARGET $LINK
55 fi
Andrew Geissler82cfa662020-02-17 15:11:03 -060056}
57
58pkg_prerm_${PN}() {
Andrew Geissler55bd4492020-03-31 13:43:46 -050059 LINK="$D$systemd_system_unitdir/obmc-host-stop@0.target.wants/op-stop-instructions@0.service"
Andrew Geissler82cfa662020-02-17 15:11:03 -060060 rm $LINK
Andrew Geisslerf95063e2020-04-14 15:08:43 -050061 LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/op-cfam-reset.service"
62 rm $LINK
63 LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.requires/op-cfam-reset.service"
Andrew Geissler82cfa662020-02-17 15:11:03 -060064 rm $LINK
Andrew Geissler4e174d12020-02-26 14:11:53 -060065 # Only uninstall cfam override if p9 system
66 if [ "${@bb.utils.contains("MACHINE_FEATURES", "p9-cfam-override", "True", "False", d)}" = True ]; then
67 LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/cfam_override@0.service"
68 rm $LINK
69 fi
Dhruvaraj Subhashchandranc8aa6a12020-03-09 13:04:32 -050070 LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/op-continue-mpreboot@0.service"
71 rm $LINK
72 LINK="$D$systemd_system_unitdir/obmc-host-diagnostic-mode@0.target.requires/op-enter-mpreboot@0.service"
73 rm $LINK
Ramesh Iyyard6d9b542020-09-17 10:02:08 -050074
75 # Only phal reinit service if phal enabled
76 if [ "${@bb.utils.filter('OBMC_MACHINE_FEATURES', 'phal', d)}" = phal ]; then
77 LINK="$D$systemd_system_unitdir/obmc-host-start@0.target.requires/phal-reinit-devtree.service"
78 rm $LINK
79 fi
Andrew Geissler82cfa662020-02-17 15:11:03 -060080}