# HG changeset patch # User Pascal Bellard # Date 1520261579 -3600 # Node ID 33f17372d8e602ebb4cdbf46b5ed644fdf4533c1 # Parent 1f1f942f34049390853a272682851cd29d0de758 busybox: add arch (uname -m alias) diff -r 1f1f942f3404 -r 33f17372d8e6 busybox/receipt --- a/busybox/receipt Mon Mar 05 13:05:36 2018 +0100 +++ b/busybox/receipt Mon Mar 05 15:52:59 2018 +0100 @@ -49,6 +49,7 @@ ash.u httpd.u df.u +arch.u EOT cp $stuff/$PACKAGE-${VERSION%.*}.config .config } diff -r 1f1f942f3404 -r 33f17372d8e6 busybox/stuff/busybox-1.27-arch.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/busybox/stuff/busybox-1.27-arch.u Mon Mar 05 15:52:59 2018 +0100 @@ -0,0 +1,47 @@ +--- busybox-1.27.2/coreutils/uname.c.org ++++ busybox-1.27.2/coreutils/uname.c +@@ -55,10 +55,18 @@ + //config: help + //config: Sets the operating system name reported by uname -o. The + //config: default is "GNU/Linux". ++//config: ++//config:config ARCH_ALIAS ++//config: bool "arch alias" ++//config: default y ++//config: help ++//config: arch is an alias to uname -m. + +-//applet:IF_UNAME(APPLET(uname, BB_DIR_BIN, BB_SUID_DROP)) ++//applet:IF_UNAME(APPLET_NOEXEC(uname, uname, BB_DIR_BIN, BB_SUID_DROP, uname)) ++//applet:IF_ARCH_ALIAS(APPLET_NOEXEC(arch, uname, BB_DIR_BIN, BB_SUID_DROP, arch)) + + //kbuild:lib-$(CONFIG_UNAME) += uname.o ++//kbuild:lib-$(CONFIG_ARCH_ALIAS) += uname.o + + /* BB_AUDIT SUSv3 compliant */ + /* http://www.opengroup.org/onlinepubs/007904975/utilities/uname.html */ +@@ -80,6 +88,11 @@ + //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: ++//usage:#define arch_trivial_usage ++//usage: ++//usage:#define arch_full_usage "\n\n" ++//usage: "arch is an alias for uname -m" + + #include "libbb.h" + /* After libbb.h, since it needs sys/types.h on some systems */ +@@ -147,6 +160,12 @@ + toprint = 1; + } + ++ if (ENABLE_ARCH_ALIAS ++ && (!ENABLE_UNAME || !applet_name[4]) ++ ) { /* we are "arch" */ ++ toprint = (1 << 4); ++ } ++ + uname(&uname_info.name); /* never fails */ + + #if defined(__sparc__) && defined(__linux__) diff -r 1f1f942f3404 -r 33f17372d8e6 busybox/stuff/busybox-1.27.config --- a/busybox/stuff/busybox-1.27.config Mon Mar 05 13:05:36 2018 +0100 +++ b/busybox/stuff/busybox-1.27.config Mon Mar 05 15:52:59 2018 +0100 @@ -321,6 +321,7 @@ CONFIG_TTY=y CONFIG_UNAME=y CONFIG_UNAME_OSNAME="GNU/Linux" +CONFIG_ARCH_ALIAS=y CONFIG_UNIQ=y # CONFIG_UNLINK is not set CONFIG_USLEEP=y diff -r 1f1f942f3404 -r 33f17372d8e6 busybox/stuff/busybox-1.27.config-ssfs --- a/busybox/stuff/busybox-1.27.config-ssfs Mon Mar 05 13:05:36 2018 +0100 +++ b/busybox/stuff/busybox-1.27.config-ssfs Mon Mar 05 15:52:59 2018 +0100 @@ -321,6 +321,7 @@ CONFIG_TTY=y CONFIG_UNAME=y CONFIG_UNAME_OSNAME="GNU/Linux" +CONFIG_ARCH_ALIAS=y CONFIG_UNIQ=y # CONFIG_UNLINK is not set CONFIG_USLEEP=y diff -r 1f1f942f3404 -r 33f17372d8e6 busybox/stuff/busybox-1.27.config-static --- a/busybox/stuff/busybox-1.27.config-static Mon Mar 05 13:05:36 2018 +0100 +++ b/busybox/stuff/busybox-1.27.config-static Mon Mar 05 15:52:59 2018 +0100 @@ -321,6 +321,7 @@ CONFIG_TTY=y # CONFIG_UNAME is not set CONFIG_UNAME_OSNAME="" +# CONFIG_ARCH_ALIAS is not set # CONFIG_UNIQ is not set # CONFIG_UNLINK is not set # CONFIG_USLEEP is not set