1 |
commit: 5c7ecf36f0bbbe18b513d7afb82b0f7bf342889c |
2 |
Author: Mike Frysinger <vapier <AT> chromium <DOT> org> |
3 |
AuthorDate: Wed Apr 26 21:09:04 2017 +0000 |
4 |
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Apr 26 21:12:26 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5c7ecf36 |
7 |
|
8 |
sys-apps/busybox: fix default shell handling |
9 |
|
10 |
Make sure we explicitly select sh->ash by default as newer versions |
11 |
are defaulting to sh->hush. |
12 |
|
13 |
Also fix up the hush patch to include the /bin/busybox fallbacks. |
14 |
|
15 |
...ybox-1.26.2.ebuild => busybox-1.26.2-r1.ebuild} | 1 + |
16 |
sys-apps/busybox/files/busybox-1.26.2-bb.patch | 29 ++++++++++++++++------ |
17 |
2 files changed, 22 insertions(+), 8 deletions(-) |
18 |
|
19 |
diff --git a/sys-apps/busybox/busybox-1.26.2.ebuild b/sys-apps/busybox/busybox-1.26.2-r1.ebuild |
20 |
similarity index 99% |
21 |
rename from sys-apps/busybox/busybox-1.26.2.ebuild |
22 |
rename to sys-apps/busybox/busybox-1.26.2-r1.ebuild |
23 |
index 1feb3a5ac22..6c42e41a452 100644 |
24 |
--- a/sys-apps/busybox/busybox-1.26.2.ebuild |
25 |
+++ b/sys-apps/busybox/busybox-1.26.2-r1.ebuild |
26 |
@@ -126,6 +126,7 @@ src_configure() { |
27 |
# If these are not set and we are using a uclibc/busybox setup |
28 |
# all calls to system() will fail. |
29 |
busybox_config_option y ASH |
30 |
+ busybox_config_option y SH_IS_ASH |
31 |
busybox_config_option n HUSH |
32 |
|
33 |
busybox_config_option '"/run"' PID_FILE_PATH |
34 |
|
35 |
diff --git a/sys-apps/busybox/files/busybox-1.26.2-bb.patch b/sys-apps/busybox/files/busybox-1.26.2-bb.patch |
36 |
index f120340162b..5e2405c3a67 100644 |
37 |
--- a/sys-apps/busybox/files/busybox-1.26.2-bb.patch |
38 |
+++ b/sys-apps/busybox/files/busybox-1.26.2-bb.patch |
39 |
@@ -1,6 +1,11 @@ |
40 |
-diff -Naur busybox-1.26.2.orig/shell/ash.c busybox-1.26.2/shell/ash.c |
41 |
---- busybox-1.26.2.orig/shell/ash.c 2017-01-10 10:55:51.000000000 -0500 |
42 |
-+++ busybox-1.26.2/shell/ash.c 2017-01-28 17:02:08.961584737 -0500 |
43 |
+add `bb` and `bbsh` shortcuts as aliases to the main shell so we can install |
44 |
+symlinks in Gentoo at /bin/bb as our recovery shell. |
45 |
+ |
46 |
+we also add fallbacks to /bin/busybox and /bin/busybox.static in case /proc |
47 |
+is not yet mounted during early boot. |
48 |
+ |
49 |
+--- a/shell/ash.c |
50 |
++++ b/shell/ash.c |
51 |
@@ -144,6 +144,8 @@ |
52 |
//applet:IF_ASH(APPLET(ash, BB_DIR_BIN, BB_SUID_DROP)) |
53 |
//applet:IF_SH_IS_ASH(APPLET_ODDNAME(sh, ash, BB_DIR_BIN, BB_SUID_DROP, ash)) |
54 |
@@ -19,9 +24,8 @@ diff -Naur busybox-1.26.2.orig/shell/ash.c busybox-1.26.2/shell/ash.c |
55 |
/* If they called chroot or otherwise made the binary no longer |
56 |
* executable, fall through */ |
57 |
} |
58 |
-diff -Naur busybox-1.26.2.orig/shell/hush.c busybox-1.26.2/shell/hush.c |
59 |
---- busybox-1.26.2.orig/shell/hush.c 2017-01-10 10:55:51.000000000 -0500 |
60 |
-+++ busybox-1.26.2/shell/hush.c 2017-01-28 17:05:13.235936850 -0500 |
61 |
+--- a/shell/hush.c |
62 |
++++ b/shell/hush.c |
63 |
@@ -221,6 +221,8 @@ |
64 |
//applet:IF_MSH(APPLET_ODDNAME(msh, hush, BB_DIR_BIN, BB_SUID_DROP, hush)) |
65 |
//applet:IF_SH_IS_HUSH(APPLET_ODDNAME(sh, hush, BB_DIR_BIN, BB_SUID_DROP, hush)) |
66 |
@@ -35,8 +39,17 @@ diff -Naur busybox-1.26.2.orig/shell/hush.c busybox-1.26.2/shell/hush.c |
67 |
if (SPECIAL_JOBSTOP_SIGS != 0) |
68 |
switch_off_special_sigs(G.special_sig_mask & SPECIAL_JOBSTOP_SIGS); |
69 |
execve(bb_busybox_exec_path, argv, pp); |
70 |
-+ execve("/bin/busybox.static", argv, envp); |
71 |
-+ execve("/bin/busybox", argv, envp); |
72 |
++ execve("/bin/busybox.static", argv, pp); |
73 |
++ execve("/bin/busybox", argv, pp); |
74 |
/* Fallback. Useful for init=/bin/hush usage etc */ |
75 |
if (argv[0][0] == '/') |
76 |
execve(argv[0], argv, pp); |
77 |
+@@ -6931,6 +6931,8 @@ |
78 |
+ if (SPECIAL_JOBSTOP_SIGS != 0) |
79 |
+ switch_off_special_sigs(G.special_sig_mask & SPECIAL_JOBSTOP_SIGS); |
80 |
+ execv(bb_busybox_exec_path, argv); |
81 |
++ execv("/bin/busybox.static", argv); |
82 |
++ execv("/bin/busybox", argv); |
83 |
+ /* If they called chroot or otherwise made the binary no longer |
84 |
+ * executable, fall through */ |
85 |
+ } |