Skip to content

Commit

Permalink
recipes-go: 3mdeb-rtectrl: instal flash.sh for releases 0.8.x
Browse files Browse the repository at this point in the history
Signed-off-by: Daniil Klimuk <[email protected]>
  • Loading branch information
DaniilKl committed Nov 7, 2024
1 parent b09e9b7 commit 3709f78
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions recipes-go/3mdeb-rtectrl/3mdeb-rtectrl_git.bbappend
Original file line number Diff line number Diff line change
@@ -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() {
Expand All @@ -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}"
Expand Down

0 comments on commit 3709f78

Please sign in to comment.