Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions system.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,22 @@ static int system_board(struct ubus_context *ctx, struct ubus_object *obj,
if (rootfs_type)
blobmsg_add_string(&b, "rootfs_type", rootfs_type);

if ((f = fopen("/tmp/sysinfo/image_type", "r")) != NULL)
Comment thread
efahl marked this conversation as resolved.
{
/* Strictly optional, don't try to guess if it is
* not explicit.
*/
if (fgets(line, sizeof(line), f))
{
Comment thread
efahl marked this conversation as resolved.
val = strtok(line, "\t\n");

if (val)
blobmsg_add_string(&b, "image_type", val);
}

fclose(f);
}

if ((f = fopen("/usr/lib/os-release", "r")) != NULL)
{
c = blobmsg_open_table(&b, "release");
Expand Down