diff options
author | Ron Yorston <rmy@frippery.org> | 2015-07-12 16:06:37 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2015-08-03 18:09:18 +0200 |
commit | 64ed5f0d3c5eefbb208d4a334654834c78be2cbd (patch) | |
tree | 78b7a32dfb2162234c9c70b982317d9f2aa520df | |
parent | b27cf31003774e5aa13491ccb8f1f0721dc5b920 (diff) | |
download | busybox-w32-64ed5f0d3c5eefbb208d4a334654834c78be2cbd.tar.gz busybox-w32-64ed5f0d3c5eefbb208d4a334654834c78be2cbd.tar.bz2 busybox-w32-64ed5f0d3c5eefbb208d4a334654834c78be2cbd.zip |
uname: make OS name configurable
A mailing list thread in September 2013 discussed changing the string
returned by the non-POSIX 'uname -o' option. Nothing ever came of this
because there was no agreement as to what the string should be.
Make the string configurable so that people can decide for themselves.
Signed-off-by: Ron Yorston <rmy@frippery.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | coreutils/Config.src | 8 | ||||
-rw-r--r-- | coreutils/uname.c | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/coreutils/Config.src b/coreutils/Config.src index 02155d220..ffbef1a31 100644 --- a/coreutils/Config.src +++ b/coreutils/Config.src | |||
@@ -630,6 +630,14 @@ config UNAME | |||
630 | help | 630 | help |
631 | uname is used to print system information. | 631 | uname is used to print system information. |
632 | 632 | ||
633 | config UNAME_OSNAME | ||
634 | string "Operating system name" | ||
635 | default "GNU/Linux" | ||
636 | depends on UNAME | ||
637 | help | ||
638 | Sets the operating system name reported by uname -o. The | ||
639 | default is "GNU/Linux". | ||
640 | |||
633 | config UNEXPAND | 641 | config UNEXPAND |
634 | bool "unexpand" | 642 | bool "unexpand" |
635 | default y | 643 | default y |
diff --git a/coreutils/uname.c b/coreutils/uname.c index 1c6aa5f79..fd677d27c 100644 --- a/coreutils/uname.c +++ b/coreutils/uname.c | |||
@@ -74,7 +74,7 @@ typedef struct { | |||
74 | struct utsname name; | 74 | struct utsname name; |
75 | char processor[sizeof(((struct utsname*)NULL)->machine)]; | 75 | char processor[sizeof(((struct utsname*)NULL)->machine)]; |
76 | char platform[sizeof(((struct utsname*)NULL)->machine)]; | 76 | char platform[sizeof(((struct utsname*)NULL)->machine)]; |
77 | char os[sizeof("GNU/Linux")]; | 77 | char os[sizeof(CONFIG_UNAME_OSNAME)]; |
78 | } uname_info_t; | 78 | } uname_info_t; |
79 | 79 | ||
80 | static const char options[] ALIGN1 = "snrvmpioa"; | 80 | static const char options[] ALIGN1 = "snrvmpioa"; |
@@ -141,7 +141,7 @@ int uname_main(int argc UNUSED_PARAM, char **argv) | |||
141 | #endif | 141 | #endif |
142 | strcpy(uname_info.processor, unknown_str); | 142 | strcpy(uname_info.processor, unknown_str); |
143 | strcpy(uname_info.platform, unknown_str); | 143 | strcpy(uname_info.platform, unknown_str); |
144 | strcpy(uname_info.os, "GNU/Linux"); | 144 | strcpy(uname_info.os, CONFIG_UNAME_OSNAME); |
145 | #if 0 | 145 | #if 0 |
146 | /* Fedora does something like this */ | 146 | /* Fedora does something like this */ |
147 | strcpy(uname_info.processor, uname_info.name.machine); | 147 | strcpy(uname_info.processor, uname_info.name.machine); |