blob: f0a79b6659212aaaaf212258c5f89fc867cfa16b [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
Adriana Kobylak8c6707f2021-08-06 17:35:36 +00009RDEPENDS:${PN} += "op-proc-control"
10RDEPENDS:${PN} += "phosphor-state-manager-obmc-targets"
Andrew Geissler82cfa662020-02-17 15:11:03 -060011
Adriana Kobylak8c6707f2021-08-06 17:35:36 +000012ALLOW_EMPTY:${PN} = "1"
Andrew Geissler82cfa662020-02-17 15:11:03 -060013
Adriana Kobylak8c6707f2021-08-06 17:35:36 +000014pkg_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
Andrew Geisslerb9b3a4a2023-05-12 14:10:34 -050018 mkdir -p $D$systemd_system_unitdir/obmc-host-startmin@0.target.wants
Dhruvaraj Subhashchandranc8aa6a12020-03-09 13:04:32 -050019 mkdir -p $D$systemd_system_unitdir/obmc-host-diagnostic-mode@0.target.requires
Andrew Geisslerf95063e2020-04-14 15:08:43 -050020 mkdir -p $D$systemd_system_unitdir/obmc-chassis-poweron@0.target.requires
Andrew Geisslerc3f1beb2020-12-09 15:05:02 -060021 mkdir -p $D$systemd_system_unitdir/obmc-host-quiesce@0.target.wants
Andrew Geissler82cfa662020-02-17 15:11:03 -060022
Andrew Geissler55bd4492020-03-31 13:43:46 -050023 LINK="$D$systemd_system_unitdir/obmc-host-stop@0.target.wants/op-stop-instructions@0.service"
Andrew Geissler82cfa662020-02-17 15:11:03 -060024 TARGET="../op-stop-instructions@.service"
25 ln -s $TARGET $LINK
26
deepa94fa8dd2023-08-03 01:43:06 -050027 LINK="$D$systemd_system_unitdir/obmc-host-quiesce@0.target.wants/op-clear-sys-dump-active@0.service"
28 TARGET="../op-clear-sys-dump-active@.service"
29 ln -s $TARGET $LINK
30
Andrew Geisslerc3f1beb2020-12-09 15:05:02 -060031 LINK="$D$systemd_system_unitdir/obmc-host-quiesce@0.target.wants/op-stop-instructions@0.service"
32 TARGET="../op-stop-instructions@.service"
33 ln -s $TARGET $LINK
34
Andrew Geisslerf95063e2020-04-14 15:08:43 -050035 LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/op-cfam-reset.service"
36 TARGET="../op-cfam-reset.service"
37 ln -s $TARGET $LINK
38
Andrew Geisslerb9b3a4a2023-05-12 14:10:34 -050039 LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.wants/xyz.openbmc_project.Control.Host.NMI.service"
40 TARGET="../xyz.openbmc_project.Control.Host.NMI.service"
41 ln -s $TARGET $LINK
42
Andrew Geisslerf95063e2020-04-14 15:08:43 -050043 LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.requires/op-cfam-reset.service"
Andrew Geissler82cfa662020-02-17 15:11:03 -060044 TARGET="../op-cfam-reset.service"
45 ln -s $TARGET $LINK
Andrew Geissler4e174d12020-02-26 14:11:53 -060046
47 # Only install cfam override if p9 system
48 if [ "${@bb.utils.contains("MACHINE_FEATURES", "p9-cfam-override", "True", "False", d)}" = True ]; then
49 mkdir -p $D$systemd_system_unitdir/obmc-host-startmin@0.target.requires
50 LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/cfam_override@0.service"
51 TARGET="../cfam_override@.service"
52 ln -s $TARGET $LINK
53 fi
Dhruvaraj Subhashchandranc8aa6a12020-03-09 13:04:32 -050054
55 LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/op-continue-mpreboot@0.service"
56 TARGET="../op-continue-mpreboot@.service"
57 ln -s $TARGET $LINK
58
Andrew Geissler88eef192020-12-17 11:37:11 -060059 # Only install certain units if phal enabled
Patrick Williams8c561ee2021-10-22 14:20:12 -050060 if [ "${@bb.utils.filter('MACHINE_FEATURES', 'phal', d)}" = phal ]; then
Andrew Geisslerf158d902022-04-08 16:24:35 -050061 LINK="$D$systemd_system_unitdir/obmc-host-stop@0.target.wants/op-clear-sys-dump-active@0.service"
62 TARGET="../op-clear-sys-dump-active@.service"
63 ln -s $TARGET $LINK
64
65 mkdir -p $D$systemd_system_unitdir/multi-user.target.wants
66 LINK="$D$systemd_system_unitdir/multi-user.target.wants/op-clear-sys-dump-active@0.service"
67 TARGET="../op-clear-sys-dump-active@.service"
68 ln -s $TARGET $LINK
69
Ramesh Iyyard6d9b542020-09-17 10:02:08 -050070 mkdir -p $D$systemd_system_unitdir/obmc-host-start@0.target.requires
71 LINK="$D$systemd_system_unitdir/obmc-host-start@0.target.requires/phal-reinit-devtree.service"
72 TARGET="../phal-reinit-devtree.service"
73 ln -s $TARGET $LINK
Chirag Sharma5ec16a32020-12-11 03:45:15 -060074
75 LINK="$D$systemd_system_unitdir/obmc-chassis-poweroff@0.target.requires/proc-pre-poweroff@0.service"
76 TARGET="../proc-pre-poweroff@.service"
77 ln -s $TARGET $LINK
Andrew Geissler4d2fd8d2021-06-24 15:28:47 -050078
79 LINK="$D$systemd_system_unitdir/obmc-host-reset@0.target.requires/op-reset-host-check@0.service"
80 TARGET="../op-reset-host-check@.service"
81 ln -s $TARGET $LINK
Jayanth Othayothad68ba32021-07-30 06:35:44 -050082
Jayanth Othayothad68ba32021-07-30 06:35:44 -050083 LINK="$D$systemd_system_unitdir/multi-user.target.wants/phal-import-devtree@0.service"
84 TARGET="../phal-import-devtree@.service"
85 ln -s $TARGET $LINK
Jayanth Othayothce7dbec2021-07-30 06:46:57 -050086
87 mkdir -p $D$systemd_system_unitdir/obmc-host-startmin@0.target.wants
88 LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.wants/phal-export-devtree@0.service"
89 TARGET="../phal-export-devtree@.service"
90 ln -s $TARGET $LINK
Ramesh Iyyard0aedb92022-02-24 03:35:40 -060091
92 mkdir -p $D$systemd_system_unitdir/obmc-host-start@0.target.wants
93 LINK="$D$systemd_system_unitdir/obmc-host-start@0.target.wants/phal-create-boottime-guard-indicator.service"
94 TARGET="../phal-create-boottime-guard-indicator.service"
95 ln -s $TARGET $LINK
96 LINK="$D$systemd_system_unitdir/obmc-host-quiesce@0.target.wants/phal-create-boottime-guard-indicator.service"
97 ln -s $TARGET $LINK
Jayanth Othayoth633a9cc2022-09-12 06:23:45 -050098
99 mkdir -p $D$systemd_system_unitdir/obmc-host-startmin@0.target.wants
100 LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.wants/op-clock-data-logger@0.service"
101 TARGET="../op-clock-data-logger@.service"
102 ln -s $TARGET $LINK
Andrew Geisslerb9b3a4a2023-05-12 14:10:34 -0500103
104 mkdir -p $D$systemd_system_unitdir/obmc-chassis-poweroff@0.target.wants
105 LINK="$D$systemd_system_unitdir/obmc-chassis-poweroff@0.target.wants/set-spi-mux.service"
106 TARGET="../set-spi-mux.service"
107 ln -s $TARGET $LINK
Jayanth Othayothad68ba32021-07-30 06:35:44 -0500108 fi
Andrew Geissler88eef192020-12-17 11:37:11 -0600109
Andrew Geissleraa25e2c2021-02-01 14:14:25 -0600110 # If the memory preserving reboot feature is enabled, set it up
111 if [ "${@bb.utils.filter('DISTRO_FEATURES', 'mpreboot', d)}" = mpreboot ]; then
112 # on mpreboot systems, obmc-host-crash@.target is used for mpreboot
Andrew Geissler88eef192020-12-17 11:37:11 -0600113 mkdir -p $D$systemd_system_unitdir/obmc-host-crash@0.target.requires
114 LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/obmc-host-force-warm-reboot@0.target"
115 TARGET="../obmc-host-force-warm-reboot@.target"
116 ln -s $TARGET $LINK
117
118 LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/op-enter-mpreboot@0.service"
119 TARGET="../op-enter-mpreboot@.service"
120 ln -s $TARGET $LINK
121
Andrew Geissleraa25e2c2021-02-01 14:14:25 -0600122 # ensure diagnostic mode is shown for MPREBOOT
Andrew Geissler88eef192020-12-17 11:37:11 -0600123 LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/obmc-host-diagnostic-mode@0.target"
124 TARGET="../obmc-host-diagnostic-mode@.target"
125 ln -s $TARGET $LINK
126 else
Andrew Geissleraa25e2c2021-02-01 14:14:25 -0600127 # If not a mpreboot system, default to quiesce target in crash target to support
Andrew Geissler88eef192020-12-17 11:37:11 -0600128 # older system designs like witherspoon
129 mkdir -p $D$systemd_system_unitdir/obmc-host-crash@0.target.wants
130 LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.wants/obmc-host-quiesce@0.target"
131 TARGET="../obmc-host-quiesce@.target"
132 ln -s $TARGET $LINK
Ramesh Iyyard6d9b542020-09-17 10:02:08 -0500133 fi
Andrew Geissler82cfa662020-02-17 15:11:03 -0600134}
135
Adriana Kobylak8c6707f2021-08-06 17:35:36 +0000136pkg_prerm:${PN}() {
Andrew Geissler55bd4492020-03-31 13:43:46 -0500137 LINK="$D$systemd_system_unitdir/obmc-host-stop@0.target.wants/op-stop-instructions@0.service"
Andrew Geissler82cfa662020-02-17 15:11:03 -0600138 rm $LINK
Andrew Geisslerf95063e2020-04-14 15:08:43 -0500139 LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/op-cfam-reset.service"
140 rm $LINK
141 LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.requires/op-cfam-reset.service"
Andrew Geissler82cfa662020-02-17 15:11:03 -0600142 rm $LINK
Andrew Geisslerb9b3a4a2023-05-12 14:10:34 -0500143 LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.wants/xyz.openbmc_project.Control.Host.NMI.service"
144 rm $LINK
Andrew Geissler4e174d12020-02-26 14:11:53 -0600145 # Only uninstall cfam override if p9 system
146 if [ "${@bb.utils.contains("MACHINE_FEATURES", "p9-cfam-override", "True", "False", d)}" = True ]; then
147 LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/cfam_override@0.service"
148 rm $LINK
149 fi
Dhruvaraj Subhashchandranc8aa6a12020-03-09 13:04:32 -0500150 LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/op-continue-mpreboot@0.service"
151 rm $LINK
Ramesh Iyyard6d9b542020-09-17 10:02:08 -0500152
Andrew Geissler88eef192020-12-17 11:37:11 -0600153 # Remove phal specific units if enabled
Patrick Williams8c561ee2021-10-22 14:20:12 -0500154 if [ "${@bb.utils.filter('MACHINE_FEATURES', 'phal', d)}" = phal ]; then
Ramesh Iyyard6d9b542020-09-17 10:02:08 -0500155 LINK="$D$systemd_system_unitdir/obmc-host-start@0.target.requires/phal-reinit-devtree.service"
156 rm $LINK
Chirag Sharma5ec16a32020-12-11 03:45:15 -0600157
158 LINK="$D$systemd_system_unitdir/obmc-chassis-poweroff@0.target.requires/proc-pre-poweroff@0.service"
159 rm $LINK
Jayanth Othayothad68ba32021-07-30 06:35:44 -0500160
Andrew Geisslerb9b3a4a2023-05-12 14:10:34 -0500161 LINK="$D$systemd_system_unitdir/obmc-chassis-poweroff@0.target.wants/set-spi-mux.service"
162 rm $LINK
163
Jayanth Othayothad68ba32021-07-30 06:35:44 -0500164 LINK="$D$systemd_system_unitdir/multi-user.target.wants/phal-import-devtree@0.service"
165 rm $LINK
Jayanth Othayothce7dbec2021-07-30 06:46:57 -0500166
167 LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.wants/phal-export-devtree@0.service"
168 rm $LINK
Ramesh Iyyard0aedb92022-02-24 03:35:40 -0600169
170 LINK="$D$systemd_system_unitdir/obmc-host-start@0.target.wants/phal-create-boottime-guard-indicator.service"
171 rm $LINK
172 LINK="$D$systemd_system_unitdir/obmc-host-quiesce@0.target.wants/phal-create-boottime-guard-indicator.service"
173 rm $LINK
Jayanth Othayoth633a9cc2022-09-12 06:23:45 -0500174
175 LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.wants/op-clock-data-logger@0.service"
176 rm $LINK
Andrew Geissleraa25e2c2021-02-01 14:14:25 -0600177 fi
Andrew Geissler88eef192020-12-17 11:37:11 -0600178
Andrew Geissleraa25e2c2021-02-01 14:14:25 -0600179 # Remove mpreboot specific units if enabled
180 if [ "${@bb.utils.filter('DISTRO_FEATURES', 'mpreboot', d)}" = mpreboot ]; then
Andrew Geissler88eef192020-12-17 11:37:11 -0600181 LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/obmc-host-force-warm-reboot@0.target"
182 rm $LINK
183
184 LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/op-enter-mpreboot@0.service"
185 rm $LINK
186 else
187 LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.wants/obmc-host-quiesce@0.target"
188 rm $LINK
Ramesh Iyyard6d9b542020-09-17 10:02:08 -0500189 fi
Andrew Geissler82cfa662020-02-17 15:11:03 -0600190}