Skip to content

Commit dab23b5

Browse files
committed
Improved device model detection
1 parent 24bc229 commit dab23b5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

scripts/common/filesystem.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ ROOT_PROC="${ROOT_PATH}/proc"
5656
ROOT_ROOT="${ROOT_PATH}/root"
5757
ROOT_SRV="${ROOT_PATH}/srv"
5858
ROOT_SYS="${ROOT_PATH}/sys"
59+
ROOT_SYS_DEVICES="${ROOT_SYS}/devices"
5960
ROOT_USR="${ROOT_PATH}/usr"
6061

6162
[ "${DISTRO_FAMILY}" = 'Android' ] && ROOT_USR="${ROOT_PATH}"

scripts/common/system-info.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,9 @@ function get_arch_family() {
178178
}
179179

180180
function get_device_model() {
181-
if [ -f "${ROOT_PROC}/device-tree/model" ]; then
181+
if [ -f "${ROOT_SYS_DEVICES}/virtual/dmi/id/product_family" ]; then
182+
cat "${ROOT_SYS_DEVICES}/virtual/dmi/id/product_family"
183+
elif [ -f "${ROOT_PROC}/device-tree/model" ]; then
182184
local DEVICE_MODEL=$(cat -A "${ROOT_PROC}/device-tree/model")
183185

184186
if echo "${DEVICE_MODEL}" | grep -q "Raspberry Pi 3"; then

0 commit comments

Comments
 (0)