blob: a3b729ec7242ca13e496cddb729ea50bdcf3b57a [file] [log] [blame]
Andrew Geissleree126002021-02-01 16:17:23 -06001pkg_postinst_${PN}_append() {
2 mkdir -p $D$systemd_system_unitdir/obmc-host-crash@0.target.wants
3 mkdir -p $D$systemd_system_unitdir/obmc-host-timeout@0.target.wants
4
Andrew Geissler13140542021-02-01 16:26:18 -06005 # The obmc-host-crash target is repurposed for the memory preserving reboot
6 # feature when it is enabled. If not enabled, then install the standard
7 # debug collector checkstop service for basic error reporting
8 if [ "${@bb.utils.filter('DISTRO_FEATURES', 'mpreboot', d)}" != mpreboot ]; then
9 LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.wants/openpower-debug-collector-checkstop@0.service"
10 TARGET="../openpower-debug-collector-checkstop@.service"
11 ln -s $TARGET $LINK
12 fi
Andrew Geissleree126002021-02-01 16:17:23 -060013
14 LINK="$D$systemd_system_unitdir/obmc-host-timeout@0.target.wants/openpower-debug-collector-watchdog@0.service"
15 TARGET="../openpower-debug-collector-watchdog@.service"
16 ln -s $TARGET $LINK
17
18 LINK="$D$systemd_system_unitdir/obmc-host-timeout@0.target.wants/openpower-debug-collector-watchdog-timeout@0.service"
19 TARGET="../openpower-debug-collector-watchdog-timeout.service"
20 ln -s $TARGET $LINK
21}
22
23pkg_prerm_${PN}_append() {
Andrew Geissler13140542021-02-01 16:26:18 -060024 if [ "${@bb.utils.filter('DISTRO_FEATURES', 'mpreboot', d)}" != mpreboot ]; then
25 LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.wants/openpower-debug-collector-checkstop@0.service"
26 rm $LINK
27 fi
Andrew Geissleree126002021-02-01 16:17:23 -060028 LINK="$D$systemd_system_unitdir/obmc-host-timeout@0.target.wants/openpower-debug-collector-watchdog@0.service"
29 rm $LINK
30 LINK="$D$systemd_system_unitdir/obmc-host-timeout@0.target.wants/openpower-debug-collector-watchdog-timeout@0.service"
31 rm $LINK
32}