blob: cae79bef0b16c5d093d702415c026bc41441ad2e [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 Geisslerc3f1beb2020-12-09 15:05:02 -060020 mkdir -p $D$systemd_system_unitdir/obmc-host-quiesce@0.target.wants
Andrew Geissler82cfa662020-02-17 15:11:03 -060021
Andrew Geissler55bd4492020-03-31 13:43:46 -050022 LINK="$D$systemd_system_unitdir/obmc-host-stop@0.target.wants/op-stop-instructions@0.service"
Andrew Geissler82cfa662020-02-17 15:11:03 -060023 TARGET="../op-stop-instructions@.service"
24 ln -s $TARGET $LINK
25
Andrew Geisslerc3f1beb2020-12-09 15:05:02 -060026 LINK="$D$systemd_system_unitdir/obmc-host-quiesce@0.target.wants/op-stop-instructions@0.service"
27 TARGET="../op-stop-instructions@.service"
28 ln -s $TARGET $LINK
29
Andrew Geisslerf95063e2020-04-14 15:08:43 -050030 LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/op-cfam-reset.service"
31 TARGET="../op-cfam-reset.service"
32 ln -s $TARGET $LINK
33
34 LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.requires/op-cfam-reset.service"
Andrew Geissler82cfa662020-02-17 15:11:03 -060035 TARGET="../op-cfam-reset.service"
36 ln -s $TARGET $LINK
Andrew Geissler4e174d12020-02-26 14:11:53 -060037
38 # Only install cfam override if p9 system
39 if [ "${@bb.utils.contains("MACHINE_FEATURES", "p9-cfam-override", "True", "False", d)}" = True ]; then
40 mkdir -p $D$systemd_system_unitdir/obmc-host-startmin@0.target.requires
41 LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/cfam_override@0.service"
42 TARGET="../cfam_override@.service"
43 ln -s $TARGET $LINK
44 fi
Dhruvaraj Subhashchandranc8aa6a12020-03-09 13:04:32 -050045
46 LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/op-continue-mpreboot@0.service"
47 TARGET="../op-continue-mpreboot@.service"
48 ln -s $TARGET $LINK
49
Andrew Geissler88eef192020-12-17 11:37:11 -060050 # Only install certain units if phal enabled
Ramesh Iyyard6d9b542020-09-17 10:02:08 -050051 if [ "${@bb.utils.filter('OBMC_MACHINE_FEATURES', 'phal', d)}" = phal ]; then
52 mkdir -p $D$systemd_system_unitdir/obmc-host-start@0.target.requires
53 LINK="$D$systemd_system_unitdir/obmc-host-start@0.target.requires/phal-reinit-devtree.service"
54 TARGET="../phal-reinit-devtree.service"
55 ln -s $TARGET $LINK
Chirag Sharma5ec16a32020-12-11 03:45:15 -060056
57 LINK="$D$systemd_system_unitdir/obmc-chassis-poweroff@0.target.requires/proc-pre-poweroff@0.service"
58 TARGET="../proc-pre-poweroff@.service"
59 ln -s $TARGET $LINK
Andrew Geissler88eef192020-12-17 11:37:11 -060060
61 # on phal systems, obmc-host-crash@.target is used for MPIPL
62 mkdir -p $D$systemd_system_unitdir/obmc-host-crash@0.target.requires
63 LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/obmc-host-force-warm-reboot@0.target"
64 TARGET="../obmc-host-force-warm-reboot@.target"
65 ln -s $TARGET $LINK
66
67 LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/op-enter-mpreboot@0.service"
68 TARGET="../op-enter-mpreboot@.service"
69 ln -s $TARGET $LINK
70
71 # ensure diagnostic mode is shown for MPIPL
72 LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/obmc-host-diagnostic-mode@0.target"
73 TARGET="../obmc-host-diagnostic-mode@.target"
74 ln -s $TARGET $LINK
75 else
76 # If not phal, default to quiesce target in crash target to support
77 # older system designs like witherspoon
78 mkdir -p $D$systemd_system_unitdir/obmc-host-crash@0.target.wants
79 LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.wants/obmc-host-quiesce@0.target"
80 TARGET="../obmc-host-quiesce@.target"
81 ln -s $TARGET $LINK
Ramesh Iyyard6d9b542020-09-17 10:02:08 -050082 fi
Andrew Geissler82cfa662020-02-17 15:11:03 -060083}
84
85pkg_prerm_${PN}() {
Andrew Geissler55bd4492020-03-31 13:43:46 -050086 LINK="$D$systemd_system_unitdir/obmc-host-stop@0.target.wants/op-stop-instructions@0.service"
Andrew Geissler82cfa662020-02-17 15:11:03 -060087 rm $LINK
Andrew Geisslerf95063e2020-04-14 15:08:43 -050088 LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/op-cfam-reset.service"
89 rm $LINK
90 LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.requires/op-cfam-reset.service"
Andrew Geissler82cfa662020-02-17 15:11:03 -060091 rm $LINK
Andrew Geissler4e174d12020-02-26 14:11:53 -060092 # Only uninstall cfam override if p9 system
93 if [ "${@bb.utils.contains("MACHINE_FEATURES", "p9-cfam-override", "True", "False", d)}" = True ]; then
94 LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/cfam_override@0.service"
95 rm $LINK
96 fi
Dhruvaraj Subhashchandranc8aa6a12020-03-09 13:04:32 -050097 LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/op-continue-mpreboot@0.service"
98 rm $LINK
Ramesh Iyyard6d9b542020-09-17 10:02:08 -050099
Andrew Geissler88eef192020-12-17 11:37:11 -0600100 # Remove phal specific units if enabled
Ramesh Iyyard6d9b542020-09-17 10:02:08 -0500101 if [ "${@bb.utils.filter('OBMC_MACHINE_FEATURES', 'phal', d)}" = phal ]; then
102 LINK="$D$systemd_system_unitdir/obmc-host-start@0.target.requires/phal-reinit-devtree.service"
103 rm $LINK
Chirag Sharma5ec16a32020-12-11 03:45:15 -0600104
105 LINK="$D$systemd_system_unitdir/obmc-chassis-poweroff@0.target.requires/proc-pre-poweroff@0.service"
106 rm $LINK
Andrew Geissler88eef192020-12-17 11:37:11 -0600107
108 LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/obmc-host-force-warm-reboot@0.target"
109 rm $LINK
110
111 LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/op-enter-mpreboot@0.service"
112 rm $LINK
113 else
114 LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.wants/obmc-host-quiesce@0.target"
115 rm $LINK
Ramesh Iyyard6d9b542020-09-17 10:02:08 -0500116 fi
Andrew Geissler82cfa662020-02-17 15:11:03 -0600117}