diff options
author | Chris Boot <bootc@bootc.net> | 2018-07-07 21:22:54 +0100 |
---|---|---|
committer | Chris Boot <bootc@bootc.net> | 2018-07-07 21:22:54 +0100 |
commit | 0d4be2ff4aab1003e555be8d6e889345982bb85f (patch) | |
tree | 6ca9f68b9c52f6369b7dfb2096bc32de785b9bba /scripts | |
parent | 3134d6a64094832efa051375aa77b82eec289b69 (diff) | |
parent | 10a38174403c44760c1941424f4e540075e59696 (diff) |
New upstream version 1.29.0
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.IMA | 3 | ||||
-rwxr-xr-x | scripts/bb_release | 22 | ||||
-rw-r--r-- | scripts/echo.c | 2 | ||||
-rw-r--r-- | scripts/kconfig/conf.c | 56 | ||||
-rw-r--r-- | scripts/kconfig/confdata.c | 4 | ||||
-rw-r--r-- | scripts/kconfig/mconf.c | 4 | ||||
-rwxr-xr-x | scripts/randomtest | 9 | ||||
-rwxr-xr-x | scripts/randomtest.loop | 1 | ||||
-rw-r--r-- | scripts/test_setenv_leak.c | 18 | ||||
-rwxr-xr-x | scripts/trylink | 18 |
10 files changed, 110 insertions, 27 deletions
diff --git a/scripts/Makefile.IMA b/scripts/Makefile.IMA index 0eced2982..f155108d7 100644 --- a/scripts/Makefile.IMA +++ b/scripts/Makefile.IMA @@ -115,6 +115,9 @@ lib-y:= include debianutils/Kbuild lib-all-y += $(patsubst %,debianutils/%,$(sort $(lib-y))) lib-y:= +include klibc-utils/Kbuild +lib-all-y += $(patsubst %,klibc-utils/%,$(sort $(lib-y))) +lib-y:= include runit/Kbuild lib-all-y += $(patsubst %,runit/%,$(sort $(lib-y))) lib-y:= diff --git a/scripts/bb_release b/scripts/bb_release index 8aa380438..2e146bf84 100755 --- a/scripts/bb_release +++ b/scripts/bb_release @@ -15,20 +15,8 @@ VERSION=`ls busybox-*.tar.gz | sed 's/busybox-\(.*\)\.tar\.gz/\1/'` zcat busybox-$VERSION.tar.gz | bzip2 > busybox-$VERSION.tar.bz2 -test -f busybox-$VERSION.tar.gz || { echo "no busybox-$VERSION.tar.gz"; exit 1; } -test -f busybox-$VERSION.tar.bz2 || { echo "no busybox-$VERSION.tar.bz2"; exit 1; } - -signit() -{ -echo "$1 released `date -r $1 -R` - -MD5: `md5sum $1` -SHA1: `sha1sum $1` - -To verify this signature, you can obtain my public key -from http://busybox.net/~vda/vda_pubkey.gpg -" | gpg --clearsign > "$1.sign" -} - -signit busybox-$VERSION.tar.gz -signit busybox-$VERSION.tar.bz2 +for releasefile in busybox-$VERSION.tar.gz busybox-$VERSION.tar.bz2; do + test -f $releasefile || { echo "no $releasefile"; exit 1; } + gpg --detach-sign $releasefile + sha256sum $releasefile > $releasefile.sha256 +done diff --git a/scripts/echo.c b/scripts/echo.c index cb207ae05..8c6b409d3 100644 --- a/scripts/echo.c +++ b/scripts/echo.c @@ -214,7 +214,7 @@ int main(int argc, char **argv) * may be used to endorse or promote products derived from this software * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ''AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index ea2446a89..57734b590 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c @@ -76,14 +76,53 @@ static void conf_askvalue(struct symbol *sym, const char *def) line[0] = '\n'; line[1] = 0; + line[2] = 0; if (!sym_is_changable(sym)) { printf("%s\n", def); - line[0] = '\n'; - line[1] = 0; return; } + // If autoconf run (allnoconfig and such), reset bool and tristates: + // "select ITEM" sets ITEM=y and then parent item might have been + // reset to "n" later. Try to set ITEM to "n" on the second run. + if (type == S_BOOLEAN || type == S_TRISTATE) { + switch (input_mode) { + case set_yes: + if (sym_tristate_within_range(sym, yes)) { + line[0] = 'y'; + line[1] = '\n'; + printf("%s", line); + return; + } + case set_mod: + if (type == S_TRISTATE) { + if (sym_tristate_within_range(sym, mod)) { + line[0] = 'm'; + line[1] = '\n'; + printf("%s", line); + return; + } + } else { + if (sym_tristate_within_range(sym, yes)) { + line[0] = 'y'; + line[1] = '\n'; + printf("%s", line); + return; + } + } + case set_no: + if (sym_tristate_within_range(sym, no)) { + line[0] = 'n'; + line[1] = '\n'; + printf("%s", line); + return; + } + default: // placate compiler + break; + } + } + switch (input_mode) { case set_no: case set_mod: @@ -590,6 +629,19 @@ int main(int ac, char **av) if (input_mode != ask_silent) { rootEntry = &rootmenu; conf(&rootmenu); + // If autoconf run (allnoconfig and such), run it twice: + // "select ITEM" sets ITEM=y and then parent item + // is reset to "n" later. Second run sets ITEM to "n". + // Example: ADDUSER selects LONG_OPTS. + // allnoconfig must set _both_ to "n". + // Before, LONG_OPTS remained "y". + if (input_mode == set_no + || input_mode == set_mod + || input_mode == set_yes + ) { + rootEntry = &rootmenu; + conf(&rootmenu); + } if (input_mode == ask_all) { input_mode = ask_silent; valid_stdin = 1; diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 8f4ecbd33..b05b96e45 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -334,7 +334,9 @@ int conf_write(const char *name) struct symbol *sym; struct menu *menu; const char *basename; - char dirname[128], tmpname[128], newname[128]; + char dirname[128]; + char tmpname[256]; + char newname[256]; int type, l; const char *str; time_t now; diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index 006d03708..adba1141b 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c @@ -27,6 +27,10 @@ #include <unistd.h> #include <locale.h> +#ifndef SIGWINCH +#define SIGWINCH 28 +#endif + #define LKC_DIRECT_LINK #include "lkc.h" diff --git a/scripts/randomtest b/scripts/randomtest index 1809838a4..94709a99f 100755 --- a/scripts/randomtest +++ b/scripts/randomtest @@ -52,18 +52,25 @@ echo '# CONFIG_RFKILL is not set' >>.config if test x"$LIBC" = x"glibc"; then cat .config \ | grep -v CONFIG_STATIC \ + | grep -v CONFIG_FEATURE_LIBBUSYBOX_STATIC \ \ | grep -v CONFIG_FEATURE_2_4_MODULES \ | grep -v CONFIG_FEATURE_USE_BSS_TAIL \ | grep -v CONFIG_DEBUG_SANITIZE \ + | grep -v CONFIG_FEATURE_MOUNT_NFS \ + | grep -v CONFIG_FEATURE_INETD_RPC \ >.config.new mv .config.new .config echo '# CONFIG_STATIC is not set' >>.config + echo '# CONFIG_FEATURE_LIBBUSYBOX_STATIC is not set' >>.config # newer glibc (at least 2.23) no longer supply query_module() ABI. # People who target 2.4 kernels would likely use older glibc (and older bbox). echo '# CONFIG_FEATURE_2_4_MODULES is not set' >>.config echo '# CONFIG_FEATURE_USE_BSS_TAIL is not set' >>.config echo '# CONFIG_DEBUG_SANITIZE is not set' >>.config + # 2018: current glibc versions no longer include rpc/rpc.h + echo '# CONFIG_FEATURE_MOUNT_NFS is not set' >>.config + echo '# CONFIG_FEATURE_INETD_RPC is not set' >>.config fi # If uclibc, build static, and remove some things @@ -84,6 +91,7 @@ if test x"$LIBC" = x"uclibc"; then | grep -v CONFIG_UNSHARE \ | grep -v CONFIG_FALLOCATE \ | grep -v CONFIG_UDHCPC6 \ + | grep -v CONFIG_NSLOOKUP \ | grep -v CONFIG_ASH_INTERNAL_GLOB \ >.config.new mv .config.new .config @@ -101,6 +109,7 @@ if test x"$LIBC" = x"uclibc"; then echo '# CONFIG_UNSHARE is not set' >>.config echo '# CONFIG_FALLOCATE is not set' >>.config echo '# CONFIG_UDHCPC6 is not set' >>.config + echo '# CONFIG_NSLOOKUP is not set' >>.config echo 'CONFIG_ASH_INTERNAL_GLOB=y' >>.config fi diff --git a/scripts/randomtest.loop b/scripts/randomtest.loop index 4d14b652f..edfbc5c58 100755 --- a/scripts/randomtest.loop +++ b/scripts/randomtest.loop @@ -66,6 +66,7 @@ while sleep 1; do continue fi fi + grep -i 'warning:' "$dir/make.log" rm -rf -- "$dir" let cnt++ done diff --git a/scripts/test_setenv_leak.c b/scripts/test_setenv_leak.c new file mode 100644 index 000000000..e51722ca7 --- /dev/null +++ b/scripts/test_setenv_leak.c @@ -0,0 +1,18 @@ +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +int main(int argc, char **argv) +{ + char buf[256]; + + int i = argv[1] ? atoi(argv[1]) : 999999; + while (--i > 0) { + sprintf(buf, "%d", i); + setenv("VAR", buf, 1); + } + printf("Check size of [heap] mapping:\n"); + freopen("/proc/self/maps", "r", stdin); + while (fgets(buf, sizeof(buf), stdin)) + fputs(buf, stdout); + return 0; +} diff --git a/scripts/trylink b/scripts/trylink index 9f288c141..ba2d265bc 100755 --- a/scripts/trylink +++ b/scripts/trylink @@ -91,7 +91,9 @@ fi START_GROUP="-Wl,--start-group" END_GROUP="-Wl,--end-group" -INFO_OPTS="-Wl,--warn-common -Wl,-Map,$EXE.map -Wl,--verbose" +INFO_OPTS() { + echo "-Wl,--warn-common -Wl,-Map,$EXE.map -Wl,--verbose" +} # gold may not support --sort-common (yet) SORT_COMMON="-Wl,--sort-common" @@ -194,7 +196,7 @@ if ! test -f busybox_ldscript; then $GC_SECTIONS \ $START_GROUP $O_FILES $A_FILES $END_GROUP \ $l_list \ - $INFO_OPTS \ + `INFO_OPTS` \ || { cat $EXE.out exit 1 @@ -225,7 +227,7 @@ else -Wl,-T,busybox_ldscript \ $START_GROUP $O_FILES $A_FILES $END_GROUP \ $l_list \ - $INFO_OPTS \ + `INFO_OPTS` \ || { cat $EXE.out exit 1 @@ -244,10 +246,14 @@ if test "$CONFIG_BUILD_LIBBUSYBOX" = y; then } ln -s "libbusybox.so.$BB_VER" "$sharedlib_dir"/libbusybox.so 2>/dev/null + # Yes, "ld -shared -static" is a thing. It's a shared library which is itself static. + LBB_STATIC="" + test "$CONFIG_FEATURE_LIBBUSYBOX_STATIC" = y && LBB_STATIC="-Wl,-static" + EXE="$sharedlib_dir/libbusybox.so.${BB_VER}_unstripped" try $CC $CFLAGS $LDFLAGS \ -o $EXE \ - -shared -fPIC \ + -shared -fPIC $LBB_STATIC \ -Wl,--enable-new-dtags \ -Wl,-z,combreloc \ -Wl,-soname="libbusybox.so.$BB_VER" \ @@ -256,7 +262,7 @@ if test "$CONFIG_BUILD_LIBBUSYBOX" = y; then $SORT_SECTION \ $START_GROUP $A_FILES $END_GROUP \ $l_list \ - $INFO_OPTS \ + `INFO_OPTS` \ || { echo "Linking $EXE failed" cat $EXE.out @@ -277,7 +283,7 @@ if test "$CONFIG_FEATURE_SHARED_BUSYBOX" = y; then $START_GROUP $O_FILES $END_GROUP \ -L"$sharedlib_dir" -lbusybox \ $l_list \ - $INFO_OPTS \ + `INFO_OPTS` \ || { echo "Linking $EXE failed" cat $EXE.out |