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 | |
| 9 | RDEPENDS_${PN} += "op-proc-control" |
| 10 | RDEPENDS_${PN} += "phosphor-state-manager-obmc-targets" |
| 11 | |
| 12 | ALLOW_EMPTY_${PN} = "1" |
| 13 | |
| 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 |
Ramesh Iyyar | d6d9b54 | 2020-09-17 10:02:08 -0500 | [diff] [blame] | 51 | if [ "${@bb.utils.filter('OBMC_MACHINE_FEATURES', 'phal', d)}" = phal ]; then |
| 52 | 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 Sharma | 5ec16a3 | 2020-12-11 03:45:15 -0600 | [diff] [blame] | 56 | |
| 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 Geissler | 4d2fd8d | 2021-06-24 15:28:47 -0500 | [diff] [blame] | 60 | |
| 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 |
Andrew Geissler | aa25e2c | 2021-02-01 14:14:25 -0600 | [diff] [blame] | 64 | fi |
Andrew Geissler | 88eef19 | 2020-12-17 11:37:11 -0600 | [diff] [blame] | 65 | |
Andrew Geissler | aa25e2c | 2021-02-01 14:14:25 -0600 | [diff] [blame] | 66 | # If the memory preserving reboot feature is enabled, set it up |
| 67 | if [ "${@bb.utils.filter('DISTRO_FEATURES', 'mpreboot', d)}" = mpreboot ]; then |
| 68 | # on mpreboot systems, obmc-host-crash@.target is used for mpreboot |
Andrew Geissler | 88eef19 | 2020-12-17 11:37:11 -0600 | [diff] [blame] | 69 | mkdir -p $D$systemd_system_unitdir/obmc-host-crash@0.target.requires |
| 70 | LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/obmc-host-force-warm-reboot@0.target" |
| 71 | TARGET="../obmc-host-force-warm-reboot@.target" |
| 72 | ln -s $TARGET $LINK |
| 73 | |
| 74 | LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/op-enter-mpreboot@0.service" |
| 75 | TARGET="../op-enter-mpreboot@.service" |
| 76 | ln -s $TARGET $LINK |
| 77 | |
Andrew Geissler | aa25e2c | 2021-02-01 14:14:25 -0600 | [diff] [blame] | 78 | # ensure diagnostic mode is shown for MPREBOOT |
Andrew Geissler | 88eef19 | 2020-12-17 11:37:11 -0600 | [diff] [blame] | 79 | LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/obmc-host-diagnostic-mode@0.target" |
| 80 | TARGET="../obmc-host-diagnostic-mode@.target" |
| 81 | ln -s $TARGET $LINK |
| 82 | else |
Andrew Geissler | aa25e2c | 2021-02-01 14:14:25 -0600 | [diff] [blame] | 83 | # 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] | 84 | # older system designs like witherspoon |
| 85 | mkdir -p $D$systemd_system_unitdir/obmc-host-crash@0.target.wants |
| 86 | LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.wants/obmc-host-quiesce@0.target" |
| 87 | TARGET="../obmc-host-quiesce@.target" |
| 88 | ln -s $TARGET $LINK |
Ramesh Iyyar | d6d9b54 | 2020-09-17 10:02:08 -0500 | [diff] [blame] | 89 | fi |
Andrew Geissler | 82cfa66 | 2020-02-17 15:11:03 -0600 | [diff] [blame] | 90 | } |
| 91 | |
| 92 | pkg_prerm_${PN}() { |
Andrew Geissler | 55bd449 | 2020-03-31 13:43:46 -0500 | [diff] [blame] | 93 | 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] | 94 | rm $LINK |
Andrew Geissler | f95063e | 2020-04-14 15:08:43 -0500 | [diff] [blame] | 95 | LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/op-cfam-reset.service" |
| 96 | rm $LINK |
| 97 | 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] | 98 | rm $LINK |
Andrew Geissler | 4e174d1 | 2020-02-26 14:11:53 -0600 | [diff] [blame] | 99 | # Only uninstall cfam override if p9 system |
| 100 | if [ "${@bb.utils.contains("MACHINE_FEATURES", "p9-cfam-override", "True", "False", d)}" = True ]; then |
| 101 | LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/cfam_override@0.service" |
| 102 | rm $LINK |
| 103 | fi |
Dhruvaraj Subhashchandran | c8aa6a1 | 2020-03-09 13:04:32 -0500 | [diff] [blame] | 104 | LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.requires/op-continue-mpreboot@0.service" |
| 105 | rm $LINK |
Ramesh Iyyar | d6d9b54 | 2020-09-17 10:02:08 -0500 | [diff] [blame] | 106 | |
Andrew Geissler | 88eef19 | 2020-12-17 11:37:11 -0600 | [diff] [blame] | 107 | # Remove phal specific units if enabled |
Ramesh Iyyar | d6d9b54 | 2020-09-17 10:02:08 -0500 | [diff] [blame] | 108 | if [ "${@bb.utils.filter('OBMC_MACHINE_FEATURES', 'phal', d)}" = phal ]; then |
| 109 | LINK="$D$systemd_system_unitdir/obmc-host-start@0.target.requires/phal-reinit-devtree.service" |
| 110 | rm $LINK |
Chirag Sharma | 5ec16a3 | 2020-12-11 03:45:15 -0600 | [diff] [blame] | 111 | |
| 112 | LINK="$D$systemd_system_unitdir/obmc-chassis-poweroff@0.target.requires/proc-pre-poweroff@0.service" |
| 113 | rm $LINK |
Andrew Geissler | aa25e2c | 2021-02-01 14:14:25 -0600 | [diff] [blame] | 114 | fi |
Andrew Geissler | 88eef19 | 2020-12-17 11:37:11 -0600 | [diff] [blame] | 115 | |
Andrew Geissler | aa25e2c | 2021-02-01 14:14:25 -0600 | [diff] [blame] | 116 | # Remove mpreboot specific units if enabled |
| 117 | if [ "${@bb.utils.filter('DISTRO_FEATURES', 'mpreboot', d)}" = mpreboot ]; then |
Andrew Geissler | 88eef19 | 2020-12-17 11:37:11 -0600 | [diff] [blame] | 118 | LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/obmc-host-force-warm-reboot@0.target" |
| 119 | rm $LINK |
| 120 | |
| 121 | LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/op-enter-mpreboot@0.service" |
| 122 | rm $LINK |
| 123 | else |
| 124 | LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.wants/obmc-host-quiesce@0.target" |
| 125 | rm $LINK |
Ramesh Iyyar | d6d9b54 | 2020-09-17 10:02:08 -0500 | [diff] [blame] | 126 | fi |
Andrew Geissler | 82cfa66 | 2020-02-17 15:11:03 -0600 | [diff] [blame] | 127 | } |