OSDN Git Service

add busybox if DEBUG=1 or BUSYBOX=1 cupcake-x86
authorChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 23 Jul 2009 09:40:45 +0000 (17:40 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 23 Jul 2009 09:40:45 +0000 (17:40 +0800)
initrd/init

index 7c3a2de..fdf0807 100755 (executable)
@@ -58,16 +58,27 @@ while [ 1 ]; do
        mountpoint -q /android && break
        sleep 1
        echo -n .
-       if [ -n "$DEBUG" ]; then
-               echo -e "\nType 'exit' to continue booting...\n"
-               sh
-       fi
 done
 
 ln -s android/system /
 
 ln -s ../system/lib/modules /lib
 
+if [ -n "$DEBUG" -o -n "$BUSYBOX" ]; then
+       mv /bin /lib /android
+       system/bin/ln -s android/lib /lib
+       system/bin/ln -s android/bin /bin
+       sed -i 's|\(PATH *\)\(/sbin\)|\1/bin:\2|;s|\(/system\)\(/bin/sh\)|\2|' init.rc
+       mv /sbin/* /android/sbin
+       rmdir /sbin
+       ln -s android/sbin /
+fi
+
+if [ -n "$DEBUG" ]; then
+       echo -e "\nType 'exit' to continue booting...\n"
+       sh
+fi
+
 # load scripts
 for s in `ls /scripts/* /mnt/$SRC/scripts/*`; do
        source $s