summaryrefslogtreecommitdiff
authorTanguy Pruvot <tanguy.pruvot@gmail.com>2014-08-05 06:35:55 (GMT)
committer Tanguy Pruvot <tanguy.pruvot@gmail.com>2014-08-05 09:41:42 (GMT)
commitb0919fd5afe40d5855bb4c77f6a7d985a541d20c (patch)
tree8579550ca2a056c196a472c5a09802648f9dda9d
parent76616e359f5a18ab1a26d0cbd8bdf03411036fcc (diff)
downloadbusybox-b0919fd5afe40d5855bb4c77f6a7d985a541d20c.zip
busybox-b0919fd5afe40d5855bb4c77f6a7d985a541d20c.tar.gz
busybox-b0919fd5afe40d5855bb4c77f6a7d985a541d20c.tar.bz2
Android: update busybox def PATH and cron folder
remove /usr/bin, add /vendor/bin, like official path config folder was badly set to debian style cron.d but busybox variant is a bit different : mkdir /etc/crontabs echo "* * * * * log CRON!" > /etc/crontabs/`whoami` crond -f Change-Id: I0b9af08a557a952b5074da3231f32433f447f558
Diffstat
-rw-r--r--busybox-full.config4
-rw-r--r--include/libbb.h4
-rw-r--r--include/platform.h2
-rw-r--r--libbb/messages.c4
-rw-r--r--miscutils/crond.c4
5 files changed, 15 insertions, 3 deletions
diff --git a/busybox-full.config b/busybox-full.config
index 7434435..bbf6857 100644
--- a/busybox-full.config
+++ b/busybox-full.config
@@ -674,9 +674,9 @@ CONFIG_FEATURE_BEEP_LENGTH_MS=0
# CONFIG_FEATURE_CHAT_CLR_ABORT is not set
# CONFIG_CHRT is not set
CONFIG_CROND=y
-# CONFIG_FEATURE_CROND_D is not set
+CONFIG_FEATURE_CROND_D=y
# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set
-CONFIG_FEATURE_CROND_DIR="/system/etc/cron.d"
+CONFIG_FEATURE_CROND_DIR="/etc"
CONFIG_CRONTAB=y
CONFIG_DC=y
CONFIG_FEATURE_DC_LIBM=y
diff --git a/include/libbb.h b/include/libbb.h
index ec5a59c..08d2f19 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -1777,7 +1777,11 @@ extern const char bb_busybox_exec_path[] ALIGN1;
* but I want to save a few bytes here */
extern const char bb_PATH_root_path[] ALIGN1; /* "PATH=/sbin:/usr/sbin:/bin:/usr/bin" */
#define bb_default_root_path (bb_PATH_root_path + sizeof("PATH"))
+#ifdef __BIONIC__
+#define bb_default_path (bb_PATH_root_path + sizeof("PATH=/sbin"))
+#else
#define bb_default_path (bb_PATH_root_path + sizeof("PATH=/sbin:/usr/sbin"))
+#endif
extern const int const_int_0;
extern const int const_int_1;
diff --git a/include/platform.h b/include/platform.h
index 18bedda..0c75e8d 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -353,7 +353,7 @@ typedef unsigned smalluint;
#endif
#if defined(ANDROID) || defined(__ANDROID__)
-# define BB_ADDITIONAL_PATH ":/system/sbin:/system/bin:/system/xbin"
+# define BB_ADDITIONAL_PATH ":/vendor/bin:/system/sbin:/system/bin:/system/xbin"
# define SYS_ioprio_set __NR_ioprio_set
# define SYS_ioprio_get __NR_ioprio_get
#endif
diff --git a/libbb/messages.c b/libbb/messages.c
index fad82c9..1ce84cf 100644
--- a/libbb/messages.c
+++ b/libbb/messages.c
@@ -40,7 +40,11 @@ const char bb_default_login_shell[] ALIGN1 = LIBBB_DEFAULT_LOGIN_SHELL;
/* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin,
* but I want to save a few bytes here. Check libbb.h before changing! */
const char bb_PATH_root_path[] ALIGN1 =
+#ifdef __BIONIC__
+ "PATH=/sbin" BB_ADDITIONAL_PATH; /* platform.h */
+#else
"PATH=/sbin:/usr/sbin:/bin:/usr/bin" BB_ADDITIONAL_PATH;
+#endif
const int const_int_1 = 1;
diff --git a/miscutils/crond.c b/miscutils/crond.c
index c9f4552..12f217d 100644
--- a/miscutils/crond.c
+++ b/miscutils/crond.c
@@ -36,7 +36,11 @@
#endif
+#ifdef __BIONIC__
+#define TMPDIR "/data/local/tmp"
+#else
#define TMPDIR CONFIG_FEATURE_CROND_DIR
+#endif
#define CRONTABS CONFIG_FEATURE_CROND_DIR "/crontabs"
#ifndef SENDMAIL
# define SENDMAIL "sendmail"