Permalink
Browse files

dont assume busybox is available

  • Loading branch information...
1 parent 1dd110d commit 63eda446dd4efbc9ce3c85a478b323f9cf1fa0ba @falconindy committed Apr 22, 2011
Showing with 7 additions and 2 deletions.
  1. +7 −2 init.c
View
@@ -27,6 +27,7 @@
#define TMPFS_FLAGS MS_NOEXEC|MS_NODEV|MS_NOSUID
#define NEWROOT "/new_root"
+#define BUSYBOX "/bin/busybox"
#define UDEVD "/sbin/udevd"
#define UDEVADM "/sbin/udevadm"
@@ -159,8 +160,12 @@ static void delete_contents(char *path, dev_t rootdev) { /* {{{ */
} /* }}} */
static void start_rescue_shell(void) { /* {{{ */
- char *bboxinstall[] = { "/bin/busybox", "--install", NULL };
- char *bboxlaunch[] = { "/bin/busybox", "ash", NULL };
+ char *bboxinstall[] = { BUSYBOX, "--install", NULL };
+ char *bboxlaunch[] = { BUSYBOX, "ash", NULL };
+
+ if (access(BUSYBOX, X_OK) != 0) {
+ return;
+ }
/* install symlinks */
forkexecwait(bboxinstall);

0 comments on commit 63eda44

Please sign in to comment.