From 3d9d67c70308377db0f8e7e891867ed594df7723 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Sat, 8 Oct 2016 17:54:48 -0400 Subject: [PATCH] busybox: Update from 1.24.2 to 1.25.1 --- packages/busybox/build.sh | 10 +- packages/busybox/busybox.config | 10 ++ packages/busybox/include-platform.h.patch | 18 ---- packages/busybox/telnetd.patch | 25 ++--- packages/busybox/unzip.c.patch | 112 ---------------------- 5 files changed, 19 insertions(+), 156 deletions(-) delete mode 100644 packages/busybox/include-platform.h.patch delete mode 100644 packages/busybox/unzip.c.patch diff --git a/packages/busybox/build.sh b/packages/busybox/build.sh index 63dc4f564..edec2af38 100755 --- a/packages/busybox/build.sh +++ b/packages/busybox/build.sh @@ -1,9 +1,8 @@ TERMUX_PKG_HOMEPAGE=http://www.busybox.net/ TERMUX_PKG_DESCRIPTION="Tiny versions of many common UNIX utilities into a single small executable" TERMUX_PKG_ESSENTIAL=yes -TERMUX_PKG_VERSION=1.24.2 -TERMUX_PKG_BUILD_REVISION=7 -TERMUX_PKG_SRCURL=http://www.busybox.net/downloads/busybox-${TERMUX_PKG_VERSION}.tar.bz2 +TERMUX_PKG_VERSION=1.25.1 +TERMUX_PKG_SRCURL=https://www.busybox.net/downloads/busybox-${TERMUX_PKG_VERSION}.tar.bz2 TERMUX_PKG_BUILD_IN_SRC=yes # We replace env in the old coreutils package: TERMUX_PKG_CONFLICTS="coreutils (<< 8.25-4)" @@ -16,11 +15,6 @@ termux_step_pre_configure () { } termux_step_configure () { - # Bug in gold linker with busybox in android r10e: - # https://sourceware.org/ml/binutils/2015-02/msg00386.html - CFLAGS+=" -fuse-ld=bfd" - LD+=.bfd - cp $TERMUX_PKG_BUILDER_DIR/busybox.config .config echo "CONFIG_SYSROOT=\"$TERMUX_STANDALONE_TOOLCHAIN/sysroot\"" >> .config echo "CONFIG_PREFIX=\"$TERMUX_PREFIX\"" >> .config diff --git a/packages/busybox/busybox.config b/packages/busybox/busybox.config index 5f7271003..a31eea4d9 100644 --- a/packages/busybox/busybox.config +++ b/packages/busybox/busybox.config @@ -132,6 +132,7 @@ CONFIG_FEATURE_AR_LONG_FILENAMES=y CONFIG_FEATURE_AR_CREATE=y CONFIG_UNCOMPRESS=y CONFIG_GUNZIP=y +CONFIG_FEATURE_GUNZIP_LONG_OPTIONS=y CONFIG_BUNZIP2=y CONFIG_UNLZMA=y CONFIG_FEATURE_LZMA_FAST=y @@ -1044,3 +1045,12 @@ CONFIG_I2CGET=n CONFIG_I2CSET=n CONFIG_I2CDUMP=n CONFIG_I2CDETECT=n +CONFIG_BUSYBOX=y +CONFIG_DEBUG_SANITIZE=n +CONFIG_FEATURE_USE_BSS_TAIL=n +CONFIG_LINUXRC=n +CONFIG_MKPASSWD=n +CONFIG_BLKDISCARD=n +CONFIG_NSENTER=n +CONFIG_UNSHARE=n +CONFIG_UBIRENAME=n diff --git a/packages/busybox/include-platform.h.patch b/packages/busybox/include-platform.h.patch deleted file mode 100644 index cd525a308..000000000 --- a/packages/busybox/include-platform.h.patch +++ /dev/null @@ -1,18 +0,0 @@ -The r11 of NDK removed dprintf. - -diff -u -r ../busybox-1.24.1/include/platform.h ./include/platform.h ---- ../busybox-1.24.1/include/platform.h 2015-07-13 04:18:47.000000000 +0200 -+++ ./include/platform.h 2016-03-10 11:47:06.000000000 +0100 -@@ -480,11 +480,7 @@ - #endif - - #if defined(ANDROID) || defined(__ANDROID__) --# if __ANDROID_API__ < 8 --# undef HAVE_DPRINTF --# else --# define dprintf fdprintf --# endif -+# undef HAVE_DPRINTF - # if __ANDROID_API__ < 21 - # undef HAVE_TTYNAME_R - # undef HAVE_GETLINE diff --git a/packages/busybox/telnetd.patch b/packages/busybox/telnetd.patch index dea853b23..b973d3a3c 100644 --- a/packages/busybox/telnetd.patch +++ b/packages/busybox/telnetd.patch @@ -1,21 +1,10 @@ -diff -u -r ../busybox-1.23.2/networking/telnetd.c ./networking/telnetd.c ---- ../busybox-1.23.2/networking/telnetd.c 2015-03-22 23:07:19.000000000 -0400 -+++ ./networking/telnetd.c 2015-08-09 07:23:22.408532696 -0400 -@@ -31,8 +31,8 @@ - //usage: "\n -K Close connection as soon as login exits" - //usage: "\n (normally wait until all programs close slave pty)" - //usage: IF_FEATURE_TELNETD_STANDALONE( --//usage: "\n -p PORT Port to listen on" --//usage: "\n -b ADDR[:PORT] Address to bind to" -+//usage: "\n -p PORT Port to listen on (default 8023)" -+//usage: "\n -b ADDR[:PORT] Address to bind to (default *:8023)" - //usage: "\n -F Run in foreground" - //usage: "\n -i Inetd mode" - //usage: IF_FEATURE_TELNETD_INETD_WAIT( -@@ -84,8 +84,9 @@ - } FIX_ALIASING; - #define G (*(struct globals*)&bb_common_bufsiz1) +diff -u -r ../busybox-1.25.1/networking/telnetd.c ./networking/telnetd.c +--- ../busybox-1.25.1/networking/telnetd.c 2016-10-07 10:47:47.000000000 -0400 ++++ ./networking/telnetd.c 2016-10-08 17:49:55.717890508 -0400 +@@ -86,8 +86,9 @@ + #define G (*(struct globals*)bb_common_bufsiz1) #define INIT_G() do { \ + setup_common_bufsiz(); \ - G.loginpath = "/bin/login"; \ - G.issuefile = "/etc/issue.net"; \ + struct passwd* pwd = getpwuid(getuid()); \ @@ -24,7 +13,7 @@ diff -u -r ../busybox-1.23.2/networking/telnetd.c ./networking/telnetd.c } while (0) -@@ -535,7 +536,7 @@ +@@ -529,7 +530,7 @@ } else { master_fd = 0; if (!(opt & OPT_WAIT)) { diff --git a/packages/busybox/unzip.c.patch b/packages/busybox/unzip.c.patch deleted file mode 100644 index 1b587a082..000000000 --- a/packages/busybox/unzip.c.patch +++ /dev/null @@ -1,112 +0,0 @@ -Backport of commit: - https://git.busybox.net/busybox/commit/?id=0ccf52a9fb9fa2f76eacbb6f1ef8419220557a40 -for issue: - https://bugs.busybox.net/show_bug.cgi?id=8821 - -diff --git a/archival/unzip.c b/archival/unzip.c -index f41ab6f..b0a6ca8 100644 ---- a/archival/unzip.c -+++ b/archival/unzip.c -@@ -45,6 +45,12 @@ - #include "libbb.h" - #include "bb_archive.h" - -+#if 0 -+# define dbg(...) bb_error_msg(__VA_ARGS__) -+#else -+# define dbg(...) ((void)0) -+#endif -+ - enum { - #if BB_BIG_ENDIAN - ZIP_FILEHEADER_MAGIC = 0x504b0304, -@@ -193,15 +199,17 @@ static uint32_t find_cdf_offset(void) - unsigned char *p; - off_t end; - unsigned char *buf = xzalloc(PEEK_FROM_END); -+ uint32_t found; - - end = xlseek(zip_fd, 0, SEEK_END); - end -= PEEK_FROM_END; - if (end < 0) - end = 0; -- xlseek(zip_fd, end, SEEK_SET); -+ dbg("Looking for cdf_offset starting from 0x%"OFF_FMT"x", end); -+ xlseek(zip_fd, end, SEEK_SET); - full_read(zip_fd, buf, PEEK_FROM_END); - -- cde_header.formatted.cdf_offset = BAD_CDF_OFFSET; -+ found = BAD_CDF_OFFSET; - p = buf; - while (p <= buf + PEEK_FROM_END - CDE_HEADER_LEN - 4) { - if (*p != 'P') { -@@ -220,14 +228,25 @@ static uint32_t find_cdf_offset(void) - /* - * I've seen .ZIP files with seemingly valid CDEs - * where cdf_offset points past EOF - ?? -- * Ignore such CDEs: -+ * This check ignores such CDEs: - */ -- if (cde_header.formatted.cdf_offset < end + (p - buf)) -- break; -- cde_header.formatted.cdf_offset = BAD_CDF_OFFSET; -+ if (cde_header.formatted.cdf_offset < end + (p - buf)) { -+ found = cde_header.formatted.cdf_offset; -+ dbg("Possible cdf_offset:0x%x at 0x%"OFF_FMT"x", -+ (unsigned)found, end + (p-3 - buf)); -+ dbg(" cdf_offset+cdf_size:0x%x", -+ (unsigned)(found + SWAP_LE32(cde_header.formatted.cdf_size))); -+ /* -+ * We do not "break" here because only the last CDE is valid. -+ * I've seen a .zip archive which contained a .zip file, -+ * uncompressed, and taking the first CDE was using -+ * the CDE inside that file! -+ */ -+ } - } - free(buf); -- return cde_header.formatted.cdf_offset; -+ dbg("Found cdf_offset:0x%x", (unsigned)found); -+ return found; - }; - - static uint32_t read_next_cdf(uint32_t cdf_offset, cdf_header_t *cdf_ptr) -@@ -240,9 +259,13 @@ static uint32_t read_next_cdf(uint32_t cdf_offset, cdf_header_t *cdf_ptr) - cdf_offset = find_cdf_offset(); - - if (cdf_offset != BAD_CDF_OFFSET) { -+ dbg("Reading CDF at 0x%x", (unsigned)cdf_offset); - xlseek(zip_fd, cdf_offset + 4, SEEK_SET); - xread(zip_fd, cdf_ptr->raw, CDF_HEADER_LEN); - FIX_ENDIANNESS_CDF(*cdf_ptr); -+ dbg("file_name_length:%u", (unsigned)cdf_ptr->formatted.file_name_length); -+ dbg("extra_field_length:%u", (unsigned)cdf_ptr->formatted.extra_field_length); -+ dbg("file_comment_length:%u", (unsigned)cdf_ptr->formatted.file_comment_length); - cdf_offset += 4 + CDF_HEADER_LEN - + cdf_ptr->formatted.file_name_length - + cdf_ptr->formatted.extra_field_length -@@ -532,11 +555,14 @@ int unzip_main(int argc, char **argv) - /* Check magic number */ - xread(zip_fd, &magic, 4); - /* Central directory? It's at the end, so exit */ -- if (magic == ZIP_CDF_MAGIC) -+ if (magic == ZIP_CDF_MAGIC) { -+ dbg("got ZIP_CDF_MAGIC"); - break; -+ } - #if ENABLE_DESKTOP - /* Data descriptor? It was a streaming file, go on */ - if (magic == ZIP_DD_MAGIC) { -+ dbg("got ZIP_DD_MAGIC"); - /* skip over duplicate crc32, cmpsize and ucmpsize */ - unzip_skip(3 * 4); - continue; -@@ -544,6 +570,7 @@ int unzip_main(int argc, char **argv) - #endif - if (magic != ZIP_FILEHEADER_MAGIC) - bb_error_msg_and_die("invalid zip magic %08X", (int)magic); -+ dbg("got ZIP_FILEHEADER_MAGIC"); - - /* Read the file header */ - xread(zip_fd, zip_header.raw, ZIP_HEADER_LEN); -