From: Daniel Golle Date: Thu, 8 Jun 2017 20:21:27 +0000 (+0200) Subject: system: return legacy board name X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fprocd.git;a=commitdiff_plain;h=79bbe6daf70feb27ec0e2060b86852015cd04465;hp=e7bb2c8d631862e1535cf6eead18387f02a69ad2 system: return legacy board name The system board call returns the verbose model string instead of the board name. Unfortunately we have not yet estabkushed clear convention regarding device-tree 'compatible' or 'model' property and sysupgrade image name (same accounts for scraping /proc/cpuinfo on legacy targets). This is odd as the idea was to return information needed to identify the right sysupgrade image. On most targets we got a large shell-script which translates either /proc/cpuinfo or the 'model' property back into the board name used here. Hence /tmp/sysinfo/board_name should be returned instead of /tmp/sysinfo/model for the board ubus call as well. Signed-off-by: Daniel Golle --- diff --git a/system.c b/system.c index 8b8cdbc..4bbceee 100644 --- a/system.c +++ b/system.c @@ -80,7 +80,7 @@ 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/board_name", "r")) != NULL || (f = fopen("/proc/device-tree/model", "r")) != NULL) { if (fgets(line, sizeof(line), f))