Update for BusyBox 1.34.1

This commit is contained in:
osm0sis 2021-10-02 03:00:46 -03:00 committed by John Wu
parent 6f4add81a7
commit 5ba6d51322
37 changed files with 186 additions and 206 deletions

View File

@ -12,7 +12,7 @@ git clone https://github.com/SELinuxProject/selinux.git jni/selinux
git clone https://android.googlesource.com/platform/external/pcre jni/pcre
```
Currently, the script supports BusyBox version `1.33.1`, please checkout to the correct tags before running scripts
Currently, the script supports BusyBox version `1.34.1`, please checkout to the correct tags before running scripts
## Busybox

View File

@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Busybox version: 1.33.1
# Thu May 6 15:44:23 2021
# Busybox version: 1.34.1
# Sat Oct 2 02:32:02 2021
#
CONFIG_HAVE_DOT_CONFIG=y
@ -207,11 +207,13 @@ CONFIG_CHOWN=y
CONFIG_FEATURE_CHOWN_LONG_OPTIONS=y
CONFIG_CHROOT=y
CONFIG_CKSUM=y
CONFIG_CRC32=y
CONFIG_COMM=y
CONFIG_CP=y
CONFIG_FEATURE_CP_LONG_OPTIONS=y
CONFIG_FEATURE_CP_REFLINK=y
CONFIG_CUT=y
CONFIG_FEATURE_CUT_REGEX=y
CONFIG_DATE=y
CONFIG_FEATURE_DATE_ISOFMT=y
CONFIG_FEATURE_DATE_NANO=y
@ -316,7 +318,6 @@ CONFIG_TEST2=y
CONFIG_FEATURE_TEST_64=y
CONFIG_TIMEOUT=y
CONFIG_TOUCH=y
# CONFIG_FEATURE_TOUCH_NODEREF is not set
CONFIG_FEATURE_TOUCH_SUSV3=y
CONFIG_TR=y
CONFIG_FEATURE_TR_CLASSES=y
@ -424,6 +425,7 @@ CONFIG_VI=y
CONFIG_FEATURE_VI_MAX_LEN=4096
CONFIG_FEATURE_VI_8BIT=y
CONFIG_FEATURE_VI_COLON=y
CONFIG_FEATURE_VI_COLON_EXPAND=y
CONFIG_FEATURE_VI_YANKMARK=y
CONFIG_FEATURE_VI_SEARCH=y
# CONFIG_FEATURE_VI_REGEX_SEARCH is not set
@ -437,6 +439,7 @@ CONFIG_FEATURE_VI_ASK_TERMINAL=y
CONFIG_FEATURE_VI_UNDO=y
CONFIG_FEATURE_VI_UNDO_QUEUE=y
CONFIG_FEATURE_VI_UNDO_QUEUE_MAX=256
CONFIG_FEATURE_VI_VERBOSE_STATUS=y
CONFIG_FEATURE_ALLOW_EXEC=y
#
@ -743,6 +746,7 @@ CONFIG_FEATURE_VOLUMEID_XFS=y
# Miscellaneous Utilities
#
CONFIG_ADJTIMEX=y
CONFIG_ASCII=y
CONFIG_BBCONFIG=y
CONFIG_FEATURE_COMPRESS_BBCONFIG=y
# CONFIG_BC is not set
@ -838,6 +842,7 @@ CONFIG_UBIUPDATEVOL=y
CONFIG_UBIRENAME=y
CONFIG_VOLNAME=y
CONFIG_WATCHDOG=y
# CONFIG_FEATURE_WATCHDOG_OPEN_TWICE is not set
#
# Networking Utilities
@ -976,6 +981,7 @@ CONFIG_VCONFIG=y
CONFIG_WGET=y
CONFIG_FEATURE_WGET_LONG_OPTIONS=y
CONFIG_FEATURE_WGET_STATUSBAR=y
CONFIG_FEATURE_WGET_FTP=y
CONFIG_FEATURE_WGET_AUTHENTICATION=y
CONFIG_FEATURE_WGET_TIMEOUT=y
CONFIG_FEATURE_WGET_HTTPS=y
@ -1001,6 +1007,7 @@ CONFIG_FEATURE_UDHCPC6_RFC5970=y
#
# Common options for DHCP applets
#
CONFIG_UDHCPC_DEFAULT_INTERFACE="eth0"
CONFIG_FEATURE_UDHCP_PORT=y
CONFIG_UDHCP_DEBUG=9
CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80
@ -1136,8 +1143,8 @@ CONFIG_HUSH=y
CONFIG_SHELL_HUSH=y
CONFIG_HUSH_BASH_COMPAT=y
CONFIG_HUSH_BRACE_EXPANSION=y
CONFIG_HUSH_LINENO_VAR=y
# CONFIG_HUSH_BASH_SOURCE_CURDIR is not set
CONFIG_HUSH_LINENO_VAR=y
CONFIG_HUSH_INTERACTIVE=y
# CONFIG_HUSH_SAVEHISTORY is not set
CONFIG_HUSH_JOB=y

View File

@ -1,7 +1,7 @@
From 1617c2ddd3a6b81fca9f28f564ff44470a1930ed Mon Sep 17 00:00:00 2001
From d029f3c67469da49ec7893dc30d16377c5762e94 Mon Sep 17 00:00:00 2001
From: Chris Renshaw <osm0sis@outlook.com>
Date: Fri, 27 Nov 2015 11:40:52 -0400
Subject: [PATCH 01/33] Fix mconf/lkc host "warning statement with no effect"
Subject: [PATCH 01/32] Fix mconf/lkc host "warning statement with no effect"
---
scripts/kconfig/lkc.h | 4 ++--

View File

@ -1,7 +1,7 @@
From b9f214dc0434c1ba5c2987945807165dedcb7aa6 Mon Sep 17 00:00:00 2001
From c94561749d9f63d143e8ca07a2bd92d48e75f7cc Mon Sep 17 00:00:00 2001
From: Chris Renshaw <osm0sis@outlook.com>
Date: Tue, 4 May 2021 00:56:55 -0300
Subject: [PATCH 02/33] android: fix 'mount', 'umount', 'fsck', 'df'
Subject: [PATCH 02/32] android: fix 'mount', 'umount', 'fsck', 'df'
Patch by Tias Guns <tias@ulyssis.org>, based on 'Bionic Patch V1.0' by Vitaly Greck
https://code.google.com/p/busybox-android/downloads/detail?name=patch

View File

@ -1,7 +1,7 @@
From 47d2878611ba1f38b40e71ec70e23e0ff6cd3098 Mon Sep 17 00:00:00 2001
From 96101b7f372c47f4a1eaaa0144d835f909b45a3e Mon Sep 17 00:00:00 2001
From: Chris Renshaw <osm0sis@outlook.com>
Date: Thu, 3 Dec 2015 17:01:57 -0400
Subject: [PATCH 03/33] eject: add missing headers
Subject: [PATCH 03/32] eject: add missing headers
Imported from dorimanx's combined ported header toolchain:
https://github.com/dorimanx/android-busybox-ndk

View File

@ -1,7 +1,7 @@
From f8bbea7bb539f4c22d02d9d92dd141e9d81eb6f2 Mon Sep 17 00:00:00 2001
From 6bcdc7ab3573411bad843820dd6e200edc594a98 Mon Sep 17 00:00:00 2001
From: Chris Renshaw <osm0sis@outlook.com>
Date: Tue, 10 Jan 2017 10:24:29 -0400
Subject: [PATCH 04/33] fix udhcpd and nameif, add ether_ntoa_r and
Subject: [PATCH 04/32] fix udhcpd and nameif, add ether_ntoa_r and
ether_aton_r from glibc
this patch also fixes part of arping and ether-wake, but not sufficiently yet
@ -208,7 +208,7 @@ index 000000000..5e0146b29
+
+#endif /* ETHER_PORT_H */
diff --git a/networking/nameif.c b/networking/nameif.c
index 854594c83..bfb91b5ca 100644
index 66e042688..15a7b9c94 100644
--- a/networking/nameif.c
+++ b/networking/nameif.c
@@ -41,6 +41,7 @@
@ -232,7 +232,7 @@ index fcb725fbc..2d5739c7e 100644
lib-$(CONFIG_DHCPRELAY) += dhcprelay.o common.o socket.o packet.o
diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c
index cd32cb437..c9815501b 100644
index 91f70970a..732c0bcfa 100644
--- a/networking/udhcp/dhcpd.c
+++ b/networking/udhcp/dhcpd.c
@@ -40,8 +40,12 @@

View File

@ -1,7 +1,7 @@
From a395a49ee47d880db702ec1c4072bc7783a0b9f1 Mon Sep 17 00:00:00 2001
From e1fee59bd3f2dbb133662af39f9bf35e521d9e23 Mon Sep 17 00:00:00 2001
From: Chris Renshaw <osm0sis@outlook.com>
Date: Wed, 2 Dec 2015 23:44:06 -0400
Subject: [PATCH 05/33] fix ether-wake, avoid ether_hostton and include
Subject: [PATCH 05/32] fix ether-wake, avoid ether_hostton and include
if_ether
Patch by Tias Guns <tias@ulyssis.org>, based on 'no-ether_hostton' by Dan Drown

View File

@ -1,7 +1,7 @@
From 4dc8baa9576c44a16b4516aca42ae5e3f6294aa9 Mon Sep 17 00:00:00 2001
From fa7fa1aa04935420a9208c7b42a331660a90702b Mon Sep 17 00:00:00 2001
From: Chris Renshaw <osm0sis@outlook.com>
Date: Thu, 3 Dec 2015 01:29:35 -0400
Subject: [PATCH 06/33] loadfont/setfont/conspy: add missing header
Subject: [PATCH 06/32] loadfont/setfont/conspy: add missing header
Imported from dorimanx's combined ported header toolchain:
https://github.com/dorimanx/android-busybox-ndk

View File

@ -1,7 +1,7 @@
From bfda344e790457f197a3abbc1b2e08e1da0ce780 Mon Sep 17 00:00:00 2001
From aba6433a6a476ad96be92d7e7eb08b021a8eccd1 Mon Sep 17 00:00:00 2001
From: Chris Renshaw <osm0sis@outlook.com>
Date: Mon, 12 Sep 2016 14:45:35 -0300
Subject: [PATCH 07/33] android syscalls: shmget/msgget/semget
Subject: [PATCH 07/32] android syscalls: shmget/msgget/semget
Patch modified by Tias Guns <tias@ulyssis.org> from 'no-sys-shm,msg,sem' by Dan Drown
http://dan.drown.org/android/src/busybox/

View File

@ -1,7 +1,7 @@
From c4a61a027785c6ce94e3ca872c7415b4e1c2590a Mon Sep 17 00:00:00 2001
From a3b1a3d269989e1a4934292d221b94f80ddddba7 Mon Sep 17 00:00:00 2001
From: Chris Renshaw <osm0sis@outlook.com>
Date: Mon, 12 Sep 2016 14:46:40 -0300
Subject: [PATCH 08/33] android syscalls: msgctl shmctl
Subject: [PATCH 08/32] android syscalls: msgctl shmctl
Patch by Tias Guns <tias@ulyssis.org>
Rebased for busybox 1.25.0 by Chris Renshaw <osm0sis@outlook.com>

View File

@ -1,7 +1,7 @@
From 8f6ad8a7cc23feb47e083f4129e4d1c78ccd946f Mon Sep 17 00:00:00 2001
From a9bca1b78aab1b57434eb89d820e1e905dffe77f Mon Sep 17 00:00:00 2001
From: Chris Renshaw <osm0sis@outlook.com>
Date: Mon, 12 Sep 2016 14:48:30 -0300
Subject: [PATCH 09/33] android syscalls: shmdt shmat sembuf
Subject: [PATCH 09/32] android syscalls: shmdt shmat sembuf
Patch by Tias Guns <tias@ulyssis.org>
Rebased for busybox 1.25.0 by Chris Renshaw <osm0sis@outlook.com>

View File

@ -1,7 +1,7 @@
From cc92de78af168a7f82542e25e8133ffa354d9041 Mon Sep 17 00:00:00 2001
From 20e9d1e7e6f21764dafbf2003ad20080b102efb7 Mon Sep 17 00:00:00 2001
From: Tias Guns <tias@ulyssis.org>
Date: Sun, 5 Aug 2012 15:25:34 +0200
Subject: [PATCH 10/33] android syscall (non-trivial): semctl
Subject: [PATCH 10/32] android syscall (non-trivial): semctl
needed by ipcs and ipcrm, also needed (but not sufficient) for syslogd and logread

View File

@ -1,7 +1,7 @@
From 840337a66f736edf95578027ec73f100de0c4194 Mon Sep 17 00:00:00 2001
From 21fbb8fbf06c5f86d3e52c37b4ae83e3c5d91c99 Mon Sep 17 00:00:00 2001
From: Umakanthan Chandran <cumakt@gmail.com>
Date: Fri, 3 Mar 2017 07:32:22 +0530
Subject: [PATCH 11/33] missing_syscalls/semctl: fix missing definitions on x86
Subject: [PATCH 11/32] missing_syscalls/semctl: fix missing definitions on x86
and MIPS NDK cross-compiles
Signed-off-by: Umakanthan Chandran <cumakt@gmail.com>

View File

@ -1,7 +1,7 @@
From 2748d1cb52bc3d464d4bf07c4fbb1ce54d33b61b Mon Sep 17 00:00:00 2001
From 925deabe08b195acf7404e53a4678e3184d3e65d Mon Sep 17 00:00:00 2001
From: Tias Guns <tias@ulyssis.org>
Date: Tue, 20 Mar 2012 21:26:07 +0000
Subject: [PATCH 12/33] fix ipcs, ipcrm no sys/sem-shm-msg, etc
Subject: [PATCH 12/32] fix ipcs, ipcrm no sys/sem-shm-msg, etc
patch from 'no-sys-shm,msg,sem' by Dan Drown
http://dan.drown.org/android/src/busybox/

View File

@ -1,7 +1,7 @@
From 74fa2bc25dae8105436192a119b1c3bdceb78160 Mon Sep 17 00:00:00 2001
From 73246102edf999bda0d649a5476947336697178a Mon Sep 17 00:00:00 2001
From: Tias Guns <tias@ulyssis.org>
Date: Tue, 20 Mar 2012 21:30:10 +0000
Subject: [PATCH 13/33] fix syslogd, logread: add syslog.h, semop shmdt-at
Subject: [PATCH 13/32] fix syslogd, logread: add syslog.h, semop shmdt-at
patch from 'no-sys-shm,msg,sem' and 'sys-syslog' by Dan Drown
"sys/syslog.h header for syslogd"

View File

@ -1,7 +1,7 @@
From b70c272e49622cf09fced3a360af8a58137f8fa1 Mon Sep 17 00:00:00 2001
From be6c23f9fc6863944cdb3abb3c8b2672eda256c1 Mon Sep 17 00:00:00 2001
From: Chris Renshaw <osm0sis@outlook.com>
Date: Sun, 18 Feb 2018 07:54:58 -0400
Subject: [PATCH 14/33] fix fsck.minix, mkfs.minix: undef HAVE_SETBIT,
Subject: [PATCH 14/32] fix fsck.minix, mkfs.minix: undef HAVE_SETBIT,
MINIX2_SUPER_MAGIC, MINIX2_SUPER_MAGIC
"there is no setbit/clrbit in bionic"
@ -18,10 +18,10 @@ Rebased for busybox 1.28.1 by Chris Renshaw <osm0sis@outlook.com>
2 files changed, 3 insertions(+)
diff --git a/include/platform.h b/include/platform.h
index 085387fd8..3c90e2e6b 100644
index 9e1fb047d..668b50df4 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -537,6 +537,7 @@ typedef unsigned smalluint;
@@ -548,6 +548,7 @@ typedef unsigned smalluint;
# undef HAVE_UNLOCKED_LINE_OPS
# undef HAVE_NET_ETHERNET_H
# undef HAVE_PRINTF_PERCENTM

View File

@ -1,7 +1,7 @@
From fb787658ad4e638bf15d7d44ac0df1b09c3ad2e3 Mon Sep 17 00:00:00 2001
From e338db51bab2623214450f933058d51def2705ee Mon Sep 17 00:00:00 2001
From: Tias Guns <tias@ulyssis.org>
Date: Mon, 19 Mar 2012 18:24:29 +0000
Subject: [PATCH 15/33] fix ipv6, add ipv6_route.h
Subject: [PATCH 15/32] fix ipv6, add ipv6_route.h
from 'in6_rtmsg' by Dan Drown
"in6_rtmsg defined in linux/ipv6_route.h"

View File

@ -1,7 +1,7 @@
From 93e1a4cc9e849b5c65b5946bfa6dff884c3346bf Mon Sep 17 00:00:00 2001
From e05f9ca27ed3c936d444f62e21ba0c2e2c23f75a Mon Sep 17 00:00:00 2001
From: Chris Renshaw <osm0sis@outlook.com>
Date: Thu, 6 May 2021 16:09:06 -0300
Subject: [PATCH 16/33] additional fix-up for IPV6 on Android API 21+
Subject: [PATCH 16/32] additional fix-up for IPV6 on Android API 21+
fixes: networking/interface.c:62:8: error: redefinition of 'struct in6_ifreq'

View File

@ -1,7 +1,7 @@
From c333f43703ed6c2714ad78c1edd3ca685b70823c Mon Sep 17 00:00:00 2001
From c252ee61465fcdbf344c7501056f18121a46e0a7 Mon Sep 17 00:00:00 2001
From: Chris Renshaw <osm0sis@outlook.com>
Date: Wed, 19 Jul 2017 17:22:55 -0300
Subject: [PATCH 17/33] fix udhcpc6: add missing ifaddrs.h and
Subject: [PATCH 17/32] fix udhcpc6: add missing ifaddrs.h and
getifaddrs/freeifaddrs functions
ifaddrs implementation from 'android-ifaddrs' by Kenneth MacKay:
@ -16,7 +16,7 @@ https://github.com/morristech/android-ifaddrs
create mode 100644 networking/udhcp/ifaddrs.h
diff --git a/networking/udhcp/d6_dhcpc.c b/networking/udhcp/d6_dhcpc.c
index d4d29dcbb..dddf146f0 100644
index 8d11a7539..e5529bade 100644
--- a/networking/udhcp/d6_dhcpc.c
+++ b/networking/udhcp/d6_dhcpc.c
@@ -48,6 +48,7 @@

View File

@ -0,0 +1,74 @@
From 683fe6663a4b9b1ce350a93dab36dbe7a6e2ce5f Mon Sep 17 00:00:00 2001
From: Chris Renshaw <osm0sis@outlook.com>
Date: Sat, 2 Oct 2021 01:11:12 -0300
Subject: [PATCH 18/32] fix hush: add missing definitions on Android API 21+
platform FAST_FUNC adjustment to support NDK unified headers by John Wu <topjohnwu@gmail.com>
issetugid is required for hush via glob.c; add the hacky pre-API 21 definition back
Rebased for busybox 1.34.1 by Chris Renshaw <osm0sis@outlook.com>
---
include/platform.h | 10 +++++++++-
libbb/platform.c | 8 ++++++++
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/include/platform.h b/include/platform.h
index 668b50df4..8b7ed16e2 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -124,7 +124,7 @@
* (-DFAST_FUNC= )
*/
#ifndef FAST_FUNC
-# if __GNUC_PREREQ(3,0) && defined(i386)
+# if !defined(__ANDROID__) && __GNUC_PREREQ(3,0) && defined(i386)
/* stdcall makes callee to pop arguments from stack, not caller */
# define FAST_FUNC __attribute__((regparm(3),stdcall))
/* #elif ... - add your favorite arch today! */
@@ -426,6 +426,7 @@ typedef unsigned smalluint;
#define HAVE_SYS_STATFS_H 1
#define HAVE_PRINTF_PERCENTM 1
#define HAVE_WAIT3 1
+#define HAVE_ISSETUGID 1
#define HAVE_DEV_FD 1
#define DEV_FD_PREFIX "/dev/fd/"
@@ -533,6 +534,9 @@ typedef unsigned smalluint;
# else
/* ANDROID >= 21 has standard dprintf */
# endif
+# if __ANDROID_API__ > 18
+# undef HAVE_ISSETUGID
+# endif
# if __ANDROID_API__ < 21
# undef HAVE_TTYNAME_R
# undef HAVE_GETLINE
@@ -633,4 +637,8 @@ extern int vasprintf(char **string_ptr, const char *format, va_list p) FAST_FUNC
extern ssize_t getline(char **lineptr, size_t *n, FILE *stream) FAST_FUNC;
#endif
+#ifndef HAVE_ISSETUGID
+extern int issetugid(void) FAST_FUNC;
+#endif
+
#endif
diff --git a/libbb/platform.c b/libbb/platform.c
index 7913353e2..b652a2112 100644
--- a/libbb/platform.c
+++ b/libbb/platform.c
@@ -225,3 +225,11 @@ int ttyname_r(int fd, char *buf, size_t buflen)
return 0;
}
#endif
+
+#ifndef HAVE_ISSETUGID
+int issetugid(void)
+{
+ /* for Bionic, this is sufficient */
+ return 0;
+}
+#endif
--
2.31.1

View File

@ -1,78 +0,0 @@
From 8ec92b47e5c92e5070acbbf367b571dcb1c58e29 Mon Sep 17 00:00:00 2001
From: Chris Renshaw <osm0sis@outlook.com>
Date: Fri, 2 Feb 2018 16:37:54 -0400
Subject: [PATCH 18/33] fix time+hush: add missing definitions on Android API
21+
wait3() wrapper from 'sys-wait.h.patch' by Fredrik Fornwall:
https://github.com/termux/termux-packages/tree/master/ndk_patches/
issetugid is required for hush via glob.c; add the hacky pre-API 21 definition back
---
include/platform.h | 17 +++++++++++++++++
libbb/platform.c | 8 ++++++++
2 files changed, 25 insertions(+)
diff --git a/include/platform.h b/include/platform.h
index 3c90e2e6b..fb881af9b 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -423,6 +423,8 @@ typedef unsigned smalluint;
#define HAVE_NET_ETHERNET_H 1
#define HAVE_SYS_STATFS_H 1
#define HAVE_PRINTF_PERCENTM 1
+#define HAVE_WAIT3 1
+#define HAVE_ISSETUGID 1
#if defined(__UCLIBC__)
# if UCLIBC_VERSION < KERNEL_VERSION(0, 9, 32)
@@ -526,10 +528,15 @@ typedef unsigned smalluint;
# else
/* ANDROID >= 21 has standard dprintf */
# endif
+# if __ANDROID_API__ > 18
+# undef HAVE_ISSETUGID
+# endif
# if __ANDROID_API__ < 21
# undef HAVE_TTYNAME_R
# undef HAVE_GETLINE
# undef HAVE_STPCPY
+# else
+# undef HAVE_WAIT3
# endif
# undef HAVE_MEMPCPY
# undef HAVE_STRCHRNUL
@@ -618,4 +625,14 @@ extern int vasprintf(char **string_ptr, const char *format, va_list p) FAST_FUNC
extern ssize_t getline(char **lineptr, size_t *n, FILE *stream) FAST_FUNC;
#endif
+#ifndef HAVE_WAIT3
+/* Wrap wait3() to wait4() for libc implementations without (e.g. Bionic on ANDROID >= 21) */
+# include <sys/wait.h> /* for rusage */
+static pid_t wait3(int* status, int options, struct rusage* rusage) { return wait4(-1, status, options, rusage); }
+#endif
+
+#ifndef HAVE_ISSETUGID
+extern int issetugid(void) FAST_FUNC;
+#endif
+
#endif
diff --git a/libbb/platform.c b/libbb/platform.c
index 329b0237e..df039f066 100644
--- a/libbb/platform.c
+++ b/libbb/platform.c
@@ -213,3 +213,11 @@ int ttyname_r(int fd, char *buf, size_t buflen)
return 0;
}
#endif
+
+#ifndef HAVE_ISSETUGID
+int issetugid(void)
+{
+ /* for Bionic, this is sufficient */
+ return 0;
+}
+#endif
--
2.31.1

View File

@ -1,7 +1,7 @@
From 0ea8ca8d656c655aa073305a64a67a2d07e0459d Mon Sep 17 00:00:00 2001
From 7d88a2c2f18de02a65bf041f86ac17055a7310b5 Mon Sep 17 00:00:00 2001
From: Chris Renshaw <osm0sis@outlook.com>
Date: Tue, 10 Jan 2017 10:49:59 -0400
Subject: [PATCH 20/33] fix hush, add glob and sigisemptyset
Subject: [PATCH 19/32] fix hush, add glob and sigisemptyset
Patch by Tias Guns <tias@ulyssis.org>, based on 'glob' by Dan Drown
http://dan.drown.org/android/src/busybox/
@ -928,7 +928,7 @@ index 000000000..e8e65786d
+
+#endif /* !_GLOB_H_ */
diff --git a/shell/hush.c b/shell/hush.c
index 9fead37da..603c9f9be 100644
index 27092c12f..c3e1321db 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -331,6 +331,7 @@

View File

@ -1,25 +0,0 @@
From fe1c2ead89b2b249189e3f3eec1add7d80b6efae Mon Sep 17 00:00:00 2001
From: John Wu <topjohnwu@gmail.com>
Date: Sun, 12 Aug 2018 18:31:26 +0800
Subject: [PATCH 19/33] platform: minor adjustments to support unified headers
---
include/platform.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/platform.h b/include/platform.h
index fb881af9b..0d355ae85 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -124,7 +124,7 @@
* (-DFAST_FUNC= )
*/
#ifndef FAST_FUNC
-# if __GNUC_PREREQ(3,0) && defined(i386)
+# if !defined(__ANDROID__) && __GNUC_PREREQ(3,0) && defined(i386)
/* stdcall makes callee to pop arguments from stack, not caller */
# define FAST_FUNC __attribute__((regparm(3),stdcall))
/* #elif ... - add your favorite arch today! */
--
2.31.1

View File

@ -1,7 +1,7 @@
From 985a83ace17ce69d3bd776ce3247c5afc745cf62 Mon Sep 17 00:00:00 2001
From 4a739324cd42e10aebcc03d89882e4068f539a86 Mon Sep 17 00:00:00 2001
From: John Wu <topjohnwu@gmail.com>
Date: Sun, 12 Aug 2018 18:31:26 +0800
Subject: [PATCH 21/33] glob: minor adjustments to support unified headers
Subject: [PATCH 20/32] glob: minor adjustments to support unified headers
---
shell/glob.h | 6 +++---

View File

@ -1,7 +1,7 @@
From 8fb538cbe2e65b10c559af8967bc7543fb04a21f Mon Sep 17 00:00:00 2001
From b21ea886ecefce34e95197ff1c1e745e4b7589d1 Mon Sep 17 00:00:00 2001
From: Chris Renshaw <osm0sis@outlook.com>
Date: Thu, 6 May 2021 16:30:26 -0300
Subject: [PATCH 22/33] modinfo/modprobe: use ifdef block for android
Subject: [PATCH 21/32] modinfo/modprobe: use ifdef block for android
without-utsrel modules path
and fixes the modules.dep requirement, it is now optional...
@ -20,7 +20,7 @@ Rebased for busybox 1.33.1 by Chris Renshaw <osm0sis@outlook.com>
2 files changed, 46 insertions(+), 5 deletions(-)
diff --git a/modutils/modinfo.c b/modutils/modinfo.c
index d15772f0d..0b6a89329 100644
index 0a86c3296..de6b24b4d 100644
--- a/modutils/modinfo.c
+++ b/modutils/modinfo.c
@@ -20,6 +20,10 @@
@ -94,7 +94,7 @@ index d15772f0d..0b6a89329 100644
if (argv[i][0]) {
modinfo(argv[i], uts.release, field);
diff --git a/modutils/modprobe.c b/modutils/modprobe.c
index c334186b8..eecccac1b 100644
index 235706fd5..4f4ee11e1 100644
--- a/modutils/modprobe.c
+++ b/modutils/modprobe.c
@@ -172,6 +172,10 @@ static const char modprobe_longopts[] ALIGN1 =

View File

@ -1,7 +1,7 @@
From 3868d8ef449ca229b2bee9f19d922918830a5ac6 Mon Sep 17 00:00:00 2001
From e38ebe4d4d3739c95245bf8077a54754d72ec95c Mon Sep 17 00:00:00 2001
From: Chris Renshaw <osm0sis@outlook.com>
Date: Mon, 12 Sep 2016 16:55:01 -0300
Subject: [PATCH 23/33] depmod: fix syntax with modules in parameter
Subject: [PATCH 22/32] depmod: fix syntax with modules in parameter
Patch by Tanguy Pruvot <tanguy.pruvot@gmail.com>
Change-Id: I21b8664db01cf0132db82f8d6caa1a0e77e71004

View File

@ -1,7 +1,7 @@
From 5f81074e32ea8373e8ad1c8bf500b963c27ada4a Mon Sep 17 00:00:00 2001
From 03fb509561ce1a24b411d7b5679a692ee74f3d09 Mon Sep 17 00:00:00 2001
From: Chris Renshaw <osm0sis@outlook.com>
Date: Mon, 26 Jun 2017 23:53:06 -0300
Subject: [PATCH 24/33] fix reboot+poweroff: hack android_reboot support
Subject: [PATCH 23/32] fix reboot+poweroff: hack android_reboot support
based on 'reboot.c' and 'halt.c' patches from CyanogenMod:
https://github.com/CyanogenMod/android_external_busybox/commit/8aeb3719294721f744239ced474d159f073eef55#diff-51036c2b1c4282b63402a0e0286a066a

View File

@ -1,7 +1,7 @@
From 4188631fa69400723cf8458c9fc15b1aad60d581 Mon Sep 17 00:00:00 2001
From 488db5f4d0a00225cf69ca749590f594939bf395 Mon Sep 17 00:00:00 2001
From: osm0sis <osm0sis@outlook.com>
Date: Thu, 20 Jul 2017 09:16:07 -0300
Subject: [PATCH 25/33] fix tls: avoid problematic ASM code only triggered by
Subject: [PATCH 24/32] fix tls: avoid problematic ASM code only triggered by
x86 NDK builds
---
@ -9,7 +9,7 @@ Subject: [PATCH 25/33] fix tls: avoid problematic ASM code only triggered by
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/networking/tls.h b/networking/tls.h
index d4ac1bef8..07032477e 100644
index 215e92b02..1cd351f4a 100644
--- a/networking/tls.h
+++ b/networking/tls.h
@@ -26,7 +26,7 @@

View File

@ -1,7 +1,7 @@
From 5f669911378aa054117d8b8586d35bab7e0a09b1 Mon Sep 17 00:00:00 2001
From b01c5bdfd1ca84e29e090d3a17b0417ca6647905 Mon Sep 17 00:00:00 2001
From: Chris Renshaw <osm0sis@outlook.com>
Date: Sat, 21 Jul 2018 20:02:13 -0300
Subject: [PATCH 26/33] fix nslookup, add libres, a dietlibc resolver
Subject: [PATCH 25/32] fix nslookup, add libres, a dietlibc resolver
Using bionic's resolver functions does not allow changing the dns
server. Use dietlibc's resolver code instead (see package libres-devel)
@ -52,7 +52,7 @@ Rebased for busybox 1.29.1 by Chris Renshaw <osm0sis@outlook.com>
create mode 100644 libres/test.c
diff --git a/Makefile b/Makefile
index 35d1589cb..f858955a7 100644
index 31d1b0568..b303f3ec6 100644
--- a/Makefile
+++ b/Makefile
@@ -477,6 +477,7 @@ libs-y := \
@ -1156,7 +1156,7 @@ index 000000000..45095d81d
+ return 0;
+}
diff --git a/networking/nslookup.c b/networking/nslookup.c
index dda22de0e..35632bb60 100644
index de7b5c0e7..1de598505 100644
--- a/networking/nslookup.c
+++ b/networking/nslookup.c
@@ -36,8 +36,9 @@

View File

@ -1,7 +1,7 @@
From 31550f512959446007a7a7256a43ebd2dc84b8f1 Mon Sep 17 00:00:00 2001
From 4715ccbe7d0d2e1c25bbe70351624999e3fb5a0c Mon Sep 17 00:00:00 2001
From: Chris Renshaw <osm0sis@outlook.com>
Date: Wed, 30 Oct 2019 02:47:24 -0300
Subject: [PATCH 27/33] hack: use dietlibc's resolver to avoid static
Subject: [PATCH 26/32] hack: use dietlibc's resolver to avoid static
compiliation issues with bionic's getaddrinfo() returning only null instead
of opening the expected connection to /dev/socket/dnsproxyd

View File

@ -1,7 +1,7 @@
From da3b18d4355b125328c8438f3aac3b3a9d116949 Mon Sep 17 00:00:00 2001
From cc3c79f2693797e230a0cb72c5b2dac2ef9e3364 Mon Sep 17 00:00:00 2001
From: Chris Renshaw <osm0sis@outlook.com>
Date: Mon, 3 Jul 2017 03:17:06 -0300
Subject: [PATCH 28/33] dietlibc/dnscruft: try to get dns server via command if
Subject: [PATCH 27/32] dietlibc/dnscruft: try to get dns server via command if
__sys_property_get fails
- bionic libc's property_get and __sys_property_get fail for statically compiled binaries

View File

@ -1,6 +1,7 @@
From ea650af616d0b853a2c87466098c894337d53c3f Mon Sep 17 00:00:00 2001
From: Chris Renshaw <osm0sis@outlook.com>
Date: Wed, 11 Aug 2021 23:54:04 -0300
Subject: [PATCH] ash history
Subject: [PATCH 28/32] ash history
allows ash history to work on Android
@ -15,10 +16,10 @@ Rebased for busybox 1.33.1 by Chris Renshaw <osm0sis@outlook.com>
4 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/include/libbb.h b/include/libbb.h
index cae54658b..ae94e921d 100644
index 7d6ab4a93..c5883b3e9 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -2265,12 +2265,12 @@ static ALWAYS_INLINE void* not_const_pp(const void *p) { return (void*)p; }
@@ -2306,12 +2306,12 @@ static ALWAYS_INLINE void* not_const_pp(const void *p) { return (void*)p; }
* use bb_default_login_shell and following defines.
* If you change LIBBB_DEFAULT_LOGIN_SHELL,
* don't forget to change increment constant. */
@ -30,11 +31,11 @@ index cae54658b..ae94e921d 100644
/* "sh" */
-#define DEFAULT_SHELL_SHORT_NAME (bb_default_login_shell+6)
+#define DEFAULT_SHELL_SHORT_NAME (bb_default_login_shell+13)
/* The following devices are the same on all systems. */
#define CURRENT_TTY "/dev/tty"
diff --git a/init/init.c b/init/init.c
index efab5dcb4..de9044751 100644
index efab5dcb4..bd084b546 100644
--- a/init/init.c
+++ b/init/init.c
@@ -1107,7 +1107,7 @@ int init_main(int argc UNUSED_PARAM, char **argv)
@ -44,7 +45,7 @@ index efab5dcb4..de9044751 100644
- putenv((char *) "SHELL=/bin/sh");
+ putenv((char *) "SHELL=/system/bin/sh");
putenv((char *) "USER=root"); /* needed? why? */
if (argv[1])
diff --git a/libbb/get_shell_name.c b/libbb/get_shell_name.c
index 5aebe9cdc..5af53bdda 100644
@ -53,7 +54,7 @@ index 5aebe9cdc..5af53bdda 100644
@@ -17,6 +17,10 @@ const char* FAST_FUNC get_shell_name(void)
if (shell && shell[0])
return shell;
+#ifdef __ANDROID__
+ return DEFAULT_SHELL_SHORT_NAME;
+#endif
@ -62,28 +63,28 @@ index 5aebe9cdc..5af53bdda 100644
if (pw && pw->pw_shell && pw->pw_shell[0])
return pw->pw_shell;
diff --git a/shell/ash.c b/shell/ash.c
index a33ab0626..ad7978bbe 100644
index 53c140930..eded57508 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -14282,7 +14282,7 @@ procargs(char **argv)
@@ -14443,7 +14443,7 @@ procargs(char **argv)
int login_sh;
xargv = argv;
- login_sh = xargv[0] && xargv[0][0] == '-';
+ login_sh = 1; /* = xargv[0] && xargv[0][0] == '-'; - make always true for Android */
#if NUM_SCRIPTS > 0
if (minusc)
goto setarg0;
@@ -14458,7 +14458,7 @@ int ash_main(int argc UNUSED_PARAM, char **argv)
@@ -14619,7 +14619,7 @@ int ash_main(int argc UNUSED_PARAM, char **argv)
const char *hp;
state = 1;
- read_profile("/etc/profile");
+ read_profile("/system/etc/profile");
state1:
state = 2;
hp = lookupvar("HOME");
@@ -14503,6 +14503,9 @@ int ash_main(int argc UNUSED_PARAM, char **argv)
@@ -14664,6 +14664,9 @@ int ash_main(int argc UNUSED_PARAM, char **argv)
if (line_input_state) {
const char *hp = lookupvar("HISTFILE");
if (!hp) {
@ -93,7 +94,7 @@ index a33ab0626..ad7978bbe 100644
hp = lookupvar("HOME");
if (hp) {
INT_OFF;
@@ -14512,6 +14515,7 @@ int ash_main(int argc UNUSED_PARAM, char **argv)
@@ -14673,6 +14676,7 @@ int ash_main(int argc UNUSED_PARAM, char **argv)
INT_ON;
hp = lookupvar("HISTFILE");
}
@ -101,5 +102,6 @@ index a33ab0626..ad7978bbe 100644
}
if (hp)
line_input_state->hist_file = xstrdup(hp);
--
--
2.31.1

View File

@ -1,7 +1,7 @@
From 4556e7333436f9e651657e750948f5849e6fd418 Mon Sep 17 00:00:00 2001
From 86511778b323a5aec93d034a9ca2b0ef3833b927 Mon Sep 17 00:00:00 2001
From: topjohnwu <topjohnwu@gmail.com>
Date: Fri, 3 Apr 2020 02:09:55 -0700
Subject: [PATCH 30/33] Remove unnecessary missing syscalls
Subject: [PATCH 29/32] Remove unnecessary missing syscalls
---
libbb/missing_syscalls.c | 15 ---------------

View File

@ -1,17 +1,17 @@
From 88d63f1489151534e170d0c6954d6c1b5be59c1e Mon Sep 17 00:00:00 2001
From d36c32f4ddc5466809613f93855385737a54ad92 Mon Sep 17 00:00:00 2001
From: topjohnwu <topjohnwu@gmail.com>
Date: Fri, 7 Feb 2020 14:32:06 -0800
Subject: [PATCH 31/33] Add runtime toggle to enable standalone ash
Subject: [PATCH 30/32] Add runtime toggle to enable standalone ash
---
shell/ash.c | 42 ++++++++++++++++++++++++------------------
1 file changed, 24 insertions(+), 18 deletions(-)
diff --git a/shell/ash.c b/shell/ash.c
index ad7978bbe..6e796cf88 100644
index eded57508..5d83abd16 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -266,16 +266,14 @@ typedef long arith_t;
@@ -274,16 +274,14 @@ typedef long arith_t;
#endif
#include "NUM_APPLETS.h"
@ -36,7 +36,7 @@ index ad7978bbe..6e796cf88 100644
#ifndef F_DUPFD_CLOEXEC
# define F_DUPFD_CLOEXEC F_DUPFD
@@ -336,7 +334,9 @@ static const char *const optletters_optnames[] = {
@@ -348,7 +346,9 @@ static const char *const optletters_optnames[] = {
"a" "allexport",
"b" "notify",
"u" "nounset",
@ -47,7 +47,7 @@ index ad7978bbe..6e796cf88 100644
#if BASH_PIPEFAIL
,"\0" "pipefail"
#endif
@@ -431,14 +431,15 @@ struct globals_misc {
@@ -443,14 +443,15 @@ struct globals_misc {
#define bflag optlist[12]
#define uflag optlist[13]
#define viflag optlist[14]
@ -66,7 +66,7 @@ index ad7978bbe..6e796cf88 100644
#endif
/* trap handler commands */
@@ -8102,7 +8103,7 @@ static void
@@ -8233,7 +8234,7 @@ static void
tryexec(IF_FEATURE_SH_STANDALONE(int applet_no,) const char *cmd, char **argv, char **envp)
{
#if ENABLE_FEATURE_SH_STANDALONE
@ -75,7 +75,7 @@ index ad7978bbe..6e796cf88 100644
if (APPLET_IS_NOEXEC(applet_no)) {
clearenv();
while (*envp)
@@ -8171,7 +8172,7 @@ static void shellexec(char *prog, char **argv, const char *path, int idx)
@@ -8302,7 +8303,7 @@ static void shellexec(char *prog, char **argv, const char *path, int idx)
envp = listvars(VEXPORT, VUNSET, /*strlist:*/ NULL, /*end:*/ NULL);
if (strchr(prog, '/') != NULL
#if ENABLE_FEATURE_SH_STANDALONE
@ -84,7 +84,7 @@ index ad7978bbe..6e796cf88 100644
#endif
) {
tryexec(IF_FEATURE_SH_STANDALONE(applet_no,) prog, argv, envp);
@@ -13576,7 +13577,7 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path)
@@ -13732,7 +13733,7 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path)
goto fail;
#if ENABLE_FEATURE_SH_STANDALONE
@ -93,7 +93,7 @@ index ad7978bbe..6e796cf88 100644
int applet_no = find_applet_by_name(name);
if (applet_no >= 0) {
entry->cmdtype = CMDNORMAL;
@@ -13798,7 +13799,7 @@ helpcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
@@ -13954,7 +13955,7 @@ helpcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
}
}
# if ENABLE_FEATURE_SH_STANDALONE
@ -102,7 +102,7 @@ index ad7978bbe..6e796cf88 100644
const char *a = applet_names;
while (*a) {
col += out1fmt("%c%s", ((col == 0) ? '\t' : ' '), a);
@@ -14454,6 +14455,11 @@ int ash_main(int argc UNUSED_PARAM, char **argv)
@@ -14615,6 +14616,11 @@ int ash_main(int argc UNUSED_PARAM, char **argv)
trace_puts_args(argv);
#endif

View File

@ -1,7 +1,7 @@
From 411f362efe9a0876a4f0878de292cfbc86088abb Mon Sep 17 00:00:00 2001
From a5a9f9a667d105b88c5912f0c0a99557a318296f Mon Sep 17 00:00:00 2001
From: topjohnwu <topjohnwu@gmail.com>
Date: Sat, 2 May 2020 01:48:30 -0700
Subject: [PATCH 32/33] Disable SELinux features for install
Subject: [PATCH 31/32] Disable SELinux features for install
matchpathcon is not usable on Android
---

View File

@ -1,17 +1,17 @@
From 70f2490249ba5ff244581bfb8c3d38dfbfc4fdea Mon Sep 17 00:00:00 2001
From c20187410d12812d7144c52d7905152ccd8716e2 Mon Sep 17 00:00:00 2001
From: topjohnwu <topjohnwu@gmail.com>
Date: Thu, 21 Jan 2021 00:07:41 -0800
Subject: [PATCH 33/33] Allow running as libbusybox.so
Subject: [PATCH 32/32] Allow running as libbusybox.so
---
libbb/appletlib.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index 5f59f1273..030c8008d 100644
index 14be33603..648aacf59 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -1138,7 +1138,10 @@ int main(int argc UNUSED_PARAM, char **argv)
@@ -1103,7 +1103,10 @@ int main(int argc UNUSED_PARAM, char **argv)
if (argv[1] && is_prefixed_with(bb_basename(argv[0]), "busybox"))
argv++;
# endif

2
run.sh
View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
BUSYBOX_TAG='1_33_1'
BUSYBOX_TAG='1_34_1'
progress() {
echo -e "\n\033[44m${1}\033[0m\n"