meta-digi-arm: Update atheros init script to make it platform independent.

Another option would be to split it up in machine folders, but it is
similar enough in all platforms not to need this for the time being.

Signed-off-by: Alex Gonzalez <alex.gonzalez@digi.com>
This commit is contained in:
Alex Gonzalez 2013-05-16 10:48:45 +02:00
parent 02a3bc1fad
commit cc17072c91
1 changed files with 15 additions and 11 deletions

View File

@ -53,18 +53,22 @@ if ! cmp -s ${RAM_DRIVE}/${MAC_FILENAME} ${FIRMWARE_DIR}/${MAC_FILENAME}; then
fi fi
rm -f ${RAM_DRIVE}/${MAC_FILENAME} rm -f ${RAM_DRIVE}/${MAC_FILENAME}
# Figure out which wireless region we are in. The US has rules for BDATA_SOURCE=Digi_6203-6233-World.bin
# what channels can be used and at what power level. We use a different set of if [ -e "/sys/kernel/machine/name" ]; then
# rules for the other regions in the world that we sell into. The mod_cert field # Figure out which wireless region we are in. The US has rules for
# in OTP will be set to 0x0 for the US. Once we know the region, make sure the # what channels can be used and at what power level. We use a different set of
# appropriate calibration file is loaded. # rules for the other regions in the world that we sell into. The mod_cert field
# # in OTP will be set to 0x0 for the US. Once we know the region, make sure the
US_CODE="0x0" # appropriate calibration file is loaded.
REGION_CODE="$(cat /sys/kernel/ccardimx28/mod_cert)" #
if [ -z "${REGION_CODE}" -o "${US_CODE}" = "${REGION_CODE}" ]; then US_CODE="0x0"
BDATA_SOURCE=Digi_6203-6233-US.bin MACHINE="$(cat /sys/kernel/machine/name)"
REGION_CODE="$(cat /sys/kernel/${MACHINE}/mod_cert)"
if [ -z "${REGION_CODE}" -o "${US_CODE}" = "${REGION_CODE}" ]; then
BDATA_SOURCE=Digi_6203-6233-US.bin
fi
else else
BDATA_SOURCE=Digi_6203-6233-World.bin logger -t atheros "Undefined machine, defaulting to world region."
fi fi
# We don't want to rewrite NAND every time we boot so only # We don't want to rewrite NAND every time we boot so only