Andrew Geissler | 82cfa66 | 2020-02-17 15:11:03 -0600 | [diff] [blame] | 1 | SUMMARY = "OpenPOWER processor control services installation" |
| 2 | PR = "r1" |
| 3 | |
| 4 | LICENSE = "Apache-2.0" |
| 5 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" |
| 6 | |
| 7 | inherit allarch |
| 8 | |
Adriana Kobylak | 8c6707f | 2021-08-06 17:35:36 +0000 | [diff] [blame] | 9 | RDEPENDS:${PN} += "op-proc-control" |
| 10 | RDEPENDS:${PN} += "phosphor-state-manager-obmc-targets" |
Andrew Geissler | 82cfa66 | 2020-02-17 15:11:03 -0600 | [diff] [blame] | 11 | |
Adriana Kobylak | 8c6707f | 2021-08-06 17:35:36 +0000 | [diff] [blame] | 12 | ALLOW_EMPTY:${PN} = "1" |
Andrew Geissler | 82cfa66 | 2020-02-17 15:11:03 -0600 | [diff] [blame] | 13 | |
Adriana Kobylak | 8c6707f | 2021-08-06 17:35:36 +0000 | [diff] [blame] | 14 | pkg_postinst:${PN}() { |
Andrew Geissler | 55bd449 | 2020-03-31 13:43:46 -0500 | [diff] [blame] | 15 | mkdir -p $D$systemd_system_unitdir/obmc-host-stop@0.target.wants |
Andrew Geissler | 82cfa66 | 2020-02-17 15:11:03 -0600 | [diff] [blame] | 16 | mkdir -p $D$systemd_system_unitdir/obmc-host-force-warm-reboot@0.target.requires |
Dhruvaraj Subhashchandran | c8aa6a1 | 2020-03-09 13:04:32 -0500 | [diff] [blame] | 17 | 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 Geissler | f95063e | 2020-04-14 15:08:43 -0500 | [diff] [blame] | 19 | mkdir -p $D$systemd_system_unitdir/obmc-chassis-poweron@0.target.requires |
Andrew Geissler | c3f1beb | 2020-12-09 15:05:02 -0600 | [diff] [blame] | 20 | mkdir -p $D$systemd_system_unitdir/obmc-host-quiesce@0.target.wants |
Andrew Geissler | 82cfa66 | 2020-02-17 15:11:03 -0600 | [diff] [blame] | 21 | |
Andrew Geissler | 55bd449 | 2020-03-31 13:43:46 -0500 | [diff] [blame] | 22 | LINK="$D$systemd_system_unitdir/obmc-host-stop@0.target.wants/op-stop-instructions@0.service" |
Andrew Geissler | 82cfa66 | 2020-02-17 15:11:03 -0600 | [diff] [blame] | 23 | TARGET="../op-stop-instructions@.service" |
| 24 | ln -s $TARGET $LINK |
| 25 | |
Andrew Geissler | c3f1beb | 2020-12-09 15:05:02 -0600 | [diff] [blame] | 26 | 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 Geissler | f95063e | 2020-04-14 15:08:43 -0500 | [diff] [blame] | 30 | 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 Geissler | 82cfa66 | 2020-02-17 15:11:03 -0600 | [diff] [blame] | 35 | TARGET="../op-cfam-reset.service" |
| 36 | ln -s $TARGET $LINK |
Andrew Geissler | 4e174d1 | 2020-02-26 14:11:53 -0600 | [diff] [blame] | 37 | |
| 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 Subhashchandran | c8aa6a1 | 2020-03-09 13:04:32 -0500 | [diff] [blame] | 45 | |
| 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 Geissler | 88eef19 | 2020-12-17 11:37:11 -0600 | [diff] [blame] | 50 | # Only install certain units if phal enabled |
Patrick Williams | 8c561ee | 2021-10-22 14:20:12 -0500 | [diff] [blame] | 51 | if [ "${@bb.utils.filter('MACHINE_FEATURES', 'phal', d)}" = phal ]; then |
Andrew Geissler | f158d90 | 2022-04-08 16:24:35 -0500 | [diff] [blame] | 52 | LINK="$D$systemd_system_unitdir/obmc-host-stop@0.target.wants/op-clear-sys-dump-active@0.service" |
| 53 | TARGET="../op-clear-sys-dump-active@.service" |
| 54 | ln -s $TARGET $LINK |
| 55 | |
| 56 | mkdir -p $D$systemd_system_unitdir/multi-user.target.wants |
| 57 | LINK="$D$systemd_system_unitdir/multi-user.target.wants/op-clear-sys-dump-active@0.service" |
| 58 | TARGET="../op-clear-sys-dump-active@.service" |
| 59 | ln -s $TARGET $LINK |
| 60 | |
Ramesh Iyyar | d6d9b54 | 2020-09-17 10:02:08 -0500 | [diff] [blame] | 61 | mkdir -p $D$systemd_system_unitdir/obmc-host-start@0.target.requires |
| 62 | LINK="$D$systemd_system_unitdir/obmc-host-start@0.target.requires/phal-reinit-devtree.service" |
| 63 | TARGET="../phal-reinit-devtree.service" |
| 64 | ln -s $TARGET $LINK |
Chirag Sharma | 5ec16a3 | 2020-12-11 03:45:15 -0600 | [diff] [blame] | 65 | |
| 66 | LINK="$D$systemd_system_unitdir/obmc-chassis-poweroff@0.target.requires/proc-pre-poweroff@0.service" |
| 67 | TARGET="../proc-pre-poweroff@.service" |
| 68 | ln -s $TARGET $LINK |
Andrew Geissler | 4d2fd8d | 2021-06-24 15:28:47 -0500 | [diff] [blame] | 69 | |
| 70 | LINK="$D$systemd_system_unitdir/obmc-host-reset@0.target.requires/op-reset-host-check@0.service" |
| 71 | TARGET="../op-reset-host-check@.service" |
| 72 | ln -s $TARGET $LINK |
Jayanth Othayoth | ad68ba3 | 2021-07-30 06:35:44 -0500 | [diff] [blame] | 73 | |
Jayanth Othayoth | ad68ba3 | 2021-07-30 06:35:44 -0500 | [diff] [blame] | 74 | LINK="$D$systemd_system_unitdir/multi-user.target.wants/phal-import-devtree@0.service" |
| 75 | TARGET="../phal-import-devtree@.service" |
| 76 | ln -s $TARGET $LINK |
Jayanth Othayoth | ce7dbec | 2021-07-30 06:46:57 -0500 | [diff] [blame] | 77 | |
| 78 | mkdir -p $D$systemd_system_unitdir/obmc-host-startmin@0.target.wants |
| 79 | LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.wants/phal-export-devtree@0.service" |
| 80 | TARGET="../phal-export-devtree@.service" |
| 81 | ln -s $TARGET $LINK |
Ramesh Iyyar | d0aedb9 | 2022-02-24 03:35:40 -0600 | [diff] [blame] | 82 | |
| 83 | mkdir -p $D$systemd_system_unitdir/obmc-host-start@0.target.wants |
| 84 | LINK="$D$systemd_system_unitdir/obmc-host-start@0.target.wants/phal-create-boottime-guard-indicator.service" |
| 85 | TARGET="../phal-create-boottime-guard-indicator.service" |
| 86 | ln -s $TARGET $LINK |
| 87 | LINK="$D$systemd_system_unitdir/obmc-host-quiesce@0.target.wants/phal-create-boottime-guard-indicator.service" |
| 88 | ln -s $TARGET $LINK |
Jayanth Othayoth | 633a9cc | 2022-09-12 06:23:45 -0500 | [diff] [blame] | 89 | |
| 90 | mkdir -p $D$systemd_system_unitdir/obmc-host-startmin@0.target.wants |
| 91 | LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.wants/op-clock-data-logger@0.service" |
| 92 | TARGET="../op-clock-data-logger@.service" |
| 93 | ln -s $TARGET $LINK |
Jayanth Othayoth | ad68ba3 | 2021-07-30 06:35:44 -0500 | [diff] [blame] | 94 | fi |
Andrew Geissler | 88eef19 | 2020-12-17 11:37:11 -0600 | [diff] [blame] | 95 | |
Andrew Geissler | aa25e2c | 2021-02-01 14:14:25 -0600 | [diff] [blame] | 96 | # If the memory preserving reboot feature is enabled, set it up |
| 97 | if [ "${@bb.utils.filter('DISTRO_FEATURES', 'mpreboot', d)}" = mpreboot ]; then |
| 98 | # on mpreboot systems, obmc-host-crash@.target is used for mpreboot |
Andrew Geissler | 88eef19 | 2020-12-17 11:37:11 -0600 | [diff] [blame] | 99 | mkdir -p $D$systemd_system_unitdir/obmc-host-crash@0.target.requires |
| 100 | LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/obmc-host-force-warm-reboot@0.target" |
| 101 | TARGET="../obmc-host-force-warm-reboot@.target" |
| 102 | ln -s $TARGET $LINK |
| 103 | |
| 104 | LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/op-enter-mpreboot@0.service" |
| 105 | TARGET="../op-enter-mpreboot@.service" |
| 106 | ln -s $TARGET $LINK |
| 107 | |
Andrew Geissler | aa25e2c | 2021-02-01 14:14:25 -0600 | [diff] [blame] | 108 | # ensure diagnostic mode is shown for MPREBOOT |
Andrew Geissler | 88eef19 | 2020-12-17 11:37:11 -0600 | [diff] [blame] | 109 | LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/obmc-host-diagnostic-mode@0.target" |
| 110 | TARGET="../obmc-host-diagnostic-mode@.target" |
| 111 | ln -s $TARGET $LINK |
| 112 | else |
Andrew Geissler | aa25e2c | 2021-02-01 14:14:25 -0600 | [diff] [blame] | 113 | # If not a mpreboot system, default to quiesce target in crash target to support |
Andrew Geissler | 88eef19 | 2020-12-17 11:37:11 -0600 | [diff] [blame] | 114 | # older system designs like witherspoon |
| 115 | mkdir -p $D$systemd_system_unitdir/obmc-host-crash@0.target.wants |
| 116 | LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.wants/obmc-host-quiesce@0.target" |
| 117 | TARGET="../obmc-host-quiesce@.target" |
| 118 | ln -s $TARGET $LINK |
Ramesh Iyyar | d6d9b54 | 2020-09-17 10:02:08 -0500 | [diff] [blame] | 119 | fi |
Andrew Geissler | 82cfa66 | 2020-02-17 15:11:03 -0600 | [diff] [blame] | 120 | } |
| 121 | |
Adriana Kobylak | 8c6707f | 2021-08-06 17:35:36 +0000 | [diff] [blame] | 122 | pkg_prerm:${PN}() { |
Andrew Geissler | 55bd449 | 2020-03-31 13:43:46 -0500 | [diff] [blame] | 123 | LINK="$D$systemd_system_unitdir/obmc-host-stop@0.target.wants/op-stop-instructions@0.service" |
Andrew Geissler | 82cfa66 | 2020-02-17 15:11:03 -0600 | [diff] [blame] | 124 | rm $LINK |
Andrew Geissler | f95063e | 2020-04-14 15:08:43 -0500 | [diff] [blame] | 125 | LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/op-cfam-reset.service" |
| 126 | rm $LINK |
| 127 | LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.requires/op-cfam-reset.service" |
Andrew Geissler | 82cfa66 | 2020-02-17 15:11:03 -0600 | [diff] [blame] | 128 | rm $LINK |
Andrew Geissler | 4e174d1 | 2020-02-26 14:11:53 -0600 | [diff] [blame] | 129 | # Only uninstall cfam override if p9 system |
| 130 | if [ "${@bb.utils.contains("MACHINE_FEATURES", "p9-cfam-override", "True", "False", d)}" = True ]; then |
| 131 | LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/cfam_override@0.service" |
| 132 | rm $LINK |
| 133 | fi |
Dhruvaraj Subhashchandran | c8aa6a1 | 2020-03-09 13:04:32 -0500 | [diff] [blame] | 134 | LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/op-continue-mpreboot@0.service" |
| 135 | rm $LINK |
Ramesh Iyyar | d6d9b54 | 2020-09-17 10:02:08 -0500 | [diff] [blame] | 136 | |
Andrew Geissler | 88eef19 | 2020-12-17 11:37:11 -0600 | [diff] [blame] | 137 | # Remove phal specific units if enabled |
Patrick Williams | 8c561ee | 2021-10-22 14:20:12 -0500 | [diff] [blame] | 138 | if [ "${@bb.utils.filter('MACHINE_FEATURES', 'phal', d)}" = phal ]; then |
Ramesh Iyyar | d6d9b54 | 2020-09-17 10:02:08 -0500 | [diff] [blame] | 139 | LINK="$D$systemd_system_unitdir/obmc-host-start@0.target.requires/phal-reinit-devtree.service" |
| 140 | rm $LINK |
Chirag Sharma | 5ec16a3 | 2020-12-11 03:45:15 -0600 | [diff] [blame] | 141 | |
| 142 | LINK="$D$systemd_system_unitdir/obmc-chassis-poweroff@0.target.requires/proc-pre-poweroff@0.service" |
| 143 | rm $LINK |
Jayanth Othayoth | ad68ba3 | 2021-07-30 06:35:44 -0500 | [diff] [blame] | 144 | |
| 145 | LINK="$D$systemd_system_unitdir/multi-user.target.wants/phal-import-devtree@0.service" |
| 146 | rm $LINK |
Jayanth Othayoth | ce7dbec | 2021-07-30 06:46:57 -0500 | [diff] [blame] | 147 | |
| 148 | LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.wants/phal-export-devtree@0.service" |
| 149 | rm $LINK |
Ramesh Iyyar | d0aedb9 | 2022-02-24 03:35:40 -0600 | [diff] [blame] | 150 | |
| 151 | LINK="$D$systemd_system_unitdir/obmc-host-start@0.target.wants/phal-create-boottime-guard-indicator.service" |
| 152 | rm $LINK |
| 153 | LINK="$D$systemd_system_unitdir/obmc-host-quiesce@0.target.wants/phal-create-boottime-guard-indicator.service" |
| 154 | rm $LINK |
Jayanth Othayoth | 633a9cc | 2022-09-12 06:23:45 -0500 | [diff] [blame] | 155 | |
| 156 | LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.wants/op-clock-data-logger@0.service" |
| 157 | rm $LINK |
Andrew Geissler | aa25e2c | 2021-02-01 14:14:25 -0600 | [diff] [blame] | 158 | fi |
Andrew Geissler | 88eef19 | 2020-12-17 11:37:11 -0600 | [diff] [blame] | 159 | |
Andrew Geissler | aa25e2c | 2021-02-01 14:14:25 -0600 | [diff] [blame] | 160 | # Remove mpreboot specific units if enabled |
| 161 | if [ "${@bb.utils.filter('DISTRO_FEATURES', 'mpreboot', d)}" = mpreboot ]; then |
Andrew Geissler | 88eef19 | 2020-12-17 11:37:11 -0600 | [diff] [blame] | 162 | LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/obmc-host-force-warm-reboot@0.target" |
| 163 | rm $LINK |
| 164 | |
| 165 | LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/op-enter-mpreboot@0.service" |
| 166 | rm $LINK |
| 167 | else |
| 168 | LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.wants/obmc-host-quiesce@0.target" |
| 169 | rm $LINK |
Ramesh Iyyar | d6d9b54 | 2020-09-17 10:02:08 -0500 | [diff] [blame] | 170 | fi |
Andrew Geissler | 82cfa66 | 2020-02-17 15:11:03 -0600 | [diff] [blame] | 171 | } |