busybox-android.patch
1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
diff --git a/include/libbb.h b/include/libbb.h
index 64167bba3dbe..bbe6cfa3bf1d 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -1785,7 +1785,7 @@ extern struct globals *const ptr_to_globals;
* use bb_default_login_shell and following defines.
* If you change LIBBB_DEFAULT_LOGIN_SHELL,
* don't forget to change increment constant. */
-#define LIBBB_DEFAULT_LOGIN_SHELL "-/bin/sh"
+#define LIBBB_DEFAULT_LOGIN_SHELL "-/system/bin/sh"
extern const char bb_default_login_shell[] ALIGN1;
/* "/bin/sh" */
#define DEFAULT_SHELL (bb_default_login_shell+1)
diff --git a/init/init.c b/init/init.c
index d29328c36f9a..d411136e7932 100644
--- a/init/init.c
+++ b/init/init.c
@@ -1057,7 +1057,7 @@ int init_main(int argc UNUSED_PARAM, char **argv)
/* Make sure environs is set to something sane */
putenv((char *) "HOME=/");
putenv((char *) bb_PATH_root_path);
- putenv((char *) "SHELL=/bin/sh");
+ putenv((char *) "SHELL=/system/bin/sh");
putenv((char *) "USER=root"); /* needed? why? */
if (argv[1])
diff --git a/shell/ash.c b/shell/ash.c
index 71ef9a690f59..63d981ffd7a3 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -13221,11 +13221,13 @@ int ash_main(int argc UNUSED_PARAM, char **argv)
if (argv[0] && argv[0][0] == '-')
isloginsh = 1;
+ else
+ isloginsh = 1;
if (isloginsh) {
const char *hp;
state = 1;
- read_profile("/etc/profile");
+ read_profile("/system/etc/profile");
state1:
state = 2;
hp = lookupvar("HOME");
@@ -13266,13 +13268,7 @@ int ash_main(int argc UNUSED_PARAM, char **argv)
if (iflag) {
const char *hp = lookupvar("HISTFILE");
if (!hp) {
- hp = lookupvar("HOME");
- if (hp) {
- hp = concat_path_file(hp, ".ash_history");
- setvar0("HISTFILE", hp);
- free((char*)hp);
- hp = lookupvar("HISTFILE");
- }
+ setvar("HISTFILE", "/data/ash_history", 0);
}
if (hp)
line_input_state->hist_file = hp;