Brandon Kim | 1e42709 | 2021-08-10 15:46:03 -0700 | [diff] [blame] | 1 | FILESEXTRAPATHS:prepend:gbs := "${THISDIR}/${PN}:" |
George Hung | b5eef51 | 2021-03-10 16:04:46 +0800 | [diff] [blame] | 2 | |
Brandon Kim | 1e42709 | 2021-08-10 15:46:03 -0700 | [diff] [blame] | 3 | SRC_URI:append:gbs = " \ |
George Hung | b5eef51 | 2021-03-10 16:04:46 +0800 | [diff] [blame] | 4 | file://gbs-host-s0-set-failsafe.service \ |
| 5 | file://gbs-host-s5-set-failsafe.service \ |
| 6 | file://gbs-host-set-boot-failsafe@.service \ |
| 7 | file://gbs-check-host-state.service \ |
| 8 | file://gbs-set-boot-failsafe.sh \ |
| 9 | file://gbs-set-failsafe.sh \ |
| 10 | file://gbs-check-host-state.sh \ |
| 11 | file://gbs-host-ready.target \ |
| 12 | " |
| 13 | |
Brandon Kim | 1e42709 | 2021-08-10 15:46:03 -0700 | [diff] [blame] | 14 | RDEPENDS:${PN}:append:gbs = "bash" |
George Hung | b5eef51 | 2021-03-10 16:04:46 +0800 | [diff] [blame] | 15 | |
| 16 | CHASSIS_INSTANCE="0" |
| 17 | |
Brandon Kim | 1e42709 | 2021-08-10 15:46:03 -0700 | [diff] [blame] | 18 | SYSTEMD_SERVICE:${PN}:append:gbs = " \ |
George Hung | b5eef51 | 2021-03-10 16:04:46 +0800 | [diff] [blame] | 19 | gbs-host-s0-set-failsafe.service \ |
| 20 | gbs-host-s5-set-failsafe.service \ |
George Hung | b5eef51 | 2021-03-10 16:04:46 +0800 | [diff] [blame] | 21 | gbs-check-host-state.service \ |
| 22 | gbs-host-ready.target \ |
| 23 | " |
| 24 | |
Brandon Kim | 1e42709 | 2021-08-10 15:46:03 -0700 | [diff] [blame] | 25 | FILES:${PN}:append:gbs = " \ |
George Hung | b5eef51 | 2021-03-10 16:04:46 +0800 | [diff] [blame] | 26 | ${systemd_system_unitdir}/gbs-host-set-boot-failsafe@.service \ |
| 27 | " |
| 28 | |
Brandon Kim | 1e42709 | 2021-08-10 15:46:03 -0700 | [diff] [blame] | 29 | do_install:append:gbs() { |
George Hung | b5eef51 | 2021-03-10 16:04:46 +0800 | [diff] [blame] | 30 | install -d ${D}${bindir} |
| 31 | |
| 32 | install -m 0755 ${WORKDIR}/gbs-set-failsafe.sh ${D}${bindir}/. |
| 33 | install -m 0755 ${WORKDIR}/gbs-set-boot-failsafe.sh ${D}${bindir}/. |
| 34 | install -m 0755 ${WORKDIR}/gbs-check-host-state.sh ${D}${bindir}/. |
| 35 | |
| 36 | install -d ${D}${systemd_system_unitdir} |
| 37 | install -m 0644 ${WORKDIR}/gbs-host-s0-set-failsafe.service ${D}${systemd_system_unitdir} |
| 38 | install -m 0644 ${WORKDIR}/gbs-host-s5-set-failsafe.service ${D}${systemd_system_unitdir} |
| 39 | install -m 0644 ${WORKDIR}/gbs-host-set-boot-failsafe@.service ${D}${systemd_system_unitdir} |
| 40 | install -m 0644 ${WORKDIR}/gbs-check-host-state.service ${D}${systemd_system_unitdir} |
| 41 | install -m 0644 ${WORKDIR}/gbs-host-ready.target ${D}${systemd_system_unitdir} |
| 42 | } |
Andrew Geissler | 838105d | 2023-06-29 11:34:00 -0500 | [diff] [blame] | 43 | |
| 44 | pkg_postinst:${PN}:append() { |
| 45 | mkdir -p $D$systemd_system_unitdir/gbs-host-ready.target.wants |
| 46 | for i in ${OBMC_CHASSIS_INSTANCES}; |
| 47 | do |
| 48 | LINK="$D$systemd_system_unitdir/gbs-host-ready.target.wants/gbs-host-set-boot-failsafe@${i}.service" |
| 49 | TARGET="../gbs-host-set-boot-failsafe@.service" |
| 50 | ln -s $TARGET $LINK |
| 51 | done |
| 52 | } |
| 53 | pkg_prerm:${PN}:append() { |
| 54 | for i in ${OBMC_CHASSIS_INSTANCES}; |
| 55 | do |
| 56 | LINK="$D$systemd_system_unitdir/gbs-host-ready.target.wants/gbs-host-set-boot-failsafe@${i}.service" |
| 57 | rm $LINK |
| 58 | done |
| 59 | } |