summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko2017-08-04 02:22:17 +0200
committerDenys Vlasenko2017-08-04 02:22:17 +0200
commit21e5d0f841cfb1bee8751983c9a2bd199ec9eb75 (patch)
treee2076f629845f7986d1ef48d26e8ac36f8f7f36a
parentcf792a58abc4fc55d0622333d0eb17c6a80dc497 (diff)
downloadbusybox-21e5d0f841cfb1bee8751983c9a2bd199ec9eb75.zip
busybox-21e5d0f841cfb1bee8751983c9a2bd199ec9eb75.tar.gz
config: FEDORA_COMPAT option (so far only tweaks uname)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--Config.in13
-rw-r--r--coreutils/uname.c2
2 files changed, 14 insertions, 1 deletions
diff --git a/Config.in b/Config.in
index cfb3aa0..1359848 100644
--- a/Config.in
+++ b/Config.in
@@ -33,6 +33,19 @@ config EXTRA_COMPAT
some GNU extensions in libc. You probably only need this option
if you plan to run busybox on desktop.
+config FEDORA_COMPAT
+ bool "Building for Fedora distribution"
+ default n
+ help
+ This option makes some tools behave like they do on Fedora.
+
+ At the time of this writing (2017-08) this only affects uname:
+ normally, uname -p (processor) and uname -i (platform)
+ are shown as "unknown", but with this option uname -p
+ shows the same string as uname -m (machine type),
+ and so does uname -i unless machine type is i486/i586/i686 -
+ then uname -i shows "i386".
+
config INCLUDE_SUSv2
bool "Enable obsolete features removed before SUSv3"
default y
diff --git a/coreutils/uname.c b/coreutils/uname.c
index 4d98fde..0c0b85c 100644
--- a/coreutils/uname.c
+++ b/coreutils/uname.c
@@ -157,7 +157,7 @@ int uname_main(int argc UNUSED_PARAM, char **argv)
strcpy(uname_info.processor, unknown_str);
strcpy(uname_info.platform, unknown_str);
strcpy(uname_info.os, CONFIG_UNAME_OSNAME);
-#if 0
+#if ENABLE_FEDORA_COMPAT
/* Fedora does something like this */
strcpy(uname_info.processor, uname_info.name.machine);
strcpy(uname_info.platform, uname_info.name.machine);