busybox-android.patch 1.88 KB
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;