summaryrefslogtreecommitdiff
path: root/recipes-bsp/multitech/mt-dt-overlay/init
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2022-02-02 19:24:16 -0600
committerJohn Klug <john.klug@multitech.com>2022-02-03 10:12:17 -0600
commit45eed7d6952c19e586b3d71d7f3789f0132bd278 (patch)
treec543b1b5b906f714e6fcb1b26f22055d4ac09670 /recipes-bsp/multitech/mt-dt-overlay/init
parent9a6d513b5c8397c4de6dcf37af90a6550a83f95b (diff)
downloadmeta-multitech-45eed7d6952c19e586b3d71d7f3789f0132bd278.tar.gz
meta-multitech-45eed7d6952c19e586b3d71d7f3789f0132bd278.tar.bz2
meta-multitech-45eed7d6952c19e586b3d71d7f3789f0132bd278.zip
Fix GPS on MTCDTIP2
Diffstat (limited to 'recipes-bsp/multitech/mt-dt-overlay/init')
-rwxr-xr-xrecipes-bsp/multitech/mt-dt-overlay/init26
1 files changed, 14 insertions, 12 deletions
diff --git a/recipes-bsp/multitech/mt-dt-overlay/init b/recipes-bsp/multitech/mt-dt-overlay/init
index 2112edc..00af9f8 100755
--- a/recipes-bsp/multitech/mt-dt-overlay/init
+++ b/recipes-bsp/multitech/mt-dt-overlay/init
@@ -49,14 +49,17 @@ install_dtbo_dir() {
# [flag]
# [file1] [file2] [file3]
setdevtree() {
- hwlin=$(mts-id-eeprom --in-file "$eepromPath" 2>/dev/null | grep '^hw-version:')
- [[ $hwlin =~ hw-version:[[:space:]]*\"([^\"]+) ]]
+ eeprom=$(mts-id-eeprom --in-file "$eepromPath" 2>/dev/null)
+ [[ $eeprom =~ [[:space:]]hw-version:[[:space:]]*\"([^\"]+) ]]
hw=${BASH_REMATCH[1]}
mach=${hw/%-*}
rev=${hw/#*-/}
echo mach is $mach
echo rev is $rev
- capd="${sysdir}/capability"
+
+ regx='capa-(.*):[[:space:]]*true'
+ capflags=$(echo "$eeprom" | egrep "$regx" | sed -e 's/capa-//g' -e 's/: true//')
+ capflags=" ${capflags} "
# add device tree overlays, if they exist.
[[ -d /lib/dtoverlays ]] || return 1
@@ -83,15 +86,14 @@ setdevtree() {
if [[ -d capability ]] ; then
cd capability
for d in * ; do
- if [[ -f ${capd}/$d ]] ; then
- if (($(cat ${capd}/$d) == 1)) ; then
- echo "This device has capabilithy $d"
- (
- cd $d
- install_dtbo_dir
- )
- fi # Install dtbo files for a capability
- fi # Does a given capability flag exist in the mts-io platform
+ echo "We have found overlay capability directory $d"
+ if [[ ${capflags} =~ [[:space:]]${d}[[:space:]] ]] ; then
+ echo "This device has capabilithy $d so install the overlay"
+ (
+ cd $d
+ install_dtbo_dir
+ )
+ fi # Does a given capability flag exist in the EEPROM
done # Loop over all capabilities for this machine and version overlays
fi # Is there a capability directory to be installed?
)