blob: a9c329a216836d6c042a40c2e9ebcd5618b6616e [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
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
Patrick Williams8c561ee2021-10-22 14:20:12 -050051 if [ "${@bb.utils.filter('MACHINE_FEATURES', 'phal', d)}" = phal ]; then
Ramesh Iyyard6d9b542020-09-17 10:02:08 -050052 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 Geissler4d2fd8d2021-06-24 15:28:47 -050060
61 LINK="$D$systemd_system_unitdir/obmc-host-reset@0.target.requires/op-reset-host-check@0.service"
62 TARGET="../op-reset-host-check@.service"
63 ln -s $TARGET $LINK
Jayanth Othayothad68ba32021-07-30 06:35:44 -050064
65 mkdir -p $D$systemd_system_unitdir/multi-user.target.wants
66 LINK="$D$systemd_system_unitdir/multi-user.target.wants/phal-import-devtree@0.service"
67 TARGET="../phal-import-devtree@.service"
68 ln -s $TARGET $LINK
Jayanth Othayothce7dbec2021-07-30 06:46:57 -050069
70 mkdir -p $D$systemd_system_unitdir/obmc-host-startmin@0.target.wants
71 LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.wants/phal-export-devtree@0.service"
72 TARGET="../phal-export-devtree@.service"
73 ln -s $TARGET $LINK
Ramesh Iyyard0aedb92022-02-24 03:35:40 -060074
75 mkdir -p $D$systemd_system_unitdir/obmc-host-start@0.target.wants
76 LINK="$D$systemd_system_unitdir/obmc-host-start@0.target.wants/phal-create-boottime-guard-indicator.service"
77 TARGET="../phal-create-boottime-guard-indicator.service"
78 ln -s $TARGET $LINK
79 LINK="$D$systemd_system_unitdir/obmc-host-quiesce@0.target.wants/phal-create-boottime-guard-indicator.service"
80 ln -s $TARGET $LINK
Jayanth Othayothad68ba32021-07-30 06:35:44 -050081 fi
Andrew Geissler88eef192020-12-17 11:37:11 -060082
Andrew Geissleraa25e2c2021-02-01 14:14:25 -060083 # If the memory preserving reboot feature is enabled, set it up
84 if [ "${@bb.utils.filter('DISTRO_FEATURES', 'mpreboot', d)}" = mpreboot ]; then
85 # on mpreboot systems, obmc-host-crash@.target is used for mpreboot
Andrew Geissler88eef192020-12-17 11:37:11 -060086 mkdir -p $D$systemd_system_unitdir/obmc-host-crash@0.target.requires
87 LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/obmc-host-force-warm-reboot@0.target"
88 TARGET="../obmc-host-force-warm-reboot@.target"
89 ln -s $TARGET $LINK
90
91 LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/op-enter-mpreboot@0.service"
92 TARGET="../op-enter-mpreboot@.service"
93 ln -s $TARGET $LINK
94
Andrew Geissleraa25e2c2021-02-01 14:14:25 -060095 # ensure diagnostic mode is shown for MPREBOOT
Andrew Geissler88eef192020-12-17 11:37:11 -060096 LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/obmc-host-diagnostic-mode@0.target"
97 TARGET="../obmc-host-diagnostic-mode@.target"
98 ln -s $TARGET $LINK
99 else
Andrew Geissleraa25e2c2021-02-01 14:14:25 -0600100 # If not a mpreboot system, default to quiesce target in crash target to support
Andrew Geissler88eef192020-12-17 11:37:11 -0600101 # older system designs like witherspoon
102 mkdir -p $D$systemd_system_unitdir/obmc-host-crash@0.target.wants
103 LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.wants/obmc-host-quiesce@0.target"
104 TARGET="../obmc-host-quiesce@.target"
105 ln -s $TARGET $LINK
Ramesh Iyyard6d9b542020-09-17 10:02:08 -0500106 fi
Andrew Geissler82cfa662020-02-17 15:11:03 -0600107}
108
Adriana Kobylak8c6707f2021-08-06 17:35:36 +0000109pkg_prerm:${PN}() {
Andrew Geissler55bd4492020-03-31 13:43:46 -0500110 LINK="$D$systemd_system_unitdir/obmc-host-stop@0.target.wants/op-stop-instructions@0.service"
Andrew Geissler82cfa662020-02-17 15:11:03 -0600111 rm $LINK
Andrew Geisslerf95063e2020-04-14 15:08:43 -0500112 LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/op-cfam-reset.service"
113 rm $LINK
114 LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.requires/op-cfam-reset.service"
Andrew Geissler82cfa662020-02-17 15:11:03 -0600115 rm $LINK
Andrew Geissler4e174d12020-02-26 14:11:53 -0600116 # Only uninstall cfam override if p9 system
117 if [ "${@bb.utils.contains("MACHINE_FEATURES", "p9-cfam-override", "True", "False", d)}" = True ]; then
118 LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/cfam_override@0.service"
119 rm $LINK
120 fi
Dhruvaraj Subhashchandranc8aa6a12020-03-09 13:04:32 -0500121 LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/op-continue-mpreboot@0.service"
122 rm $LINK
Ramesh Iyyard6d9b542020-09-17 10:02:08 -0500123
Andrew Geissler88eef192020-12-17 11:37:11 -0600124 # Remove phal specific units if enabled
Patrick Williams8c561ee2021-10-22 14:20:12 -0500125 if [ "${@bb.utils.filter('MACHINE_FEATURES', 'phal', d)}" = phal ]; then
Ramesh Iyyard6d9b542020-09-17 10:02:08 -0500126 LINK="$D$systemd_system_unitdir/obmc-host-start@0.target.requires/phal-reinit-devtree.service"
127 rm $LINK
Chirag Sharma5ec16a32020-12-11 03:45:15 -0600128
129 LINK="$D$systemd_system_unitdir/obmc-chassis-poweroff@0.target.requires/proc-pre-poweroff@0.service"
130 rm $LINK
Jayanth Othayothad68ba32021-07-30 06:35:44 -0500131
132 LINK="$D$systemd_system_unitdir/multi-user.target.wants/phal-import-devtree@0.service"
133 rm $LINK
Jayanth Othayothce7dbec2021-07-30 06:46:57 -0500134
135 LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.wants/phal-export-devtree@0.service"
136 rm $LINK
Ramesh Iyyard0aedb92022-02-24 03:35:40 -0600137
138 LINK="$D$systemd_system_unitdir/obmc-host-start@0.target.wants/phal-create-boottime-guard-indicator.service"
139 rm $LINK
140 LINK="$D$systemd_system_unitdir/obmc-host-quiesce@0.target.wants/phal-create-boottime-guard-indicator.service"
141 rm $LINK
Andrew Geissleraa25e2c2021-02-01 14:14:25 -0600142 fi
Andrew Geissler88eef192020-12-17 11:37:11 -0600143
Andrew Geissleraa25e2c2021-02-01 14:14:25 -0600144 # Remove mpreboot specific units if enabled
145 if [ "${@bb.utils.filter('DISTRO_FEATURES', 'mpreboot', d)}" = mpreboot ]; then
Andrew Geissler88eef192020-12-17 11:37:11 -0600146 LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/obmc-host-force-warm-reboot@0.target"
147 rm $LINK
148
149 LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/op-enter-mpreboot@0.service"
150 rm $LINK
151 else
152 LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.wants/obmc-host-quiesce@0.target"
153 rm $LINK
Ramesh Iyyard6d9b542020-09-17 10:02:08 -0500154 fi
Andrew Geissler82cfa662020-02-17 15:11:03 -0600155}