From 08600fd4e89507a44b3e34a0197784a9a0be8c55 Mon Sep 17 00:00:00 2001 From: Conrad Lara - KG6JEI Date: Sun, 5 Apr 2015 21:58:03 -0700 Subject: [PATCH] hardware: Update get_model to use the ar71xx board detect routines Returns the same data for devices as CPUInfo would of returned for previous devices and for new devices like the CPE510 causes the system to list the exact model instead of of the family. --- files/usr/local/bin/get_model | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/files/usr/local/bin/get_model b/files/usr/local/bin/get_model index 6e8cc220..4451ce0d 100755 --- a/files/usr/local/bin/get_model +++ b/files/usr/local/bin/get_model @@ -1,7 +1,11 @@ #!/bin/sh #CMLARA: Temporary shell script for ar71xx platform models -# Just resport what is on the /proc/cpuinfo field --- this will work for most ar71xx devices -# This doesn't work for linksys however since they have multiple devices -#Eventually we will want to to clean this up to a diffrent method +# Return the model of the device -echo `awk 'BEGIN{FS="[ \t]+:[ \t]"} /machine/ {print $2}' /proc/cpuinfo`; +if [ ! -f /tmp/sysinfo/model ]; then + . /lib/functions.sh + . /lib/ar71xx.sh + ar71xx_board_detect +fi + +cat /tmp/sysinfo/model