Skip to content

Commit

Permalink
used /proc/cpuinfo as alternative hardware model query in init host and
Browse files Browse the repository at this point in the history
help.cgi.
  • Loading branch information
jens-maus committed Nov 3, 2023
1 parent 8951b56 commit 12283e4
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
5 changes: 5 additions & 0 deletions buildroot-external/overlay/base/etc/init.d/S01InitHost
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ identify_host() {
PNAME=$(cat /sys/devices/virtual/dmi/id/product_name)
fi
HWMODEL="${VENDOR} ${PNAME}"
else
MODEL=$(cat /proc/cpuinfo | grep ^Model | cut -d" " -f2-)
if [[ "${MODEL}" != "" ]]; then
HWMODEL=${MODEL}
fi
fi

# identify HM_HOST based on PLATFORM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ identify_host() {
PNAME=$(cat /sys/devices/virtual/dmi/id/product_name)
fi
HWMODEL="${VENDOR} ${PNAME}"
else
MODEL=$(cat /proc/cpuinfo | grep ^Model | cut -d" " -f2-)
if [[ "${MODEL}" != "" ]]; then
HWMODEL=${MODEL}
fi
fi

# identify HM_HOST based on PLATFORM
Expand Down
15 changes: 10 additions & 5 deletions buildroot-external/patches/occu/0001-RaspberryMatic.patch
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@
# set HOMEMATIC_URL "http://www.homematic.com"
set HOMEMATIC_URL "http://www.eq-3.de"
set HOMEMATIC_IP_URL "https://www.homematic-ip.com"
@@ -19,13 +19,129 @@
@@ -19,13 +19,134 @@
set LANGUAGE "de"
set CUR_YEAR [clock format [clock seconds] -format %Y]

Expand Down Expand Up @@ -265,7 +265,7 @@
+
+ # get all variables from /VERSION into ver array
+ loadVarsFromShellFile /VERSION ver
+
+ # get all variables from /etc/config/netconfig into net array
+ loadVarsFromShellFile /etc/config/netconfig net
+
Expand Down Expand Up @@ -293,8 +293,13 @@
+ execCmd PNAME {exec cat /sys/devices/virtual/dmi/id/product_name}
+ }
+ set HWMODEL "$VENDOR $PNAME"
+ } else {
+ execCmd MODEL {exec grep ^Model /proc/cpuinfo | cut -d: -f2 | xargs}
+ if {$MODEL != ""} {
+ set HWMODEL $MODEL
+ }
+ }
+
+ execCmd CPUMODEL {exec lscpu | grep "Model name:" | cut -d: -f2 | xargs echo -n}
+ execCmd NUMCPU {exec nproc}
+ execCmd LOADAVG {exec awk {{ printf $1 " " $2 " " $3 }} /proc/loadavg}
Expand Down Expand Up @@ -354,7 +359,7 @@

set sid ""
catch {import sid}
@@ -43,47 +159,84 @@
@@ -43,47 +164,84 @@
</script>
}
}
Expand Down Expand Up @@ -472,7 +477,7 @@

puts "</table>"

@@ -124,7 +277,7 @@
@@ -124,7 +282,7 @@
puts "\}"

puts "loadExtHelp = function()\{"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ proc action_put_page {} {
execCmd PNAME {exec cat /sys/devices/virtual/dmi/id/product_name}
}
set HWMODEL "$VENDOR $PNAME"
} else {
execCmd MODEL {exec grep ^Model /proc/cpuinfo | cut -d: -f2 | xargs}
if {$MODEL != ""} {
set HWMODEL $MODEL
}
}

execCmd CPUMODEL {exec lscpu | grep "Model name:" | cut -d: -f2 | xargs echo -n}
Expand Down

0 comments on commit 12283e4

Please sign in to comment.