summaryrefslogtreecommitdiffstats
path: root/init/util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'init/util.cpp')
-rw-r--r--init/util.cpp33
1 files changed, 0 insertions, 33 deletions
diff --git a/init/util.cpp b/init/util.cpp
index c805083..8b238d4 100644
--- a/init/util.cpp
+++ b/init/util.cpp
@@ -400,39 +400,6 @@ void open_devnull_stdio(void)
exit(1);
}
-void get_hardware_name(char *hardware, unsigned int *revision) {
- // Hardware string was provided on kernel command line.
- if (hardware[0]) {
- return;
- }
-
- FILE* fp = fopen("/proc/cpuinfo", "re");
- if (fp == NULL) {
- return;
- }
- char buf[1024];
- while (fgets(buf, sizeof(buf), fp) != NULL) {
- if (strncmp(buf, "Hardware", 8) == 0) {
- const char* hw = strstr(buf, ": ");
- if (hw) {
- hw += 2;
- size_t n = 0;
- while (*hw) {
- if (!isspace(*hw)) {
- hardware[n++] = tolower(*hw);
- }
- hw++;
- if (n == 31) break;
- }
- hardware[n] = 0;
- }
- } else if (strncmp(buf, "Revision", 8) == 0) {
- sscanf(buf, "Revision : %ux", revision);
- }
- }
- fclose(fp);
-}
-
void import_kernel_cmdline(int in_qemu,
void (*import_kernel_nv)(char *name, int in_qemu))
{