Skip to content

Commit

Permalink
userscript update
Browse files Browse the repository at this point in the history
  • Loading branch information
chris41g committed Oct 12, 2011
1 parent 278144b commit cd7d156
Showing 1 changed file with 26 additions and 24 deletions.
50 changes: 26 additions & 24 deletions initramfs/sbin/userscript.sh
Expand Up @@ -4,23 +4,6 @@ exec > /data/local/userscript.log 2>&1
/sbin/busybox mount -o remount,rw / /
/sbin/busybox mount -o remount,rw /dev/block/mmcblk0p9 /system
FILESIZE=$(/sbin/busybox cat /data/local/LoStKernel-Ver|wc -c)
if /sbin/busybox test "$FILESIZE" -ge "10000"; then
/sbin/busybox rm /data/local/LoStKernel-Ver
fi

/sbin/busybox echo "Starting Boot Script - " $(/sbin/busybox date) >> /data/local/LoStKernel-Ver
/sbin/busybox echo $(/sbin/busybox uname -a) >> /data/local/LoStKernel-Ver

if /sbin/busybox test ! -e "/system/xbin/busybox"; then
installbb
fi

if /sbin/busybox test ! -e "/system/bin/su"; then
if /sbin/busybox test ! -e "/system/xbin/su"; then
installsu
fi
fi

installbb()
{
/sbin/busybox --install -s /system/xbin
Expand All @@ -41,6 +24,23 @@ installsu()
/sbin/busybox echo "Installed SU Binary" >> /data/local/LoStKernel-Ver
}

if /sbin/busybox test "$FILESIZE" -ge "10000"; then
/sbin/busybox rm /data/local/LoStKernel-Ver
fi

/sbin/busybox echo "Starting Boot Script - " $(/sbin/busybox date) >> /data/local/LoStKernel-Ver
/sbin/busybox echo $(/sbin/busybox uname -a) >> /data/local/LoStKernel-Ver

if /sbin/busybox test ! -e "/system/xbin/busybox"; then
installbb
fi

if /sbin/busybox test ! -e "/system/bin/su"; then
if /sbin/busybox test ! -e "/system/xbin/su"; then
installsu
fi
fi

if /sbin/busybox test ! -f "/system/app/Superuser.apk"; then
if /sbin/busybox test ! -f "/data/app/Superuser.apk"; then
if /sbin/busybox test ! -f "/data/app/com.noshufou.android.su"*; then
Expand Down Expand Up @@ -86,13 +86,15 @@ fi
# remove bad BB installs
/sbin/busybox ls -1 /system/bin | while read line
do
if /sbin/busybox test "$(/sbin/busybox basename `/sbin/busybox readlink /system/bin/$line`)" = "busybox"; then
/sbin/busybox rm /system/bin/${line}
/sbin/busybox echo "Removing Bad BusyBox Install - /system/bin/"${line} >> /data/local/LoStKernel-Ver
fi
if /sbin/busybox test "$(/sbin/busybox basename `/sbin/busybox readlink /system/bin/$line`)" = "recovery"; then
/sbin/busybox rm /system/bin/${line}
/sbin/busybox echo "Removing Bad BusyBox Install - /system/bin/"${line} >> /data/local/LoStKernel-Ver
if /sbin/busybox test -L "/system/bin/$line"; then
if /sbin/busybox test "$(/sbin/busybox basename `/sbin/busybox readlink /system/bin/$line`)" = "busybox"; then
/sbin/busybox rm /system/bin/${line}
/sbin/busybox echo "Removing Bad BusyBox Install - /system/bin/"${line} >> /data/local/LoStKernel-Ver
fi
if /sbin/busybox test "$(/sbin/busybox basename `/sbin/busybox readlink /system/bin/$line`)" = "recovery"; then
/sbin/busybox rm /system/bin/${line}
/sbin/busybox echo "Removing Bad BusyBox Install - /system/bin/"${line} >> /data/local/LoStKernel-Ver
fi
fi
done
# Relink Toolbox
Expand Down

0 comments on commit cd7d156

Please sign in to comment.