From 3709f784674dec5d05abca72822ff7d0078fcf6f Mon Sep 17 00:00:00 2001 From: Daniil Klimuk Date: Thu, 7 Nov 2024 17:15:56 +0100 Subject: [PATCH] recipes-go: 3mdeb-rtectrl: instal flash.sh for releases 0.8.x Signed-off-by: Daniil Klimuk --- .../3mdeb-rtectrl/3mdeb-rtectrl_git.bbappend | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/recipes-go/3mdeb-rtectrl/3mdeb-rtectrl_git.bbappend b/recipes-go/3mdeb-rtectrl/3mdeb-rtectrl_git.bbappend index 35ece41..613082d 100644 --- a/recipes-go/3mdeb-rtectrl/3mdeb-rtectrl_git.bbappend +++ b/recipes-go/3mdeb-rtectrl/3mdeb-rtectrl_git.bbappend @@ -1,15 +1,23 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" +check_distro_ver() { + local _distro_version="${DISTRO_VERSION}" + + [ $(echo "$_distro_version" | grep '0.8.[0-9]*') ] && echo True || echo False + + return 0 +} + SRC_URI:append = " \ file://RteCtrl.cfg \ file://RteCtrl.service \ - file://flash.sh \ + ${@ '' if bb.build.exec_func("check_distro_ver", d) else 'file://flash.sh'} \ " FILES:${PN} += " \ ${sysconfdir}/RteCtrl.cfg \ ${systemd_unitdir}/system/RteCtrl.service \ - ${sbindir}/flash.sh \ + ${@ '' if bb.build.exec_func("check_distro_ver", d) else '${sbindir}/flash.sh'} \ " do_install:append() { @@ -20,8 +28,14 @@ do_install:append() { install -d ${D}${systemd_unitdir}/system/ install -m 0644 ${WORKDIR}/RteCtrl.service ${D}${systemd_unitdir}/system/ - install -d ${D}${sbindir} - install -m 0755 ${WORKDIR}/flash.sh ${D}${sbindir}/ + # We need flash.sh only on images with distro version >= 0.8.0-rc1: + [ $(echo "${DISTRO_VERSION}" | grep '0.8.[0-9]*') ] && install -d ${D}${sbindir} + [ $(echo "${DISTRO_VERSION}" | grep '0.8.[0-9]*') ] && install -m 0755 ${WORKDIR}/flash.sh ${D}${sbindir}/ + + # The output of above test command should be overwritten with 0, otherwise in + # case test return 1 - do_install will return 1 as well, and, therefore, + # fail. + return 0 } SYSTEMD_PACKAGES = "${PN}"