From c48b19bbe127551ffb2b6d02b33ef78865341cfc Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 15 Jan 2015 12:17:21 +0100 Subject: [PATCH] system: attempt to parse /proc/device-tree/model Fallback to /proc/device-tree/model if /tmp/sysinfo/model is not available. Signed-off-by: Jo-Philipp Wich --- system.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system.c b/system.c index 1e88b5d..cdb5434 100644 --- a/system.c +++ b/system.c @@ -78,7 +78,8 @@ static int system_board(struct ubus_context *ctx, struct ubus_object *obj, fclose(f); } - if ((f = fopen("/tmp/sysinfo/model", "r")) != NULL) + if ((f = fopen("/tmp/sysinfo/model", "r")) != NULL || + (f = fopen("/proc/device-tree/model", "r")) != NULL) { if (fgets(line, sizeof(line), f)) { -- 2.11.0