Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 1 | |
| 2 | # TODO: There are some targets that are chassis oriented, but there is no |
| 3 | # obvious way to map HOST<->CHASSIS relationships. Making an assumption |
| 4 | # currently that there is a 1-to-1 relationship between the two. |
| 5 | |
Patrick Williams | 12fc939 | 2021-08-06 09:16:53 -0500 | [diff] [blame] | 6 | pkg_postinst:${PN}-obmc-targets:append() { |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 7 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 8 | for i in ${OBMC_HOST_INSTANCES}; |
| 9 | do |
| 10 | mkdir -p $D$systemd_system_unitdir/multi-user.target.requires |
| 11 | LINK="$D$systemd_system_unitdir/multi-user.target.requires/obmc-host-reset@${i}.target" |
| 12 | TARGET="../obmc-host-reset@.target" |
| 13 | ln -s $TARGET $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 14 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 15 | LINK="$D$systemd_system_unitdir/multi-user.target.requires/phosphor-discover-system-state@${i}.service" |
| 16 | TARGET="../phosphor-discover-system-state@.service" |
| 17 | ln -s $TARGET $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 18 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 19 | LINK="$D$systemd_system_unitdir/obmc-bmc-service-quiesce@${i}.target" |
| 20 | TARGET="./obmc-bmc-service-quiesce@.target" |
| 21 | ln -s $TARGET $LINK |
Andrew Geissler | 77c0126 | 2022-02-25 19:30:14 +0000 | [diff] [blame] | 22 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 23 | mkdir -p $D$systemd_system_unitdir/obmc-chassis-poweron@${i}.target.wants |
| 24 | LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@${i}.target.wants/phosphor-reset-host-recovery@${i}.service" |
| 25 | TARGET="../phosphor-reset-host-recovery@.service" |
| 26 | ln -s $TARGET $LINK |
Andrew Geissler | ef50c6a | 2021-09-17 18:01:30 +0000 | [diff] [blame] | 27 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 28 | mkdir -p $D$systemd_system_unitdir/obmc-host-start@${i}.target.requires |
| 29 | LINK="$D$systemd_system_unitdir/obmc-host-start@${i}.target.requires/obmc-host-startmin@${i}.target" |
| 30 | TARGET="../obmc-host-startmin@.target" |
| 31 | ln -s $TARGET $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 32 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 33 | LINK="$D$systemd_system_unitdir/obmc-host-start@${i}.target.requires/phosphor-reset-host-reboot-attempts@${i}.service" |
| 34 | TARGET="../phosphor-reset-host-reboot-attempts@.service" |
| 35 | ln -s $TARGET $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 36 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 37 | mkdir -p $D$systemd_system_unitdir/obmc-host-startmin@${i}.target.wants |
| 38 | LINK="$D$systemd_system_unitdir/obmc-host-startmin@${i}.target.wants/phosphor-set-host-transition-to-running@${i}.service" |
| 39 | TARGET="../phosphor-set-host-transition-to-running@.service" |
| 40 | ln -s $TARGET $LINK |
Andrew Geissler | 4ef0e11 | 2021-01-05 16:51:58 -0600 | [diff] [blame] | 41 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 42 | mkdir -p $D$systemd_system_unitdir/obmc-host-stop@${i}.target.wants |
| 43 | LINK="$D$systemd_system_unitdir/obmc-host-stop@${i}.target.wants/phosphor-set-host-transition-to-off@${i}.service" |
| 44 | TARGET="../phosphor-set-host-transition-to-off@.service" |
| 45 | ln -s $TARGET $LINK |
Andrew Geissler | 4ef0e11 | 2021-01-05 16:51:58 -0600 | [diff] [blame] | 46 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 47 | mkdir -p $D$systemd_system_unitdir/obmc-host-reset@${i}.target.requires |
| 48 | LINK="$D$systemd_system_unitdir/obmc-host-reset@${i}.target.requires/phosphor-reset-host-running@${i}.service" |
| 49 | TARGET="../phosphor-reset-host-running@.service" |
| 50 | ln -s $TARGET $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 51 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 52 | mkdir -p $D$systemd_system_unitdir/obmc-host-stop@${i}.target.wants |
| 53 | LINK="$D$systemd_system_unitdir/obmc-host-stop@${i}.target.wants/phosphor-reset-sensor-states@${i}.service" |
| 54 | TARGET="../phosphor-reset-sensor-states@.service" |
| 55 | ln -s $TARGET $LINK |
Andrew Geissler | d3f1e5b | 2020-09-25 09:23:51 -0500 | [diff] [blame] | 56 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 57 | mkdir -p $D$systemd_system_unitdir/obmc-host-quiesce@${i}.target.wants |
| 58 | LINK="$D$systemd_system_unitdir/obmc-host-quiesce@${i}.target.wants/phosphor-reset-sensor-states@${i}.service" |
| 59 | TARGET="../phosphor-reset-sensor-states@.service" |
| 60 | ln -s $TARGET $LINK |
Andrew Geissler | 9c4b92b | 2020-09-25 14:32:57 -0500 | [diff] [blame] | 61 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 62 | mkdir -p $D$systemd_system_unitdir/obmc-host-shutdown@${i}.target.requires |
| 63 | LINK="$D$systemd_system_unitdir/obmc-host-shutdown@${i}.target.requires/obmc-chassis-poweroff@${i}.target" |
| 64 | TARGET="../obmc-chassis-poweroff@.target" |
| 65 | ln -s $TARGET $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 66 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 67 | mkdir -p $D$systemd_system_unitdir/obmc-host-reboot@${i}.target.requires |
| 68 | LINK="$D$systemd_system_unitdir/obmc-host-reboot@${i}.target.requires/obmc-host-shutdown@${i}.target" |
| 69 | TARGET="../obmc-host-shutdown@.target" |
| 70 | ln -s $TARGET $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 71 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 72 | LINK="$D$systemd_system_unitdir/obmc-host-reboot@${i}.target.requires/phosphor-reboot-host@${i}.service" |
| 73 | TARGET="../phosphor-reboot-host@.service" |
| 74 | ln -s $TARGET $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 75 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 76 | mkdir -p $D$systemd_system_unitdir/obmc-host-warm-reboot@${i}.target.requires |
| 77 | LINK="$D$systemd_system_unitdir/obmc-host-warm-reboot@${i}.target.requires/xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service" |
| 78 | TARGET="../xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service" |
| 79 | ln -s $TARGET $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 80 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 81 | mkdir -p $D$systemd_system_unitdir/obmc-host-force-warm-reboot@${i}.target.requires |
| 82 | LINK="$D$systemd_system_unitdir/obmc-host-force-warm-reboot@${i}.target.requires/obmc-host-stop@${i}.target" |
| 83 | TARGET="../obmc-host-stop@.target" |
| 84 | ln -s $TARGET $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 85 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 86 | LINK="$D$systemd_system_unitdir/obmc-host-force-warm-reboot@${i}.target.requires/phosphor-reboot-host@${i}.service" |
| 87 | TARGET="../phosphor-reboot-host@.service" |
| 88 | ln -s $TARGET $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 89 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 90 | LINK="$D$systemd_system_unitdir/obmc-host-warm-reboot@${i}.target.requires/obmc-host-force-warm-reboot@${i}.target" |
| 91 | TARGET="../obmc-host-force-warm-reboot@.target" |
| 92 | ln -s $TARGET $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 93 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 94 | mkdir -p $D$systemd_system_unitdir/obmc-chassis-poweroff@${i}.target.wants |
| 95 | LINK="$D$systemd_system_unitdir/obmc-chassis-poweroff@${i}.target.wants/phosphor-clear-one-time@${i}.service" |
| 96 | TARGET="../phosphor-clear-one-time@.service" |
| 97 | ln -s $TARGET $LINK |
| 98 | done |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 99 | } |
| 100 | |
Andrew Geissler | a02a18a | 2022-02-21 23:00:20 +0000 | [diff] [blame] | 101 | pkg_postinst:${PN}-chassis-check-power-status:append() { |
| 102 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 103 | for i in ${OBMC_HOST_INSTANCES}; |
| 104 | do |
| 105 | mkdir -p $D$systemd_system_unitdir/obmc-chassis-poweron@${i}.target.requires |
| 106 | LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@${i}.target.requires/phosphor-chassis-check-power-status@${i}.service" |
| 107 | TARGET="../phosphor-chassis-check-power-status@.service" |
| 108 | ln -s $TARGET $LINK |
| 109 | done |
Andrew Geissler | a02a18a | 2022-02-21 23:00:20 +0000 | [diff] [blame] | 110 | } |
| 111 | |
Patrick Williams | 12fc939 | 2021-08-06 09:16:53 -0500 | [diff] [blame] | 112 | pkg_prerm:${PN}-obmc-targets:append() { |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 113 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 114 | for i in ${OBMC_HOST_INSTANCES}; |
| 115 | do |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 116 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 117 | LINK="$D$systemd_system_unitdir/multi-user.target.requires/obmc-host-reset@${i}.target" |
| 118 | rm $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 119 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 120 | LINK="$D$systemd_system_unitdir/multi-user.target.requires/phosphor-discover-system-state@${i}.service" |
| 121 | rm $LINK |
Andrew Geissler | ef50c6a | 2021-09-17 18:01:30 +0000 | [diff] [blame] | 122 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 123 | LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@${i}.target.wants/phosphor-reset-host-recovery@${i}.service" |
| 124 | rm $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 125 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 126 | LINK="$D$systemd_system_unitdir/obmc-host-start@${i}.target.requires/obmc-host-startmin@${i}.target" |
| 127 | rm $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 128 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 129 | LINK="$D$systemd_system_unitdir/obmc-host-start@${i}.target.requires/phosphor-reset-host-reboot-attempts@${i}.service" |
| 130 | rm $LINK |
Andrew Geissler | 4ef0e11 | 2021-01-05 16:51:58 -0600 | [diff] [blame] | 131 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 132 | LINK="$D$systemd_system_unitdir/obmc-host-startmin@${i}.target.wants/phosphor-set-host-transition-to-running@${i}.service" |
| 133 | rm $LINK |
Andrew Geissler | 4ef0e11 | 2021-01-05 16:51:58 -0600 | [diff] [blame] | 134 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 135 | LINK="$D$systemd_system_unitdir/obmc-host-stop@${i}.target.wants/phosphor-set-host-transition-to-off@${i}.service" |
| 136 | rm $LINK |
Andrew Geissler | d3f1e5b | 2020-09-25 09:23:51 -0500 | [diff] [blame] | 137 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 138 | LINK="$D$systemd_system_unitdir/obmc-host-stop@${i}.target.wants/phosphor-reset-sensor-states@${i}.service" |
| 139 | rm $LINK |
Andrew Geissler | 9c4b92b | 2020-09-25 14:32:57 -0500 | [diff] [blame] | 140 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 141 | LINK="$D$systemd_system_unitdir/obmc-host-quiesce@${i}.target.wants/phosphor-reset-sensor-states@${i}.service" |
| 142 | rm $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 143 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 144 | LINK="$D$systemd_system_unitdir/obmc-host-reset@${i}.target.requires/phosphor-reset-host-running@${i}.service" |
| 145 | rm $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 146 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 147 | LINK="$D$systemd_system_unitdir/obmc-host-shutdown@${i}.target.requires/obmc-chassis-poweroff@${i}.target" |
| 148 | rm $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 149 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 150 | LINK="$D$systemd_system_unitdir/obmc-host-reboot@${i}.target.requires/obmc-host-shutdown@${i}.target" |
| 151 | rm $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 152 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 153 | LINK="$D$systemd_system_unitdir/obmc-host-reboot@${i}.target.requires/phosphor-reboot-host@${i}.service" |
| 154 | rm $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 155 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 156 | LINK="$D$systemd_system_unitdir/obmc-host-warm-reboot@${i}.target.requires/xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service" |
| 157 | rm $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 158 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 159 | LINK="$D$systemd_system_unitdir/obmc-host-force-warm-reboot@${i}.target.requires/obmc-host-stop@${i}.target" |
| 160 | rm $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 161 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 162 | LINK="$D$systemd_system_unitdir/obmc-host-force-warm-reboot@${i}.target.requires/phosphor-reboot-host@${i}.service" |
| 163 | rm $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 164 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 165 | LINK="$D$systemd_system_unitdir/obmc-host-warm-reboot@${i}.target.requires/obmc-host-force-warm-reboot@${i}.target" |
| 166 | rm $LINK |
| 167 | |
| 168 | LINK="$D$systemd_system_unitdir/obmc-chassis-poweroff@${i}.target.wants/phosphor-clear-one-time@${i}.service" |
| 169 | rm $LINK |
| 170 | |
| 171 | done |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 172 | } |
Andrew Geissler | a02a18a | 2022-02-21 23:00:20 +0000 | [diff] [blame] | 173 | |
| 174 | pkg_prerm:${PN}-chassis-check-power-status:append() { |
| 175 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame^] | 176 | for i in ${OBMC_HOST_INSTANCES}; |
| 177 | do |
| 178 | |
| 179 | LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@${i}.target.requires/phosphor-chassis-check-power-status@${i}.service" |
| 180 | rm $LINK |
| 181 | |
| 182 | done |
Andrew Geissler | a02a18a | 2022-02-21 23:00:20 +0000 | [diff] [blame] | 183 | } |