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 |
Andrew Geissler | e190016 | 2022-03-25 16:10:13 +0000 | [diff] [blame] | 11 | LINK="$D$systemd_system_unitdir/multi-user.target.requires/xyz.openbmc_project.State.Host@${i}.service" |
| 12 | TARGET="../xyz.openbmc_project.State.Host@.service" |
| 13 | ln -s $TARGET $LINK |
| 14 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame] | 15 | LINK="$D$systemd_system_unitdir/multi-user.target.requires/obmc-host-reset@${i}.target" |
| 16 | TARGET="../obmc-host-reset@.target" |
| 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/multi-user.target.requires/phosphor-discover-system-state@${i}.service" |
| 20 | TARGET="../phosphor-discover-system-state@.service" |
| 21 | ln -s $TARGET $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 22 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame] | 23 | LINK="$D$systemd_system_unitdir/obmc-bmc-service-quiesce@${i}.target" |
| 24 | TARGET="./obmc-bmc-service-quiesce@.target" |
| 25 | ln -s $TARGET $LINK |
Andrew Geissler | 77c0126 | 2022-02-25 19:30:14 +0000 | [diff] [blame] | 26 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame] | 27 | mkdir -p $D$systemd_system_unitdir/obmc-chassis-poweron@${i}.target.wants |
| 28 | LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@${i}.target.wants/phosphor-reset-host-recovery@${i}.service" |
| 29 | TARGET="../phosphor-reset-host-recovery@.service" |
| 30 | ln -s $TARGET $LINK |
Andrew Geissler | ef50c6a | 2021-09-17 18:01:30 +0000 | [diff] [blame] | 31 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame] | 32 | mkdir -p $D$systemd_system_unitdir/obmc-host-start@${i}.target.requires |
| 33 | LINK="$D$systemd_system_unitdir/obmc-host-start@${i}.target.requires/obmc-host-startmin@${i}.target" |
| 34 | TARGET="../obmc-host-startmin@.target" |
| 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 | LINK="$D$systemd_system_unitdir/obmc-host-start@${i}.target.requires/phosphor-reset-host-reboot-attempts@${i}.service" |
| 38 | TARGET="../phosphor-reset-host-reboot-attempts@.service" |
| 39 | ln -s $TARGET $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 40 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame] | 41 | mkdir -p $D$systemd_system_unitdir/obmc-host-startmin@${i}.target.wants |
| 42 | LINK="$D$systemd_system_unitdir/obmc-host-startmin@${i}.target.wants/phosphor-set-host-transition-to-running@${i}.service" |
| 43 | TARGET="../phosphor-set-host-transition-to-running@.service" |
| 44 | ln -s $TARGET $LINK |
Andrew Geissler | 4ef0e11 | 2021-01-05 16:51:58 -0600 | [diff] [blame] | 45 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame] | 46 | mkdir -p $D$systemd_system_unitdir/obmc-host-stop@${i}.target.wants |
| 47 | LINK="$D$systemd_system_unitdir/obmc-host-stop@${i}.target.wants/phosphor-set-host-transition-to-off@${i}.service" |
| 48 | TARGET="../phosphor-set-host-transition-to-off@.service" |
| 49 | ln -s $TARGET $LINK |
Andrew Geissler | 4ef0e11 | 2021-01-05 16:51:58 -0600 | [diff] [blame] | 50 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame] | 51 | mkdir -p $D$systemd_system_unitdir/obmc-host-reset@${i}.target.requires |
| 52 | LINK="$D$systemd_system_unitdir/obmc-host-reset@${i}.target.requires/phosphor-reset-host-running@${i}.service" |
| 53 | TARGET="../phosphor-reset-host-running@.service" |
| 54 | ln -s $TARGET $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 55 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame] | 56 | mkdir -p $D$systemd_system_unitdir/obmc-host-stop@${i}.target.wants |
| 57 | LINK="$D$systemd_system_unitdir/obmc-host-stop@${i}.target.wants/phosphor-reset-sensor-states@${i}.service" |
| 58 | TARGET="../phosphor-reset-sensor-states@.service" |
| 59 | ln -s $TARGET $LINK |
Andrew Geissler | d3f1e5b | 2020-09-25 09:23:51 -0500 | [diff] [blame] | 60 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame] | 61 | mkdir -p $D$systemd_system_unitdir/obmc-host-quiesce@${i}.target.wants |
| 62 | LINK="$D$systemd_system_unitdir/obmc-host-quiesce@${i}.target.wants/phosphor-reset-sensor-states@${i}.service" |
| 63 | TARGET="../phosphor-reset-sensor-states@.service" |
| 64 | ln -s $TARGET $LINK |
Andrew Geissler | 9c4b92b | 2020-09-25 14:32:57 -0500 | [diff] [blame] | 65 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame] | 66 | mkdir -p $D$systemd_system_unitdir/obmc-host-shutdown@${i}.target.requires |
| 67 | LINK="$D$systemd_system_unitdir/obmc-host-shutdown@${i}.target.requires/obmc-chassis-poweroff@${i}.target" |
| 68 | TARGET="../obmc-chassis-poweroff@.target" |
| 69 | ln -s $TARGET $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 70 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame] | 71 | mkdir -p $D$systemd_system_unitdir/obmc-host-reboot@${i}.target.requires |
| 72 | LINK="$D$systemd_system_unitdir/obmc-host-reboot@${i}.target.requires/obmc-host-shutdown@${i}.target" |
| 73 | TARGET="../obmc-host-shutdown@.target" |
| 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 | LINK="$D$systemd_system_unitdir/obmc-host-reboot@${i}.target.requires/phosphor-reboot-host@${i}.service" |
| 77 | TARGET="../phosphor-reboot-host@.service" |
| 78 | ln -s $TARGET $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 79 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame] | 80 | mkdir -p $D$systemd_system_unitdir/obmc-host-warm-reboot@${i}.target.requires |
| 81 | LINK="$D$systemd_system_unitdir/obmc-host-warm-reboot@${i}.target.requires/xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service" |
| 82 | TARGET="../xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service" |
| 83 | ln -s $TARGET $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 84 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame] | 85 | mkdir -p $D$systemd_system_unitdir/obmc-host-force-warm-reboot@${i}.target.requires |
| 86 | LINK="$D$systemd_system_unitdir/obmc-host-force-warm-reboot@${i}.target.requires/obmc-host-stop@${i}.target" |
| 87 | TARGET="../obmc-host-stop@.target" |
| 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-force-warm-reboot@${i}.target.requires/phosphor-reboot-host@${i}.service" |
| 91 | TARGET="../phosphor-reboot-host@.service" |
| 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 | LINK="$D$systemd_system_unitdir/obmc-host-warm-reboot@${i}.target.requires/obmc-host-force-warm-reboot@${i}.target" |
| 95 | TARGET="../obmc-host-force-warm-reboot@.target" |
| 96 | ln -s $TARGET $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 97 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame] | 98 | mkdir -p $D$systemd_system_unitdir/obmc-chassis-poweroff@${i}.target.wants |
| 99 | LINK="$D$systemd_system_unitdir/obmc-chassis-poweroff@${i}.target.wants/phosphor-clear-one-time@${i}.service" |
| 100 | TARGET="../phosphor-clear-one-time@.service" |
| 101 | ln -s $TARGET $LINK |
| 102 | done |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 103 | } |
| 104 | |
Patrick Williams | 83a7aa9 | 2022-04-20 13:48:37 -0500 | [diff] [blame^] | 105 | pkg_postinst:${PN}-chassis:append() { |
| 106 | for i in ${OBMC_HOST_INSTANCES}; |
| 107 | do |
| 108 | mkdir -p $D$systemd_system_unitdir/multi-user.target.requires |
| 109 | |
| 110 | LINK="$D$systemd_system_unitdir/multi-user.target.requires/xyz.openbmc_project.State.Chassis@${i}.service" |
| 111 | TARGET="../xyz.openbmc_project.State.Chassis@.service" |
| 112 | ln -s $TARGET $LINK |
| 113 | done |
| 114 | } |
| 115 | |
Andrew Geissler | a02a18a | 2022-02-21 23:00:20 +0000 | [diff] [blame] | 116 | pkg_postinst:${PN}-chassis-check-power-status:append() { |
| 117 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame] | 118 | for i in ${OBMC_HOST_INSTANCES}; |
| 119 | do |
| 120 | mkdir -p $D$systemd_system_unitdir/obmc-chassis-poweron@${i}.target.requires |
| 121 | LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@${i}.target.requires/phosphor-chassis-check-power-status@${i}.service" |
| 122 | TARGET="../phosphor-chassis-check-power-status@.service" |
| 123 | ln -s $TARGET $LINK |
| 124 | done |
Andrew Geissler | a02a18a | 2022-02-21 23:00:20 +0000 | [diff] [blame] | 125 | } |
| 126 | |
Patrick Williams | 12fc939 | 2021-08-06 09:16:53 -0500 | [diff] [blame] | 127 | pkg_prerm:${PN}-obmc-targets:append() { |
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 | for i in ${OBMC_HOST_INSTANCES}; |
| 130 | do |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 131 | |
Andrew Geissler | e190016 | 2022-03-25 16:10:13 +0000 | [diff] [blame] | 132 | LINK="$D$systemd_system_unitdir/multi-user.target.requires/xyz.openbmc_project.State.Host@${i}.service" |
| 133 | rm $LINK |
| 134 | |
| 135 | LINK="$D$systemd_system_unitdir/multi-user.target.requires/xyz.openbmc_project.State.Chassis@${i}.service" |
| 136 | rm $LINK |
| 137 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame] | 138 | LINK="$D$systemd_system_unitdir/multi-user.target.requires/obmc-host-reset@${i}.target" |
| 139 | rm $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 140 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame] | 141 | LINK="$D$systemd_system_unitdir/multi-user.target.requires/phosphor-discover-system-state@${i}.service" |
| 142 | rm $LINK |
Andrew Geissler | ef50c6a | 2021-09-17 18:01:30 +0000 | [diff] [blame] | 143 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame] | 144 | LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@${i}.target.wants/phosphor-reset-host-recovery@${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-start@${i}.target.requires/obmc-host-startmin@${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-start@${i}.target.requires/phosphor-reset-host-reboot-attempts@${i}.service" |
| 151 | rm $LINK |
Andrew Geissler | 4ef0e11 | 2021-01-05 16:51:58 -0600 | [diff] [blame] | 152 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame] | 153 | LINK="$D$systemd_system_unitdir/obmc-host-startmin@${i}.target.wants/phosphor-set-host-transition-to-running@${i}.service" |
| 154 | rm $LINK |
Andrew Geissler | 4ef0e11 | 2021-01-05 16:51:58 -0600 | [diff] [blame] | 155 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame] | 156 | LINK="$D$systemd_system_unitdir/obmc-host-stop@${i}.target.wants/phosphor-set-host-transition-to-off@${i}.service" |
| 157 | rm $LINK |
Andrew Geissler | d3f1e5b | 2020-09-25 09:23:51 -0500 | [diff] [blame] | 158 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame] | 159 | LINK="$D$systemd_system_unitdir/obmc-host-stop@${i}.target.wants/phosphor-reset-sensor-states@${i}.service" |
| 160 | rm $LINK |
Andrew Geissler | 9c4b92b | 2020-09-25 14:32:57 -0500 | [diff] [blame] | 161 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame] | 162 | LINK="$D$systemd_system_unitdir/obmc-host-quiesce@${i}.target.wants/phosphor-reset-sensor-states@${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-reset@${i}.target.requires/phosphor-reset-host-running@${i}.service" |
| 166 | rm $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 167 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame] | 168 | LINK="$D$systemd_system_unitdir/obmc-host-shutdown@${i}.target.requires/obmc-chassis-poweroff@${i}.target" |
| 169 | rm $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 170 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame] | 171 | LINK="$D$systemd_system_unitdir/obmc-host-reboot@${i}.target.requires/obmc-host-shutdown@${i}.target" |
| 172 | rm $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 173 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame] | 174 | LINK="$D$systemd_system_unitdir/obmc-host-reboot@${i}.target.requires/phosphor-reboot-host@${i}.service" |
| 175 | rm $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 176 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame] | 177 | LINK="$D$systemd_system_unitdir/obmc-host-warm-reboot@${i}.target.requires/xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service" |
| 178 | rm $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 179 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame] | 180 | LINK="$D$systemd_system_unitdir/obmc-host-force-warm-reboot@${i}.target.requires/obmc-host-stop@${i}.target" |
| 181 | rm $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 182 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame] | 183 | LINK="$D$systemd_system_unitdir/obmc-host-force-warm-reboot@${i}.target.requires/phosphor-reboot-host@${i}.service" |
| 184 | rm $LINK |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 185 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame] | 186 | LINK="$D$systemd_system_unitdir/obmc-host-warm-reboot@${i}.target.requires/obmc-host-force-warm-reboot@${i}.target" |
| 187 | rm $LINK |
| 188 | |
| 189 | LINK="$D$systemd_system_unitdir/obmc-chassis-poweroff@${i}.target.wants/phosphor-clear-one-time@${i}.service" |
| 190 | rm $LINK |
| 191 | |
| 192 | done |
Andrew Geissler | 20cff70 | 2020-03-09 16:51:27 -0500 | [diff] [blame] | 193 | } |
Andrew Geissler | a02a18a | 2022-02-21 23:00:20 +0000 | [diff] [blame] | 194 | |
Patrick Williams | 83a7aa9 | 2022-04-20 13:48:37 -0500 | [diff] [blame^] | 195 | pkg_prerm:${PN}-chassis:append() { |
| 196 | for i in ${OBMC_HOST_INSTANCES}; |
| 197 | do |
| 198 | |
| 199 | LINK="$D$systemd_system_unitdir/multi-user.target.requires/xyz.openbmc_project.State.Chassis@${i}.service" |
| 200 | rm $LINK |
| 201 | |
| 202 | done |
| 203 | } |
| 204 | |
Andrew Geissler | a02a18a | 2022-02-21 23:00:20 +0000 | [diff] [blame] | 205 | pkg_prerm:${PN}-chassis-check-power-status:append() { |
| 206 | |
Patrick Williams | 4c7b3e6 | 2022-03-09 15:56:34 -0600 | [diff] [blame] | 207 | for i in ${OBMC_HOST_INSTANCES}; |
| 208 | do |
| 209 | |
| 210 | LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@${i}.target.requires/phosphor-chassis-check-power-status@${i}.service" |
| 211 | rm $LINK |
| 212 | |
| 213 | done |
Andrew Geissler | a02a18a | 2022-02-21 23:00:20 +0000 | [diff] [blame] | 214 | } |