qualcomm.sh: generalize to select correct board data file
Generalize script to select the correct board data file to load into the wireless chip depending on the Regulatory Domain configuration whether it is a variation of 'bdwlan30.bin' or 'fakeboar.bin'. If 'bdwlan30_US.bin' or 'bdwlan30_World.bin' files are found in the firmware directory, the script will create two symlinks, 'bdwlan30.bin and 'utfbd30.bin', pointing to either one of those files. If no 'bdwlan30_*.bin' files are found, but 'fakeboar_US.bin' or 'fakeboar_World.bin' is, it will create a single symlink, 'fakeboar.bin', pointing to either one of those files. In the case a QCA6574 community driver is loaded, 'board.bin' symlink will be updated. If no 'fakeboard_*.bin' files are found either, the script will exit. https://jira.digi.com/browse/DEL-6773 Signed-off-by: Gonzalo Ruiz <Gonzalo.Ruiz@digi.com>
This commit is contained in:
parent
8342e948c6
commit
224c4fc418
|
|
@ -80,14 +80,33 @@ esac
|
||||||
(
|
(
|
||||||
cd "${FIRMWARE_DIR}"
|
cd "${FIRMWARE_DIR}"
|
||||||
|
|
||||||
BDATA_SOURCE="bdwlan30_US.bin"
|
if [ -f "bdwlan30_US.bin" ] || [ -f "bdwlan30_World.bin" ]; then
|
||||||
|
BDATA_US="bdwlan30_US.bin"
|
||||||
|
BDATA_WW="bdwlan30_World.bin"
|
||||||
|
BDATA_LINK="bdwlan30.bin"
|
||||||
|
UTFBDATA_LINK="utfbd30.bin"
|
||||||
|
elif [ -f "fakeboar_US.bin" ] || [ -f "fakeboar_World.bin" ]; then
|
||||||
|
BDATA_US="fakeboar_US.bin"
|
||||||
|
BDATA_WW="fakeboar_World.bin"
|
||||||
|
# Use different links for propietary and community drivers
|
||||||
|
if [ -f "board.bin" ]; then
|
||||||
|
BDATA_LINK="board.bin"
|
||||||
|
else
|
||||||
|
BDATA_LINK="fakeboar.bin"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
log "5" "[ERROR] Could not locate board data files"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
BDATA_SOURCE="${BDATA_US}"
|
||||||
case "${REGULATORY_DOMAIN}" in
|
case "${REGULATORY_DOMAIN}" in
|
||||||
${US_CODE})
|
${US_CODE})
|
||||||
log "5" "Setting US wireless region";;
|
log "5" "Setting US wireless region";;
|
||||||
${WW_CODE}|${JP_CODE})
|
${WW_CODE}|${JP_CODE})
|
||||||
if [ -f "bdwlan30_World.bin" ]; then
|
if [ -f "${BDATA_WW}" ]; then
|
||||||
log "5" "Setting WW (world wide) wireless region"
|
log "5" "Setting WW (world wide) wireless region"
|
||||||
BDATA_SOURCE="bdwlan30_World.bin"
|
BDATA_SOURCE="${BDATA_WW}"
|
||||||
else
|
else
|
||||||
log "5" "[WARN] No WW (worldwide) board data file, using US"
|
log "5" "[WARN] No WW (worldwide) board data file, using US"
|
||||||
fi
|
fi
|
||||||
|
|
@ -98,12 +117,16 @@ esac
|
||||||
log "5" "[WARN] Invalid region code, using US";;
|
log "5" "[WARN] Invalid region code, using US";;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# We don't want to rewrite NAND every time we boot so only
|
# When defined, update the links only if they are wrong so we don't
|
||||||
# change the links if they are wrong.
|
# rewrite the internal memory every time we boot
|
||||||
BDATA_LINK="bdwlan30.bin"
|
if [ -n "${BDATA_LINK}" ] &&
|
||||||
UTFBDATA_LINK="utfbd30.bin"
|
([ ! -f "${BDATA_LINK}" ] ||
|
||||||
if [ ! -e "${BDATA_LINK}" ] || ! cmp -s "${BDATA_LINK}" "${BDATA_SOURCE}"; then
|
! cmp -s "${BDATA_LINK}" "${BDATA_SOURCE}"); then
|
||||||
ln -sf "${BDATA_SOURCE}" "${BDATA_LINK}"
|
ln -sf "${BDATA_SOURCE}" "${BDATA_LINK}"
|
||||||
|
fi
|
||||||
|
if [ -n "${UTFBDATA_LINK}" ] &&
|
||||||
|
([ ! -f "${UTFBDATA_LINK}" ] ||
|
||||||
|
! cmp -s "${UTFBDATA_LINK}" "${BDATA_SOURCE}"); then
|
||||||
ln -sf "${BDATA_SOURCE}" "${UTFBDATA_LINK}"
|
ln -sf "${BDATA_SOURCE}" "${UTFBDATA_LINK}"
|
||||||
fi
|
fi
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue