cloudconnector: set 'MACHINE' as the default device type
If 'CC_DEVICE_TYPE' is not defined or it is empty use 'MACHINE' as the device type in the Cloud Connector configuration file. This commit also limits its length to a maximum of 255 characters. https://onedigi.atlassian.net/browse/DEL-8531 Signed-off-by: Tatiana Leon <Tatiana.Leon@digi.com>
This commit is contained in:
parent
82877e9840
commit
6e30a8127e
|
|
@ -15,6 +15,8 @@ CC_GITHUB = "gitsm://github.com/digi-embedded/cc_dey.git;protocol=https"
|
||||||
|
|
||||||
CC_GIT_URI ?= "${@oe.utils.conditional('DIGI_INTERNAL_GIT', '1' , '${CC_STASH}', '${CC_GITHUB}', d)}"
|
CC_GIT_URI ?= "${@oe.utils.conditional('DIGI_INTERNAL_GIT', '1' , '${CC_STASH}', '${CC_GITHUB}', d)}"
|
||||||
|
|
||||||
|
CC_DEVICE_TYPE ?= "${MACHINE}"
|
||||||
|
|
||||||
SRC_URI = " \
|
SRC_URI = " \
|
||||||
${CC_GIT_URI};branch=${SRCBRANCH} \
|
${CC_GIT_URI};branch=${SRCBRANCH} \
|
||||||
file://cloud-connector-init \
|
file://cloud-connector-init \
|
||||||
|
|
@ -37,6 +39,11 @@ do_install() {
|
||||||
install -d ${D}${sysconfdir}/init.d/
|
install -d ${D}${sysconfdir}/init.d/
|
||||||
install -m 755 ${WORKDIR}/cloud-connector-init ${D}${sysconfdir}/cloud-connector
|
install -m 755 ${WORKDIR}/cloud-connector-init ${D}${sysconfdir}/cloud-connector
|
||||||
ln -sf /etc/cloud-connector ${D}${sysconfdir}/init.d/cloud-connector
|
ln -sf /etc/cloud-connector ${D}${sysconfdir}/init.d/cloud-connector
|
||||||
|
|
||||||
|
# Set the device type. Its maximum length is 255 characters
|
||||||
|
[ -z "${CC_DEVICE_TYPE}" ] && device_type="${MACHINE}" || device_type="${CC_DEVICE_TYPE}"
|
||||||
|
device_type="$(echo "${device_type}" | cut -c1-255)"
|
||||||
|
sed -i "/device_type = .*/c\device_type = \"${device_type}\"" ${D}${sysconfdir}/cc.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
do_install:append:ccimx6ul() {
|
do_install:append:ccimx6ul() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue