1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
Author: "P. J. McDermott" <pj@pehjota.net>
Subject: uname: Make uname_info.os configurable.
This thread reminded me to make this correction:
http://lists.busybox.net/pipermail/busybox/2013-September/079749.html
diff -Naur src.orig/coreutils/Config.src src/coreutils/Config.src
--- src.orig/coreutils/Config.src 2013-05-11 19:30:43.000000000 -0400
+++ src/coreutils/Config.src 2013-09-20 17:49:16.357733865 -0400
@@ -673,6 +673,16 @@
help
uname is used to print system information.
+config FEATURE_UNAME_OS
+ string "Operating system name"
+ default "BusyBox/Linux"
+ depends on UNAME
+ help
+ This is the operating system name as reported with the -o and -a
+ options.
+
+ This should be changed if BusyBox isn't your main userspace.
+
config UNEXPAND
bool "unexpand"
default y
diff -Naur src.orig/coreutils/uname.c src/coreutils/uname.c
--- src.orig/coreutils/uname.c 2013-05-11 19:30:43.000000000 -0400
+++ src/coreutils/uname.c 2013-09-20 18:12:05.186067343 -0400
@@ -62,7 +62,8 @@
//usage:
//usage:#define uname_example_usage
//usage: "$ uname -a\n"
-//usage: "Linux debian 2.4.23 #2 Tue Dec 23 17:09:10 MST 2003 i686 GNU/Linux\n"
+//usage: "Linux debian 2.4.23 #2 Tue Dec 23 17:09:10 MST 2003 i686 "
+//usage: CONFIG_FEATURE_UNAME_OS "\n"
#include "libbb.h"
/* After libbb.h, since it needs sys/types.h on some systems */
@@ -72,7 +72,7 @@
struct utsname name;
char processor[sizeof(((struct utsname*)NULL)->machine)];
char platform[sizeof(((struct utsname*)NULL)->machine)];
- char os[sizeof("GNU/Linux")];
+ char os[sizeof(CONFIG_FEATURE_UNAME_OS)];
} uname_info_t;
static const char options[] ALIGN1 = "snrvmpioa";
@@ -139,7 +139,7 @@
#endif
strcpy(uname_info.processor, unknown_str);
strcpy(uname_info.platform, unknown_str);
- strcpy(uname_info.os, "GNU/Linux");
+ strcpy(uname_info.os, CONFIG_FEATURE_UNAME_OS);
#if 0
/* Fedora does something like this */
strcpy(uname_info.processor, uname_info.name.machine);
|