[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#694310: debootstrap: test-exec function does not work on android



Package: debootstrap
Severity: normal
Tags: patch

Dear Maintainer,

Please accept this patch making the test-exec function work on Android. It is
against current git HEAD.

Note you will still need busybox and root to use debootstrap on Android. You will
also need to build pkgconfig.c from base-installer statically.

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: armhf (armv7l)

Kernel: Linux 3.5.4-00581-g5930e52 (PREEMPT)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
>From c63c87f6e430f628d11d5ca927d4931e09c25da5 Mon Sep 17 00:00:00 2001
From: Shawn Landden <shawnlandden@gmail.com>
Date: Sun, 25 Nov 2012 10:47:55 +0000
Subject: [PATCH] functions: check for /bin/sh before using it in shebang
 (android)

---
 functions |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/functions b/functions
index b450396..097650b 100644
--- a/functions
+++ b/functions
@@ -1299,10 +1299,18 @@ check_sane_mount () {
 		;;
 	esac
 
-	cat > "$1/test-exec" <<EOF
+	if [ -f "/bin/sh" ]; then
+		cat > "$1/test-exec" <<EOF
 #! /bin/sh
 :
 EOF
+	elsif [ -f "/system/bin/sh" ]; then
+		cat > "$1/test-exec" <<EOF
+#! /system/bin/sh
+:
+EOF
+	fi
+
 	chmod +x "$1/test-exec"
 	if ! "$1/test-exec"; then
 		rm -f "$1/test-exec"
-- 
1.7.10.4


Reply to: