-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add openwrt version information and exclude it from autobackups
- Loading branch information
Showing
6 changed files
with
64 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include <stdint.h> | ||
#include <stdio.h> | ||
#include <string.h> | ||
|
||
#include <fcntl.h> | ||
#include <sys/ioctl.h> | ||
#include <unistd.h> | ||
|
||
#include "chipid.h" | ||
#include "tools.h" | ||
#include "vendors/openwrt.h" | ||
|
||
bool is_openwrt_board() { | ||
if (!access("/etc/openwrt_version", 0)) { | ||
strcpy(board_manufacturer, "OpenWrt"); | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
static bool detect_openwrt_product() { | ||
char buf[256]; | ||
|
||
if (!get_regex_line_from_file("/etc/openwrt_version", "(.+)", buf, | ||
sizeof(buf))) { | ||
return false; | ||
} | ||
strcpy(board_ver, buf); | ||
return true; | ||
} | ||
|
||
void gather_openwrt_board_info() { detect_openwrt_product(); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#ifndef OPENWRT_H | ||
#define OPENWRT_H | ||
|
||
#include <stdbool.h> | ||
|
||
void gather_openwrt_board_info(); | ||
bool is_openwrt_board(); | ||
|
||
#endif /* OPENWRT_H */ |