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