auto-launch scripts - G1 Android Development

Ok, searched and couldn't find, so if you know a thread where this is touched upon, please link to the post?
I'm trying to disable a2sd on JAC's latest rom (compcache just makes it so much more livable) and enable linux swap and compcache. what I ended up doing was modifying the a2sd script so that it checks for a third partition instead of a second, that way, I can disable a2sd by not having a third partition. I also changed the swap script to check for a second partition. I'm pretty much making a2sd optional in order to use compcache (since it's the a2sd script that launches the userinit.sh script at /system/sd, if there's no ext partition, it jumps to else and ignores the part to run userinit.sh). Anyway, I'm wondering how it is that a2sd is being launched on startup, and wether it's being launched on every single boot or just on first boot. I'm wondering because i want to replace it with my own script, now, i could either copy the contents of my script to a2sd script, or i could find out how it is that scripts are auto-launched on android so that i can add them later instead of just appending everything to the a2sd script and hoping it works (since some things will conflict).
Here's my modified script, anyway, if anybody is interested in running compcache and swap without a2sd, only need two partitions, fat32 and linux-swap, if you add a third ext2 partition, then you enable a2sd (data, dalvik-cache, and data-private, I like leaving app_s internal for speed):
notice, this is not MY script per se, just modified from jac's a2sd and the userinit.sh for cyanogen's compcache roms
Code:
#!/system/bin/sh
#
# Apps2SD using symlinks and bind mounts
# Thanks to Cyanogen modified by JAC
#
sysctl -p
if [ -e /dev/block/mmcblk0p3 ];
then
# fsck the sdcard filesystem first
e2fsck -y /dev/block/mmcblk0p3;
# set property with exit code in case an error occurs
setprop cm.e2fsck.errors $?;
# mount and set perms
busybox mount -o noatime,nodiratime -t auto /dev/block/mmcblk0p3 /system/sd;
busybox chown 1000:1000 /system/sd;
busybox chmod 771 /system/sd;
# clean up any old symlinks, create data directories
for i in dalvik-cache data;
do
if [ -h /data/$i ];
then
rm /data/$i;
fi;
if [ ! -d /data/$i ];
then
mkdir /data/$i;
busybox chown 1000:1000 /data/$i;
busybox chmod 771 /data/$i;
fi;
done;
# don't allow /data/data on sd because of upgrade issues - move it if possible
if [ -d /system/sd/data ];
then
busybox cp -a /system/sd/data/* /data/data/;
busybox rm -rf /system/sd/data;
fi;
# move apps and dalvik cache from internal memory to sdcard
for i in app dalvik-cache app-private;
do
if [ ! -d /system/sd/$i ];
then
mkdir /system/sd/$i;
fi
busybox chown 1000:1000 /system/sd/$i;
busybox chmod 771 /system/sd/$i
if [ -d /data/$i ] && [ ! -h /data/$i ];
then
busybox cp -a /data/$i/* /system/sd/$i/;
busybox rm -f /data/$i/*;
fi;
done;
# symlink app dirs - they must be on the same filesystem
for i in app dalvik-cache app-private;
do
if [ -d /data/$i ] && [ ! -h /data/$i ];
then
busybox rm -rf /data/$i;
busybox ln -s /system/sd/$i /data/$i;
fi;
done;
# clean up old whiteouts
for i in local misc property system tombstones data;
do
if [ -h /system/sd/$i ]; then rm -f /system/sd/$i; fi
done;
# please don't put odex files in the app directory people!
# it causes dexopt to crash when switching builds!
busybox rm -f /system/sd/app/*.odex
# call a userinit.sh script if it's present on the sdcard
if [ -e /system/sd/userinit.sh ];
then
/system/bin/sh /system/sd/userinit.sh;
fi;
setprop cm.a2sd.active 1;
else
# replace symlinks with directories so we can boot without sd
for i in app app-private;
do
if [ -h /data/$i ];
then
rm -f /data/$i;
mkdir /data/$i;
busybox chown 1000:1000 /data/$i;
busybox chmod 771 /data/$i;
fi;
done;
setprop cm.a2sd.active 0;
fi;
sync;
setprop cm.filesystem.ready 1;
#!/system/bin/sh
# Thanks to Denkai/Dwang
if [ -n /dev/block/mmcblk0p2 ];
then
mkswap /dev/block/mmcblk0p2;
fi;
if [ -e /dev/block/mmcblk0p2 ];
then
echo 20 > /proc/sys/vm/swappiness;
swapon /dev/block/mmcblk0p2;
fi;
insmod /system/modules/lib/modules/2.6.29-cm/compcache/xvmalloc.ko;
insmod /system/modules/lib/modules/2.6.29-cm/compcache/ramzswap.ko disksize_kb=24000;
mknod /dev/ramzswap0 b 253 0;
echo 20 > /proc/sys/vm/swappiness;
swapon /dev/ramzswap0;
exit;

Related

[PATCH][A2SD]MT3G Friendly a2sd Patch - Firerat

EDIT: 2010-05-13
a note on this modded a2sd and CM5
This mod is *not* required , cm5 has a newer/better way of implementing a2sd
but it will do no harm, it just simply won't do anything
Firerat Patch - a2sd for MT3G users
NOTE My Modified a2sd is intended for both G1s and MT3Gs, one a2sd suits both MT3G's and G1s
Ok, I thought it was about time I gave a full explanation on my mt3g-a2sd patch
why MT3G users should not use an ext partition
why MT3G users who have just 2 Parttions ( FAT / SWAP ) get failed boots
How my modifications reslove this situation
Why should MT3G users not use an ext partition?
the answer is quite simple really, they don't need it.
a2sd was designed with G1s in mind, the G1's /data partition has a limited amount of space available, just over 74mb or 89mb with 'DangerSPL' whereas the MT3G has just over 295mb around 3 or 4 times the G1's.
Although I have not 'benchmarked' the 'speeds' of internal vs sdcard , I belive it is widely accepted that the internal memory is significantly faster than sdcards, and therefore if an MT3G can use it, it should.
So I hope we are all now agree that the MT3G's internal memory should be used for apps/dalvik-cache
Why do MT3G users who have just 2 Parttions ( FAT / SWAP ) get failed boots?
the problem is within the a2sd script, here is a section of the code, with my annotations in blue
Code:
[COLOR="Blue"]Here the script checks for second partition[/COLOR]
if [ -e /dev/block/mmcblk0p2 ];
then
[COLOR="Blue"]it exists so it does a fsck on it [/COLOR]
# fsck the sdcard filesystem first
e2fsck -fy /dev/block/mmcblk0p2;
# set property with exit code in case an error occurs
setprop cm.e2fsck.errors $?;
[COLOR="Blue"] an error is returned ( it is swap not an extfs ) error no. is just stored, no action [/COLOR]
# mount and set permsd
busybox mount -o noatime,nodiratime -t auto /dev/block/mmcblk0p2 /system/sd;
[COLOR="Blue"] The above mount command fails, it is swap
<snip some link clean ups>[/COLOR]
# move apps and dalvik cache from internal memory to sdcard
for i in app app_s app-private dalvik-cache;
do
[COLOR="Blue"] here directories are normally created on sdcard
but as sdcard isn't mounted it tries to put them on the /system partition,
since /system is mounted read only , it fails[/COLOR]
if [ ! -d /system/sd/$i ];
then
mkdir /system/sd/$i;
fi
busybox chown 1000:1000 /system/sd/$i;
busybox chmod 771 /system/sd/$i
if [ -d /data/$i ] && [ ! -h /data/$i ];
then
[COLOR="Blue"] the next line tries to copy files from internal memory to /system/sd,
which is read only, it fails[/COLOR]
busybox cp -a /data/$i/* /system/sd/$i/;
busybox rm -f /data/$i/*;
[COLOR="Blue"] BANG , that line above just deleted all your apps,
your system will not boot[/COLOR]
fi;
done;
# symlink app dirs - they must be on the same filesystem
for i in app app_s app-private;
do
if [ -d /data/$i ] && [ ! -h /data/$i ];
then
busybox rm -rf /data/$i;
[COLOR="Blue"] its just removing empty directories,
and creating a link to none existent directories in /system/sd/[/COLOR]
busybox ln -s /system/sd/$i /data/$i;
fi;
done;
How my modifications reslove this situation
Quite simply by skipping the above code, with this.
Code:
# check if not a G1 ( assuming mt3g ) - Firerat 2010-03-23
rohardware=`getprop ro.hardware`
if [ "$rohardware" != "trout" ];
then
FindSwap
ReturnAppsToData
$SETPROP_CMD cm.filesystem.ready 1;
exit 0;
the != is not equal to, getprop ro.hardware will return sapphire, not trout,
so this code will run my findswap, and ReturnAppsToData Functions
you can find the ReturnAppsToData Function in my next post
Code:
FindSwap ()
{
if [ "`sed -n '$=' /proc/swaps`" -gt "1" ];
then
echo "Swap appears to be already setup, skipping checks"
return
else
for isitswap in `ls /dev/block/mmcblk0p*` ; do
swapon $isitswap 2>/dev/null
if [ "$?" = "0" ];
then
busybox mount -o rw,remount /system
sed s~/dev/block/mmcblk0p.~$isitswap~ /system/bin/user.conf -i
busybox mount -o ro,remount /system
break
else
echo "$isitswap is not swap"
fi
done
fi
return
}
next post contains my full modified a2sd
New Version 2.1
FireratModified-a2sd-2-1_S.zip
This one has the functions in the right place, so they *will* do something
################
Older versions
################
are a bit broken
Full Firerat Modified a2sd Code
It actually does a little more that just be friendly to MT3G, it will attempt to keep Dalvik-cache on /data
Code:
#!/system/bin/sh
#
# Apps2SD using symlinks and bind mounts
# [email protected] (cyanogen) Thanks Cy! & ccyrowski
# modified by Firerat 2010-03-24
# Skip a2sd functions if not a G1 ( mt3g in mind )
# Conditional added to location of Dalvik-cache, keep in internal memory where possible
# Firerat 2010-03-30 - added moving apps back to data for mt3g's
# Firerat-TODO - echo for when ran on terminal
#############################################################
RM_CMD="busybox rm"
MV_CMD="busybox mv"
CP_CMD="busybox cp"
LS_CMD="busybox ls"
LN_CMD="busybox ln"
MKDIR_CMD="busybox mkdir"
MOUNT_CMD="busybox mount"
UMOUNT_CMD="busybox umount"
SWAPON_CMD="busybox swapon"
# nb the df sticks out, toolbox df output is easier to cut up
DF_CMD="toolbox df"
DU_CMD="busybox du"
SED_CMD="busybox sed"
GREP_CMD="busybox grep"
CUT_CMD="busybox cut"
GETPROP_CMD="getprop"
SETPROP_CMD="setprop"
E2FSCK_CMD="e2fsck"
CHMOD_CMD="busybox chmod"
CHOWN_CMD="busybox chown"
SYNC_CMD="sync"
rohardware=`$GETPROP_CMD ro.hardware`
#############################################################
echo "+++ Welcome to Android `$GETPROP_CMD ro.build.version.release` / `getprop ro.modversion`";
sysctl -p
# check if not a G1 ( assuming mt3g ) - Firerat 2010-03-23
if [ "$rohardware" != "trout" ];
then
FindSwap
ReturnAppsToData
$SETPROP_CMD cm.filesystem.ready 1;
exit 0;
elif [ -e /dev/block/mmcblk0p2 ];
then
MountExt
# clean up any old symlinks, create data directories
for i in dalvik-cache data;
do
if [ -h /data/$i ];
then
$RM_CMD /data/$i;
fi
if [ ! -d /data/$i ];
then
$MKDIR_CMD /data/$i;
$CHOWN_CMD 1000:1000 /data/$i;
$CHMOD_CMD 771 /data/$i;
fi
done;
# don't allow /data/data on sd because of upgrade issues - move it if possible
if [ -d /system/sd/data ];
then
$CP_CMD -a /system/sd/data/* /data/data/;
$RM_CMD -rf /system/sd/data;
fi
# move apps and dalvik cache from internal memory to sdcard
# when possible keep dalvik-cache on internal memory Firerat 2010-03-23
# for i in app app_s app-private dalvik-cache;
# Firerat-TODO in the same way I try to keep Dalvik-Cache on internal, do same for apps
# therefore keeping things as fast as possible
# and if I get my head round aufs then can maybe do some moving based on priority list
# hell, could even build list based on useage if it's recorded in the dbs
for i in app app_s app-private ;
do
if [ ! -d /system/sd/$i ];
then
$MKDIR_CMD /system/sd/$i;
fi
$CHOWN_CMD 1000:1000 /system/sd/$i;
$CHMOD_CMD 771 /system/sd/$i
if [ -d /data/$i ] && [ ! -h /data/$i ];
then
$CP_CMD -a /data/$i/* /system/sd/$i/;
$RM_CMD -f /data/$i/*;
fi
done;
# symlink app dirs - they must be on the same filesystem
for i in app app_s app-private;
do
if [ -d /data/$i ] && [ ! -h /data/$i ];
then
$RM_CMD -rf /data/$i;
$LN_CMD -s /system/sd/$i /data/$i;
fi
done;
# bind mount dalvik-cache so we can still boot without the sdcard
# when possible keep dalvik-cache on internal memory Firerat 2010-02-24
# $MOUNT_CMD -o bind /system/sd/dalvik-cache /data/dalvik-cache;
# $CHOWN_CMD 1000:1000 /data/dalvik-cache;
# $CHMOD_CMD 771 /data/dalvik-cache;
DalvikCache
# clean up old whiteouts
for i in local misc property system tombstones data;
do
if [ -h /system/sd/$i ]; then $RM_CMD -f /system/sd/$i; fi
done;
# please don't put odex files in the app directory people!
# it causes dexopt to crash when switching builds!
$RM_CMD -f /system/sd/app/*.odex
# Firerat 2010-03-30 , not looked at this , but wrapper dexopt to ignore *.odex ?
else
# replace symlinks with directories so we can boot without sd
for i in app app-private;
do
if [ -h /data/$i ];
then
$RM_CMD -f /data/$i;
$MKDIR_CMD /data/$i;
$CHOWN_CMD 1000:1000 /data/$i;
$CHMOD_CMD 771 /data/$i;
fi
done;
fi
$SYNC_CMD;
FindSwap
#Set Fifo - King Klick - thanks Wes Garner!
for i in ` $LS_CMD -1 /sys/block/mtdblock*` /sys/block/mmcblk0
do
echo 1 > $i/queue/iosched/fifo_batch
done
# Firerat 2010-03-30 ^ should be in init.rc , or some other post boot script
$SETPROP_CMD cm.filesystem.ready 1;
# for now this can stay
if [ -e /data/fix_permissions.sh ];
then
sh /data/fix_permissions.sh
$RM_CMD /data/fix_permissions.sh
fi
### Firerat - Begin functions
MountExt ()
{
# Firerat Check /dev/block/mmcblk0p2 is mounted , so script can be run in terminal
if [ `$MOUNT_CMD |$GREP_CMD -q "/dev/block/mmcblk0p2";echo $?` != "0" ];
then
# fsck the sdcard filesystem first
$E2FSCK_CMD -fy /dev/block/mmcblk0p2;
# set property with exit code in case an error occurs
$SETPROP_CMD cm.e2fsck.errors $?;
# mount and set perms
$MOUNT_CMD -o noatime,nodiratime -t auto /dev/block/mmcblk0p2 /system/sd;
$CHOWN_CMD 1000:1000 /system/sd;
$CHMOD_CMD 771 /system/sd;
$SYNC_CMD
fi
return
}
FindSwap ()
{
if [ "`$SED_CMD -n '$=' /proc/swaps`" -gt "1" ];
then
echo "Swap appears to be already setup, skipping checks"
return
else
for isitswap in ` $LS_CMD /dev/block/mmcblk0p*` ; do
$SWAPON_CMD $isitswap 2>/dev/null
if [ "$?" = "0" ];
then
$MOUNT_CMD -o rw,remount /system
# Firerat 2010-03-30 - check for cache hack
if [ -d /system/csys ]; then
$MOUNT_CMD -o rw,remount /system/csys
fi
$SED_CMD s~/dev/block/mmcblk0p.~$isitswap~ /system/bin/user.conf -i
$MOUNT_CMD -o ro,remount /system
# Firerat 2010-03-30 - check for cache hack
if [ -d /system/csys ]; then
$MOUNT_CMD -o ro,remount /system/csys
fi
break
else
echo "$isitswap is not swap"
fi
done
fi
return
}
DalvikCache ()
{
# doubt they are going to change, but shoud set the 'paths' as variables
DataTotal_K=`$DF_CMD|$GREP_CMD \/data\:|$CUT_CMD -d " " -f2|$SED_CMD s/K//`
DataFree_K=`$DF_CMD|$GREP_CMD \/data\:|$CUT_CMD -d " " -f6|$SED_CMD s/K//`
DataDalvik_K=`$DU_CMD /data/dalvik-cache/|$CUT_CMD -f1`
# Pickup min free on data from config in future
Min_Data_Free_MB=10
Buffer_K=`expr $Min_Data_Free_MB \* 1024`
DataApp_K=`$DU_CMD /system/app/|$CUT_CMD -f1`
System_App_K=`$DU_CMD /data/app/|$CUT_CMD -f1`
if [ -d /system/sd/dalvik-cache ];
then
SD_Dalvik_K=`busybox $DU_CMD /system/sd/dalvik-cache|$CUT_CMD -f1`
else
SD_Dalvik_K="0"
fi
# Firerat-TODO - I'll finish these some other time
#echo "Data Partition size : ${DataTotal_K}K"
#echo "Free on Data Partition : ${DataFree_K}K"
#echo $DataDalvik_K
#echo $Min_Data_Free_MB
#echo $Buffer_K
#echo $DataApp_K
#echo $System_App_K
#echo $SD_Dalvik_K
if [ ! -d /system/sd/dalvik-cache ] && [ "$DataDalvik_K" -lt "1024" ] && [ "`expr \( $DataApp_K + $System_App_K \) \/2`" -lt "$DataFree_K" ];
then
DalvikToIntMem
else
# if DalvikCache + a bit is too big, move to SD card
if [ "`expr $DataDalvik_K + $Buffer_K`" -gt "`expr $DataFree_K + $DataDalvik_K`" ];
then
DalvikToSdCard
else
if [ "`expr "$SD_Dalvik_K" + "$Buffer_K"`" -lt "$DataFree_K" ];
then
DalvikToIntMem
fi
fi
fi
DalvikComplete
return
}
DalvikToIntMem ()
{
if [ -d /system/sd/dalvik-cache ];
then
# hmm, I should be not lazy look before I leap
$MKDIR_CMD /data/dalvik-cache-temp
$CHOWN_CMD 1000:1000 /data/dalvik-cache-temp
$CHMOD_CMD 771 /data/dalvik-cache-temp
$CP_CMD -a /system/sd/dalvik-cache/* /data/dalvik-cache-temp/
$UMOUNT_CMD /data/dalvik-cache
$RM_CMD -rf /data/dalvik-cache
$MV_CMD /data/dalvik-cache-temp /data/dalvik-cache
$RM_CMD -rf /system/sd/dalvik-cache
else
if [ ! -d /data/dalvik-cache ];
then
$MKDIR_CMD /data/dalvik-cache
fi
$CHOWN_CMD 1000:1000 /data/dalvik-cache
$CHMOD_CMD 771 /data/dalvik-cache
fi
return
}
DalvikToSdCard ()
{
$MKDIR_CMD /system/sd/dalvik-cache/
$CP_CMD -a /data/dalvik-cache/* /system/sd/dalvik-cache/
$RM_CMD /data/dalvik-cache/*
return
}
DalvikComplete ()
{
if [ -d /system/sd/dalvik-cache ] && [ "`$MOUNT_CMD |$GREP_CMD -q "/data/dalvik-cache";echo $?`" != "0" ];
then
$MOUNT_CMD -o bind /system/sd/dalvik-cache /data/dalvik-cache;
fi
$CHOWN_CMD 1000:1000 /data/dalvik-cache;
$CHMOD_CMD 771 /data/dalvik-cache;
return
}
ReturnAppsToData ()
{
# Firerat 2010-03-30
# only running this for none G1s, like mt3g
# allows this patched a2sd to be used on existing install that emulates G1 with broken keyboard
# will only move apps / dalvik i\f there is enough space on /data
# I can probably use this to move apps an a G1, but for now only calling if not g1
if [ -e /dev/block/mmcblk0p2 ] && [ "$isitswap" != "/dev/block/mmcblk0p2" ];
then
Min_Data_Free_MB=10
Buffer_K=`expr $Min_Data_Free_MB \* 1024`
DataFree_K=`$DF_CMD|$GREP_CMD \/data\:|$CUT_CMD -d " " -f6|$SED_CMD s/K//`
TotalAppsOnSD="0"
MountExt
# check to make sure apps on sd are not too large
for i in app app_s app-private dalvik-cache; do
if [ ! -d /system/sd/$i ];
then
SizeOnSD$i=`busybox $DU_CMD /system/sd/$i|$CUT_CMD -f1`
else
SizeOnSD$i="0"
fi
TotalAppsOnSD=`expr "$TotalAppsOnSD" + "SizeOnSD$i"`
done
if [ "$TotalAppsOnSD" -lt "`expr "$DataFree_K" - "$Buffer_K"`" ];
then
# Firerat 2010-03-30 NB, I'm not moving Dalvik-c here , as I already have a function for that
for i in app app_s app-private; do
if [ -d /system/sd/$i ] && [ -L /data/$i ];
then
# Firerat 2020-03-31 - Copy to temp, then remove link and move temp in place
$CP_CMD -a /system/sd/$i /data/$i-temp
$RM_CMD /data/$i
$MV_CMD /data/$i-temp /data/$i
if [ "$?" = "0" ];
then
$RM_CMD -rf /system/sd/$i
fi
fi
done
DalvikToIntMem
$UMOUNT_CMD /dev/block/mmcblk0p2
return
else
DalvikComplete
return
fi
else
return
fi
}
Original Code
Code:
#!/system/bin/sh
#
# Apps2SD using symlinks and bind mounts
# [email protected] (cyanogen) Thanks Cy! & ccyrowski
#
echo "+++ Welcome to Android `getprop ro.build.version.release` / `getprop ro.modversion`";
sysctl -p
if [ -e /dev/block/mmcblk0p2 ];
then
# fsck the sdcard filesystem first
e2fsck -fy /dev/block/mmcblk0p2;
# set property with exit code in case an error occurs
setprop cm.e2fsck.errors $?;
# mount and set perms
busybox mount -o noatime,nodiratime -t auto /dev/block/mmcblk0p2 /system/sd;
busybox chown 1000:1000 /system/sd;
busybox chmod 771 /system/sd;
#busybox mount /sdcard;
# clean up any old symlinks, create data directories
for i in dalvik-cache data;
do
if [ -h /data/$i ];
then
rm /data/$i;
fi;
if [ ! -d /data/$i ];
then
mkdir /data/$i;
busybox chown 1000:1000 /data/$i;
busybox chmod 771 /data/$i;
fi;
done;
# don't allow /data/data on sd because of upgrade issues - move it if possible
if [ -d /system/sd/data ];
then
busybox cp -a /system/sd/data/* /data/data/;
busybox rm -rf /system/sd/data;
fi;
# move apps and dalvik cache from internal memory to sdcard
for i in app app_s app-private dalvik-cache;
do
if [ ! -d /system/sd/$i ];
then
mkdir /system/sd/$i;
fi
busybox chown 1000:1000 /system/sd/$i;
busybox chmod 771 /system/sd/$i
if [ -d /data/$i ] && [ ! -h /data/$i ];
then
busybox cp -a /data/$i/* /system/sd/$i/;
busybox rm -f /data/$i/*;
fi;
done;
# symlink app dirs - they must be on the same filesystem
for i in app app_s app-private;
do
if [ -d /data/$i ] && [ ! -h /data/$i ];
then
busybox rm -rf /data/$i;
busybox ln -s /system/sd/$i /data/$i;
fi;
done;
# bind mount dalvik-cache so we can still boot without the sdcard
busybox mount -o bind /system/sd/dalvik-cache /data/dalvik-cache;
busybox chown 1000:1000 /data/dalvik-cache;
busybox chmod 771 /data/dalvik-cache;
# clean up old whiteouts
for i in local misc property system tombstones data;
do
if [ -h /system/sd/$i ]; then rm -f /system/sd/$i; fi
done;
# please don't put odex files in the app directory people!
# it causes dexopt to crash when switching builds!
busybox rm -f /system/sd/app/*.odex
else
# replace symlinks with directories so we can boot without sd
for i in app app-private;
do
if [ -h /data/$i ];
then
rm -f /data/$i;
mkdir /data/$i;
busybox chown 1000:1000 /data/$i;
busybox chmod 771 /data/$i;
fi;
done;
fi;
sync;
setprop cm.filesystem.ready 1;
this is for if I need some more space
great job again firerat.... alot of us appreciate your hard work and thoroughness!!!!!!!!!!!!!!!!!!!!!!! looking forward to add to my mt3g.... ive been experiencing many boot failures.....
dangambino said:
great job again firerat.... alot of us appreciate your hard work and thoroughness!!!!!!!!!!!!!!!!!!!!!!! looking forward to add to my mt3g.... ive been experiencing many boot failures.....
Click to expand...
Click to collapse
the Flash update in the OP should convert an MT3G emulating a G1 with broken keyboard back into an MT3G with a spare ext partition, for a chroot linux or something, or just fix it up before messing about re-partitioning
but I have to say, I have not tested the apps back to data part, it should check if there is room, it did cross my mind that some may have hundreds of apps and it they would be too big to fit, so I try to check
Lovely, thanks! I'm going to try this now, as I'm just re-flashing King's Legend2g1
Would this be able to run properly once a ROM is already established? Like a ROM I've had for a couple days? Or would this need to be flashed on a ROM that's recently installed. For instance:
Code:
Flash ROM
Flash a2sd
reboot
nolimit78 said:
Would this be able to run properly once a ROM is already established? Like a ROM I've had for a couple days? Or would this need to be flashed on a ROM that's recently installed. For instance:
Code:
Flash ROM
Flash a2sd
reboot
Click to expand...
Click to collapse
yes, my latest will copy app, app_s, app-private and dalvik-cache from the ext partition to /data
( unless it finds that they are all too big, in which case you are still g1 with broken keyboard but your gota have *a lot* of apps before that happens )
But as I only have a G1 I have not been able to test it properly, but the logic is straight forward so fingers crossed I have not missed a typo...
Hmm. I'm having a problem with it. Well, maybe with it. So the first time I wiped, repartitioned with just a swap (190mb) and the rest as fat32. I flashed Rom, then flashed your patch, then flashed the vega kernal patch. Booted up, it all worked, past the HTC quietly brilliant screen, but then sat there on the black HTC bit. If I let the screen sleep, it looked like Sense had loaded, but when I unlocked it it was still sitting there on the black HTC screen with Clock repeatedly FC'ing. So I wiped, reflashed this time just the Rom and the Patch and this time it's getting to the setup screen. It was working fine. I connected to wifi, then signed into my google account (still on the setup) and then onto the next screen about google using my location, and then Settings FC'd. Since then I've been in a loop of going back to the start of the Setup menu, never getting further than the language screen again. I will reboot and see if that helps. Failing that, I'll re-flash with JUST the rom, and see if it sets up ok. If so, I suppose I won't need the patch afterall!
I'll keep you updated.
Firerat said:
yes, my latest will copy app, app_s, app-private and dalvik-cache from the ext partition to /data
( unless it finds that they are all too big, in which case you are still g1 with broken keyboard but your gota have *a lot* of apps before that happens )
But as I only have a G1 I have not been able to test it properly, but the logic is straight forward so fingers crossed I have not missed a typo...
Click to expand...
Click to collapse
I flashed it as I was typing, just outta curiosity, and its seeming to work properly. Good work sir!
Thanks!! I'll try it out on superD and tell you how it goes
DanGrover said:
Hmm. I'm having a problem with it. Well, maybe with it. So the first time I wiped, repartitioned with just a swap (190mb) and the rest as fat32. I flashed Rom, then flashed your patch, then flashed the vega kernal patch. Booted up, it all worked, past the HTC quietly brilliant screen, but then sat there on the black HTC bit. If I let the screen sleep, it looked like Sense had loaded, but when I unlocked it it was still sitting there on the black HTC screen with Clock repeatedly FC'ing. So I wiped, reflashed this time just the Rom and the Patch and this time it's getting to the setup screen. It was working fine. I connected to wifi, then signed into my google account (still on the setup) and then onto the next screen about google using my location, and then Settings FC'd. Since then I've been in a loop of going back to the start of the Setup menu, never getting further than the language screen again. I will reboot and see if that helps. Failing that, I'll re-flash with JUST the rom, and see if it sets up ok. If so, I suppose I won't need the patch afterall!
I'll keep you updated.
Click to expand...
Click to collapse
Further to this, I rebooted and let it sit for a while, then tried again. I got as far as the Facebook sync bit on the Setup but no dice, FC settings and back to the start. So I wiped and re-flashed just the rom, which has now been sitting on the HTC Quietly Brilliant screen for about 15 minutes. The only option I haven't tried yet is installing Legend2g1 + the Vega patch, booting and seeing if it works.
DanGrover said:
Further to this, I rebooted and let it sit for a while, then tried again. I got as far as the Facebook sync bit on the Setup but no dice, FC settings and back to the start. So I wiped and re-flashed just the rom, which has now been sitting on the HTC Quietly Brilliant screen for about 15 minutes. The only option I haven't tried yet is installing Legend2g1 + the Vega patch, booting and seeing if it works.
Click to expand...
Click to collapse
try one of my Legend for NoneDangerSPLs
link in my sig
they are using an MT3G friendly a2sd out of the box, but without the apps back to data part
Firerat! This is AWESOME!!!!! I've needed this for a while, but my experience of bash scripting is less than mediocre.
I have 3 questions:
1) To make this usable on g1, I can just remove the ro.getprop section, correct? or do I need to change it instead of removing it?
2) To guess whether or not my /data folder will even fit on the g1, can I simply extract the zip and look at the file size of "data" folder inside, or is there something more? and if that barely fits, will dalvik-cache still go on sd?
3) If I am installing a bunch of apps and it fills up /data (assuming I am using this script), then will the "move apps and dalvik-cache to sd" option in amon_ra work?
Thanks man!
jcarrz1 said:
Firerat! This is AWESOME!!!!! I've needed this for a while, but my experience of bash scripting is less than mediocre.
I have two questions:
1) To make this usable on g1, I can just remove the ro.getprop section, correct? or do I need to change it instead of removing it?
Click to expand...
Click to collapse
Out of the box it will work with G1s and MT3Gs, that's the idea One Script two phones.
jcarrz1 said:
2) To guess whether or not my /data folder will even fit on the g1, can I simply extract the zip and look at the file size of "data" folder inside, or is there something more? and if that barely fits, will dalvik-cache still go on sd?
Thanks man!
Click to expand...
Click to collapse
with a G1 I let everything go to sd,
but if I work out that dalvik-cache will fit on data , leaving 10mb free I keep it on data
I do need to tweak it a little, the Legend Cache Hacks I have done need a reboot to push dalvik-cache to sd
And , in future ( providing DEVs adopt it ) all system apps can go to system
check my Eris / Legend on NoneDangerSPL in sig for more info
I can recommend the ErisCacheHack, and Legend for NoneDanger
( DangerLegend is still wip, but I'm hoping my latest works )
jcarrz1 said:
3) If I am installing a bunch of apps and it fills up /data (assuming I am using this script), then will the "move apps and dalvik-cache to sd" option in amon_ra work?
Thanks man!
Click to expand...
Click to collapse
yeah, it should do, the a2sd will move the dalvik-cache back if it thinks there is enough space, but at the moment it won't touch the apps
I am going to develop the a2sd a little more, and get it to auto move apps between data/sd depending on size
I kind of hint at that in the comments in the last function
but one of my goals is to get unionfs going, having some apps on internal and some on SD
it will also make the cache hack much easier
I'd just flash a linux base, the android being a tarball, and extract the android on first boot into a unionfs, if I'm right, the files will automagicaly go to where space is available
failing that, I have other ideas
Firerat said:
but one of my goals is to get unionfs going, having some apps on internal and some on SD
Click to expand...
Click to collapse
If working unionfs for a2sd search XDA (in particular, this forum) first. It's been done but was found wanting from a performance standpoint--you may as well build on that experience. You might also see if you get better results from aufs.
Firerat said:
yeah, it should do, the a2sd will move the dalvik-cache back if it thinks there is enough space, but at the moment it won't touch the apps
I am going to develop the a2sd a little more, and get it to auto move apps between data/sd depending on size
I kind of hint at that in the comments in the last function
but one of my goals is to get unionfs going, having some apps on internal and some on SD
it will also make the cache hack much easier
I'd just flash a linux base, the android being a tarball, and extract the android on first boot into a unionfs, if I'm right, the files will automagicaly go to where space is available
failing that, I have other ideas
Click to expand...
Click to collapse
Thanks for the quick response. In regard to #1, if I wanted to make the script do what it usually does on mt3g happen on my g1, can I simply remove those lines?
Also, I'm testing the legend patch right now ON DANGER, but fyi the 4shared links for the prepatched rom don't work... that's why I did it myself. flashing.
hmm.. Ill flash this over the current rom im using i guess and ill see how it goes. using that SuperEclair 2.3. should i wipe before flashing or its unnecessary?
Shaquiel Harris said:
hmm.. Ill flash this over the current rom im using i guess and ill see how it goes. using that SuperEclair 2.3. should i wipe before flashing or its unnecessary?
Click to expand...
Click to collapse
this isn't something you flash, it's something you stick into /system/bin when you're cooking a rom... as far as I know...

Script on startup.

How can I, run the script on system startup (CM7)? I made /data/locale/userinit.sh file, but it doesn't work...
Its /data/local
cdesai said:
Its /data/local
Click to expand...
Click to collapse
I had on mind '/data/local'.
Shouldn't it be '/system/etc/init.d/'?
And make sure it has the executable bit.
in /etc/init.d/20userinit I have this:
Code:
#!/system/bin/sh
# call a userinit.sh script if it's present on the sdcard
if [ "$SD_EXT_DIRECTORY" = "" ];
then
SD_EXT_DIRECTORY=/sd-ext;
fi;
if [ -e $SD_EXT_DIRECTORY/userinit.sh ];
then
log -p i -t userinit "Executing $SD_EXT_DIRECTORY/userinit.sh";
busybox chmod +x $SD_EXT_DIRECTORY/userinit.sh;
logwrapper /system/bin/sh $SD_EXT_DIRECTORY/userinit.sh;
setprop cm.userinit.active 1;
fi;
if [ -d $SD_EXT_DIRECTORY/userinit.d ];
then
logwrapper busybox run-parts $SD_EXT_DIRECTORY/userinit.d;
setprop cm.userinit.active 1;
fi;
if [ -e /data/local/userinit.sh ];
then
log -p i -t userinit "Executing /data/local/userinit.sh";
busybox chmod +x /data/local/userinit.sh;
logwrapper /system/bin/sh /data/local/userinit.sh;
setprop cm.userinit.active 1;
fi;
if [ -d /data/local/userinit.d ];
then
logwrapper busybox run-parts /data/local/userinit.d;
setprop cm.userinit.active 1;
fi;
This file should run my script in /data/local, yes?
Yep, it should work at data/local/userinit.sh I use sd-ext/userinit.sh and it works.
Execute permissions don't matter, the script takes care of that.
Sent from my HTC Desire using XDA App
Hmmm... When I put userinit.sh into /sd-ext, system remove this file after reboot. Why?

[Script] Chroot Control Script

One of the fun things you can do on your Android device, is to play around with different ways of getting a real distro (Debian, Ubuntu etc.) working along side the Android system. There are several (A lot) of tutorials in here on how to do this, so this part will not be covered here. This thread only contains some scripts that will help make it easier working with the chroot.
Most of the scripts that comes with the endless pool of chroot tutorials, is only made to mount and unmount the distro image in the most simple way. But nothing that helps walking in and out of the chroot without mount/unmount, and nothing that takes different services, busy devices etc. into consideration.
The debian.sh script in this thread has many tasks. It will on execution check to see if the image is mounted or not. If the image is mounted, it will just enter the chroot. If not, it will mount the image and then enter the chroot. On exit it will provide you with the option of exiting the chroot or exit and unmount.
Also it provides 4 custom scripts that is placed and executed inside the chroot. One for mount, unmount, enter chroot, leave chroot. This makes it possible to control chroot services much easier.
The script debian.sh is executed using the command "debian". You can also unmount the chroot from within the android shell by executing "debian unmount" instead of entering the chroot and then exit choosing to unmount.
The unmount process has several and different unmount attempts in case of busy devices, running services etc. which will make sure that the chroot is successfully unmounted.
File: /system/bin/debian
Code:
#!/system/bin/sh
su -c "/system/bin/debian.sh [email protected]"
File: /system/bin/debian.sh
Code:
#!/system/bin/sh
createLinuxBoot() {
if [ ! -f $FILESYSTEM ]; then
echo "Missing the $DIST filesystem image!"
return 0
elif [ ! -z "$(mount | grep "$MOUNTPOINT ")" ]; then
# If the loop device is already mounted, we do nothing.
echo " - $DIST is already mounted. Entering chroot..."
else
echo " - Executing mount proccess of $DIST..."
if [ ! -d $MOUNTPOINT ]; then
# Create the mount point if it does not already exist
busybox mkdir -p $MOUNTPOINT 2> /dev/null
if [ ! -d $MOUNTPOINT ]; then
echo "It was not possible to create the missing mount location ($MOUNTPOINT)!"
return 0
fi
fi
# Android places loop devices in /dev/block/ instead of root /dev/
# If there are none in /dev/ we create links between /dev/loopX and /dev/block/loopX so that losetup will work as it should.
if [ ! -e /dev/loop0 ]; then
for i in 0 1 2 3 4 5 6 7
do
# Create each block device
mknod /dev/loop$i b 7 $i
done
fi
# Android also placed the frame buffer in /dev/grapichs instead of /dev
if [ ! -e /dev/fb0 ]; then
mknod /dev/fb0 b 29 0
fi
# Locate the current loop device file
if [ ! -z "$(losetup | grep "$FILESYSTEM")" ]; then
# If the filesystem file is already attached to an loop device, we get the path to the device file.
loblk=$(losetup | grep "$FILESYSTEM" | cut -d ":" -f 1)
else
# If the filesystem file is not yet attached, we attach it.
loblk=$(losetup -f)
losetup $loblk $FILESYSTEM 2> /dev/null
# Make sure that the device was successfully attached to a loop device file
if [ -z "$(losetup | grep "$FILESYSTEM")" ]; then
echo "It was not possible to attach the $DIST filesystem to a loop device!"
return 0
fi
fi
# Mount the filesystem
mount $loblk $MOUNTPOINT 2> /dev/null
if [ ! -z "$(mount | grep "$MOUNTPOINT ")" ]; then
# Bind some Android dirs to the linux filesystem
for i in $MOUNT_BIND
do
# Bind the dirs if they are not already binded
if [ -z "$(mount | grep "$MOUNTPOINT/$i ")" ]; then
# Create any missing dirs in the mountpoint
if [ ! -d $MOUNTPOINT/$i ]; then
busybox mkdir -p $MOUNTPOINT/$i 2> /dev/zero
fi
mount --bind /$i $MOUNTPOINT/$i
fi
done
# FIX the "stdin: is not a tty" error in direct hadware case.
if [ -z "$(mount | grep "$MOUNTPOINT/dev/pts ")" ]; then
mount -t devpts devpts $MOUNTPOINT/dev/pts
fi
# For the network.
#sysctl -w net.ipv4.ip_forward=1
echo 1 > /proc/sys/net/ipv4/ip_forward
# Cleanup tmp folder.
rm -rf $MOUNTPOINT/tmp/*
else
echo "It was not possible to mount $DIST at the specified location ($MOUNTPOINT)!"
return 0
fi
if [ -f $MOUNTPOINT/etc/init.chroot/rc_mount.sh ]; then
# Execute the mount init file, if it exists
chroot $MOUNTPOINT /etc/init.chroot/rc_mount.sh
fi
echo " - $DIST was successsfully mounted. Entering chroot..."
fi
return 1
}
removeLinuxBoot() {
if [ -z "$(mount | grep "$MOUNTPOINT ")" ]; then
# If linux is not mounted, then do nothing.
echo " - $DIST is already unmounted. Exiting..."
else
echo " - Executing unmount process of $DIST..."
if [ -f $MOUNTPOINT/etc/init.chroot/rc_unmount.sh ]; then
# Execute the unmount init script, if it exist.
chroot $MOUNTPOINT /etc/init.chroot/rc_unmount.sh
fi
sync
# The sleep part is very important. It may take some time before /dev is no longer busy
# after executing some services in the rc_unmount.sh script.
sleep 1
# Make sure that we have an loop device file to use
if [ ! -z "$(losetup | grep "$FILESYSTEM")" ]; then
# Get the loop device file
loblk=$(losetup | grep "$FILESYSTEM" | cut -d ":" -f 1)
for i in $UMOUNT_BIND
do
# Unmount all binding dirs
if [ ! -z "$(mount | grep "$MOUNTPOINT/$i ")" ]; then
umount $MOUNTPOINT/$i 2> /dev/zero
fi
done
sync
# Unmount the device
# In most cases one umount attempt will be enough.
# However it may take up to 3 tries in order to make it work.
# It depends on the types of services running or has been running before unmounting.
umount $MOUNTPOINT 2> /dev/null && sleep 1 2> /dev/zero
if [ ! -z "$(mount | grep "$MOUNTPOINT ")" ]; then
sync
umount $MOUNTPOINT 2> /dev/null && sleep 1 2> /dev/zero
fi
# If the device could not be unmounted
if [ ! -z "$(mount | grep "$MOUNTPOINT ")" ]; then
echo " - Unable to unmount $DIST. Will attempt to kill attached processes..."
# Try to kill all processes holding the device
fuser -k -9 $loblk
sync
# Use umount with the -l option to take care of the rest
umount -l $MOUNTPOINT 2> /dev/null && sleep 1
fi
# Make sure the device has been successfully unmounted
if [ -z "$(mount | grep "$MOUNTPOINT ")" ]; then
# Try to detach the device from the loop device file
losetup -d $loblk 2> /dev/null
# Make sure that the device was successfully detached
if [ -z "$(losetup | grep "$FILESYSTEM")" ]; then
echo "$DIST has been successfully unmounted!"
else
echo "$DIST has been successfully unmounted, but was not able not detach the loop device!"
fi
else
echo "$DIST could not be successfully unmounted!"
fi
else
echo "Could not locate the loop device. $DIST was not unmounted!"
fi
fi
}
if [ -z "$EXPORTED" ]; then
export EXPORTED="TRUE"
# Basic needed variables
export TERM=linux
export HOME=/root
export USER=root
export LOGNAME=root
export UID=0
export SHELL=bash
# Here you can add all of the paths that should be binded. One list for mount and one reversed list for unmount.
export MOUNT_BIND="dev dev/pts dev/cpuctl proc sys sys/kernel/debug system d vendor acct sdcard cache sd-ext data"
export UMOUNT_BIND="dev/cpuctl dev/pts dev proc sys/kernel/debug d sys vendor acct sdcard cache sd-ext system data"
# Here you can change mount and image paths
export DIST="Debian" # The name of the distro. Is used for the messages.
export FILESYSTEM=/mnt/sdcard/debian.img # Path to the distro image file
export MOUNTPOINT=/data/debian # Path where the distro is to be mounted
fi
export OLDPATH=$PATH
export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/root/bin:$PATH
if [ "$1" = "unmount" ]; then
removeLinuxBoot
else
createLinuxBoot
if [ $? -eq 1 ]; then
if [ -f $MOUNTPOINT/etc/init.chroot/rc_enter.sh ]; then
chroot $MOUNTPOINT /etc/init.chroot/rc_enter.sh
fi
chroot $MOUNTPOINT /bin/bash -i
if [ -f $MOUNTPOINT/etc/init.chroot/rc_leave.sh ]; then
chroot $MOUNTPOINT /etc/init.chroot/rc_leave.sh
fi
echo -n " - Type [Y] to unmount $DIST or random key to exit chroot ]# "
read ACTION
if [ "$ACTION" = "y" ] || [ "$ACTION" = "Y" ]; then
removeLinuxBoot
fi
fi
fi
# Restore the PATH variable when executing chroot
export PATH=$OLDPATH
By default debian.sh will look for /mnt/sdcard/debian.img and mount it at /data/debian
The script has build-in first-time-install functionality that will create missing directories etc. Just change the variable "FILESYSTEM" in debian.sh to the correct path and filename of your distro image, and it will handle the rest.
Chroot Init Scripts
Inside your chroot, you can create the directory /etc/init.chroot and create the fallowing files.
rc_mount.sh - Executed after mount
rc_unmount.sh - Executed before unmount
rc_enter.sh - Executed when entering chroot
rc_leave.sh - Executed when leaving chroot
Here are an example of a mount and unmount script used to control tightvncserver.
File: (chroot) /etc/init.chroot/rc_mount.sh
Code:
#!/bin/sh
# Make sure that the vncserver is completly stopped before starting.
if [ ! -f /tmp/.X11-unix/X1 ] && [ ! -f /tmp/.X1-lock ]; then
# Start vncserver
vncserver -geometry 800x480 :1
else
# This is in case something went wrong the last time
# it was shut down. Perhaps an uncomplete unmount.
vncserver -kill :1 2> /dev/zero
unset /tmp/.X11-unix/X1 2> /dev/zero 2> /dev/zero
unset /tmp/.X1-lock 2> /dev/zero 2> /dev/zero
vncserver -geometry 800x480 :1
fi
File: (chroot) /etc/init.chroot/rc_unmount.sh
Code:
#!/bin/sh
# Only stop this if it is started
if [ -f /tmp/.X11-unix/X1 ] || [ -f /tmp/.X1-lock ]; then
vncserver -kill :1
# Make sure that these are removed
unset /tmp/.X11-unix/X1 2> /dev/zero
unset /tmp/.X1-lock 2> /dev/zero
fi
Using these scripts, the VNC Server is started on chroot mount and stopped on chroot unmount. You can still leave and enter the chroot keeping the VNC Server running.

[Q] Ice Cream Sandwich problem on JXD S5100 console

Hello folks,
ive bought this cheap android based console like 1 year ago for my son to play android games on it. In last few weeks ive figured that many apps are lost due some reason and i can see them with 0 kb in applications list. Ive bought new SD card from Kingston to test it with but still the same issue. After moving application to SD card with A2SD III, application disapears from console and from SD card. After several days spent on google ive found possible fix but im not able to apply it since i dont have in system file where this fix can be applied. I hope somebody can help me to locate or advice what file should be possibly modified. If you have any ideas, feel free to post them (except those to throw that crap out of window)
https://github.com/nadlabak/android...mmit/e5b9b3195687e04af7a7929f8637e77e1efae9a1
Thanks alot for any helpful comments.
Aiki
Please, some Android guru help me out with this
I presume noone has any single idea?
Aikimaniac said:
Hello folks,
ive bought this cheap android based console like 1 year ago for my son to play android games on it. In last few weeks ive figured that many apps are lost due some reason and i can see them with 0 kb in applications list. Ive bought new SD card from Kingston to test it with but still the same issue. After moving application to SD card with A2SD III, application disapears from console and from SD card. After several days spent on google ive found possible fix but im not able to apply it since i dont have in system file where this fix can be applied. I hope somebody can help me to locate or advice what file should be possibly modified. If you have any ideas, feel free to post them (except those to throw that crap out of window)
https://github.com/nadlabak/android...mmit/e5b9b3195687e04af7a7929f8637e77e1efae9a1
Thanks alot for any helpful comments.
Aiki
Click to expand...
Click to collapse
Format you're mem card (in your console itself ) then factory reset it....
Sent from my K-Touch W719 using XDA Premium 4 mobile app
shreygadikar said:
Format you're mem card (in your console itself ) then factory reset it....
Sent from my K-Touch W719 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
didnt help..im still looking for the file where i can set that parameter to avoid that services start before mounting of SD card is finished..
i think the problem is the "A2SD III". take another one like my script and test.
mildwild said:
i think the problem is the "A2SD III". take another one like my script and test.
Click to expand...
Click to collapse
have been out of country for some days..will test this asap and let you know...weird is that i removed SD card and installed game from market and it happened even without app was moved to SD card..i just lost it...looks like the ROM from factory is pretty messed up as well.. will let you know how this went..thanks alot
Not sure where to place this script..or if its necessary to modify some other already existing script... btw..this the original ROM if anyone experienced is willing to check it.. http://www.jxd.hk/download.asp?id=1152&selectclassid=020001 for what i would be very grateful :fingers-crossed:
Please gurus...help me out with this issue...here is the script and i have no idea where to put it... thanks in advance
Code:
#!/system/bin/sh
#
# Apps2SD using symlinks and bind mounts
# Original Apps2SD script by [email protected] (cyanogen)
# Fixed for slow detection of SD cards by _thalamus and output a bit more debugging info so we can see where problems are arising.
# execute any postinstall script then kill it
enablea2sd () {
# mount and set perms
busybox mount -o noatime,nodiratime -t auto /dev/block/mmcblk0p2 /sd-ext;
busybox chown 1000:1000 /sd-ext;
busybox chmod 771 /sd-ext;
# clean up any old symlinks, create data directories
for i in data;
do
if [ -h /data/$i ];
then
rm /data/$i;
fi;
if [ ! -d /data/$i ];
then
mkdir /data/$i;
busybox chown 1000:1000 /data/$i;
busybox chmod 771 /data/$i;
fi;
done;
# don't allow /data/data on sd because of upgrade issues - move it if possible
if [ -d /sd-ext/data ];
then
busybox cp -a /sd-ext/data/* /data/data/;
busybox rm -rf /sd-ext/data;
fi;
# move apps from internal memory to sdcard
for i in app app-private dalvik-cache;
do
if [ ! -d /sd-ext/$i ];
then
mkdir /sd-ext/$i;
fi
busybox chown 1000:1000 /sd-ext/$i;
busybox chmod 771 /sd-ext/$i
if [ -d /data/$i ] && [ ! -h /data/$i ];
then
busybox cp -a /data/$i/* /sd-ext/$i/;
busybox rm -f /data/$i/*;
fi;
done;
# symlink app dirs - they must be on the same filesystem
for i in app app-private dalvik-cache;
do
if [ -d /data/$i ] && [ ! -h /data/$i ];
then
busybox rm -rf /data/$i;
busybox ln -s /sd-ext/$i /data/$i;
fi;
done;
# clean up old whiteouts
for i in local misc property system tombstones data;
do
if [ -h /sd-ext/$i ]; then rm -f /sd-ext/$i; fi
done;
# please don't put odex files in the app directory people!
# it causes dexopt to crash when switching builds!
busybox rm -f /sd-ext/app/*.odex
echo "+++ Apps-to-SD successfully enabled";
}
disablea2sd() { # replace symlinks with directories so we can boot without sd
for i in app app-private dalvik-cache;
do
if [ -h /data/$i ];
then
rm -f /data/$i;
mkdir /data/$i;
busybox chown 1000:1000 /data/$i;
busybox chmod 771 /data/$i;
fi;
done;
}
if [ -e /dev/block/mmcblk0p1 ]; # We check for the presence of the FAT partition first to see if the SD has initialised.
then
echo "SD Card has been initialised...checking for ext partition.";
if [ -e /dev/block/mmcblk0p2 ]; # If false, it isn't there so we don't have to sleep the script and delay the boot.
then
enablea2sd;
else
echo "No ext partition present, apps2sd disabled";
disablea2sd;
fi;
else
sleep 4; #Enables time for a slow SD to be detected and populate the device nodes.
if [ -e /dev/block/mmcblk0p2 ];
then
echo "enablea2sd for slow SD card";
enablea2sd;
else
echo "No ext partition present after sleep, apps2sd disabled";
disablea2sd;
fi;
fi;
sync;

[SCRIPT/ZIP][v1.3] Init.d enabler @ stock kernel / ALL DEVICES / NO BUSYBOX needed

I present you universal script to enable Init.d in ALL ANDROID DEVICES (I hope...) while running the stock kernel. NO BUSYBOX needed! It is packed in easy to use ZIP flashable
EDIT: This script will NOT work with Magisk! However, notice that using Magisk you do not need init.d support at all (you can put your scripts in /magisk/.core/post-fs-data.d OR /magisk/.core/service.d, depending on your needs).
Requirements:
- a rooted Android device (SuperSU)
- ANY tool to flash a ZIP (custom recovery or FlashFire app)
Installation:
1. Custom recovery - open file using "Install Zip" option and confirm "Yes - install..."
2. FlashFire - open file using "Flash ZIP or OTA" option (default mount options). Tap "FLASH"
How to check:
Just check if /data/initd_test.log file exists (optionally you can check its content)
Changelog:
v1.3:
★ This version automatically detects privileges of launched sh script used to trigger init.d and if these are not sufficient to remount /system rw - all commands are automatically expanded to "/su/bin/su -c [command]" or "/system/xbin/su -c [command]" (depending on SuperSU install mode)
★ Fixed problem with "exit 0" at the end of used sh script resulting that simply added new lines never worked. This version automatically detects such case and moves "exit 0" at the end of modified file
★ SELinux context autodetection - starting from v1.3 modified file has always exact same context as original file
★ BusyBox will not be used anymore, even if exists (checking the presence removed)
v1.2:
★ Starting from this version installer performs more secure and only 100% reversible actions. Original *.sh file is never touched (just renamed to *.bak to keep its original attributes, including context). Installer will try to set to modified file as many attributes taken from original file as possible (instead of forcing "known values").
★ Added initd_remover.zip. Use it if you want to remove Init.d support (enabled by script from this thread!) and restore 100% original system files
v1.1:
★ Avoids potential WiFi problems in case of Samsung S6 (and probably other Samsung's Exynos based devices running Android 6.0.1) - see post #3
v1.0:
★ Initial version
Enabler [sh script]:
Code:
#!/sbin/sh
# Init.d enabler by ALEXNDR (_alexndr @ XDA)
OUTFD=/proc/self/fd/$2
ui_print() {
echo -n -e "ui_print $1\n" >> $OUTFD
echo -n -e "ui_print\n" >> $OUTFD
}
set_perm() {
chown $1.$2 $4
chown $1:$2 $4
chmod $3 $4
if [ -z "$5" ] ; then
chcon u:object_r:system_file:s0 $4
else
chcon u:object_r:$5:s0 $4
fi
}
resolve_link() {
if [ -z "$1" ] || [ ! -e $1 ] ; then return 1 ; fi
local VAR=$1
while [ -h "$VAR" ] ; do
VAR=$(readlink $VAR)
done
echo $VAR
}
is_mounted() {
if [ -z "$2" ] ; then
cat /proc/mounts | grep $1 >/dev/null
else
cat /proc/mounts | grep $1 | grep "$2," >/dev/null
fi
return $?
}
ui_print " "
ui_print "=========================================="
ui_print "Init.d enabler by ALEXNDR (_alexndr @ XDA)"
ui_print "=========================================="
ui_print " "
SYSTEM=$(resolve_link $(find /dev/block/platform -type l | grep -i -m 1 "/app$")) ||
SYSTEM=$(resolve_link $(find /dev/block/platform -type l | grep -i -m 1 "/system$"))
if (! is_mounted /system) ; then mount -o rw /system ; fi
if (! is_mounted /system rw) ; then mount -o rw,remount /system ; fi
if (! is_mounted /system rw) ; then mount -t ext4 -o rw $SYSTEM /system ; fi
if (! is_mounted /system rw) ; then mount -t f2fs -o rw $SYSTEM /system ; fi
if (! is_mounted /system rw) ; then
ui_print "Failed! Can't mount /system rw, aborting!"
ui_print " "
exit 1
fi
SYSLIB=/system/lib
cat /system/build.prop | grep "ro.product.cpu.abilist=" | grep "64" >/dev/null && SYSLIB=/system/lib64
cat /system/build.prop | grep "ro.product.cpu.abi=" | grep "64" >/dev/null && SYSLIB=/system/lib64
# These files are prefered to trigger init.d scripts (in following order, if exists):
# /system/etc/init.*.post_boot.sh
# /system/etc/*.post_boot.sh
# /system/etc/init.*.boot.sh
# /system/etc/*.boot.sh
#
# /system/bin/debuggerd is used if there is no suitable *.sh file in /system/etc
BOOTFILE=$(ls /system/etc/*.sh 2>/dev/null | grep -m 1 "/init\..*\.post_boot\.sh$") ||
BOOTFILE=$(ls /system/etc/*.sh 2>/dev/null | grep -m 1 "\.post_boot\.sh$") ||
BOOTFILE=$(ls /system/etc/*.sh 2>/dev/null | grep -m 1 "/init\..*\.boot\.sh$") ||
BOOTFILE=$(ls /system/etc/*.sh 2>/dev/null | grep -m 1 "\.boot\.sh$") ||
BOOTFILE=/system/bin/debuggerd
BOOTCON=$(ls -Z $BOOTFILE 2>/dev/null | grep "u:object_r" | cut -d: -f3)
if [ -z "$BOOTCON" ] ; then
BOOTCON=$(LD_LIBRARY_PATH=$SYSLIB /system/bin/toolbox ls -Z $BOOTFILE 2>/dev/null | grep "u:object_r" | cut -d: -f3)
fi
if [ -z "$BOOTCON" ] ; then
BOOTCON=$(LD_LIBRARY_PATH=$SYSLIB /system/bin/toybox ls -Z $BOOTFILE 2>/dev/null | grep "u:object_r" | cut -d: -f3)
fi
if [ -z "$BOOTCON" ] ; then
BOOTCON=system_file
fi
cat $BOOTFILE | grep "^exit 0" >/dev/null && EXIT=true || EXIT=false
if [ -z "$(cat $BOOTFILE | grep "Init\.d")" ] ; then
if [ "$BOOTFILE" = "/system/bin/debuggerd" ] ; then
if [ ! -f /system/bin/debuggerd_real ] ; then
mv -f $BOOTFILE /system/bin/debuggerd_real
echo "#!/system/bin/sh" > $BOOTFILE
else
sed -i '/debuggerd_real/d' $BOOTFILE
fi
else
mv -f $BOOTFILE "$BOOTFILE.bak"
cp -pf "$BOOTFILE.bak" $BOOTFILE
if ($EXIT) ; then sed -i '/^exit 0/d' $BOOTFILE ; fi
echo "" >> $BOOTFILE
fi
echo "# Init.d support" >> $BOOTFILE
echo 'SU="$(ls /su/bin/su 2>/dev/null || ls /system/xbin/su) -c"' >> $BOOTFILE
echo 'mount -o rw,remount /system && SU="" || eval "$SU mount -o rw,remount /system"' >> $BOOTFILE
echo 'eval "$SU chmod 777 /system/etc/init.d"' >> $BOOTFILE
echo 'eval "$SU chmod 777 /system/etc/init.d/*"' >> $BOOTFILE
echo 'eval "$SU mount -o ro,remount /system"' >> $BOOTFILE
echo 'ls /system/etc/init.d/* 2>/dev/null | while read xfile ; do eval "$SU /system/bin/sh $xfile" ; done' >> $BOOTFILE
if [ "$BOOTFILE" = "/system/bin/debuggerd" ] ; then
echo '/system/bin/debuggerd_real [email protected]' >> $BOOTFILE
set_perm 0 2000 755 $BOOTFILE $BOOTCON
else
if ($EXIT) ; then echo "exit 0" >> $BOOTFILE ; fi
chcon u:object_r:$BOOTCON:s0 $BOOTFILE
fi
mkdir -p /system/etc/init.d
echo "#!/system/bin/sh" > /system/etc/init.d/00test
echo "# Init.d test" >> /system/etc/init.d/00test
echo 'echo "Init.d is working !!!" > /data/initd_test.log' >> /system/etc/init.d/00test
echo 'echo "excecuted on $(date +"%d-%m-%Y %r")" >> /data/initd_test.log' >> /system/etc/init.d/00test
echo "#!/system/bin/sh" > /system/etc/init.d/99SuperSUDaemon
echo "/system/xbin/daemonsu --auto-daemon &" >> /system/etc/init.d/99SuperSUDaemon
set_perm 0 0 777 /system/etc/init.d
set_perm 0 0 777 "/system/etc/init.d/*"
ui_print "Init.d has been successfully enabled"
ui_print "using following file run at boot:"
ui_print " "
ui_print "$BOOTFILE"
ui_print " "
ui_print "Check result in /data/initd_test.log file"
ui_print " "
else
ui_print "Init.d is enabled already, aborting!"
ui_print " " # exit is not necessary
fi
umount /system
exit 0
Remover [sh script]:
Code:
#!/sbin/sh
# Init.d remover by ALEXNDR (_alexndr @ XDA)
OUTFD=/proc/self/fd/$2
ui_print() {
echo -n -e "ui_print $1\n" >> $OUTFD
echo -n -e "ui_print\n" >> $OUTFD
}
resolve_link() {
if [ -z "$1" ] || [ ! -e $1 ] ; then return 1 ; fi
local VAR=$1
while [ -h "$VAR" ] ; do
VAR=$(readlink $VAR)
done
echo $VAR
}
is_mounted() {
if [ -z "$2" ] ; then
cat /proc/mounts | grep $1 >/dev/null
else
cat /proc/mounts | grep $1 | grep "$2," >/dev/null
fi
return $?
}
ui_print " "
ui_print "=========================================="
ui_print "Init.d remover by ALEXNDR (_alexndr @ XDA)"
ui_print "=========================================="
ui_print " "
SYSTEM=$(resolve_link $(find /dev/block/platform -type l | grep -i -m 1 "/app$")) ||
SYSTEM=$(resolve_link $(find /dev/block/platform -type l | grep -i -m 1 "/system$"))
if (! is_mounted /system) ; then mount -o rw /system ; fi
if (! is_mounted /system rw) ; then mount -o rw,remount /system ; fi
if (! is_mounted /system rw) ; then mount -t ext4 -o rw $SYSTEM /system ; fi
if (! is_mounted /system rw) ; then mount -t f2fs -o rw $SYSTEM /system ; fi
if (! is_mounted /system rw) ; then
ui_print "Failed! Can't mount /system rw, aborting!"
ui_print " "
exit 1
fi
BOOTFILE=$(ls /system/etc/*.sh 2>/dev/null | grep -m 1 "/init\..*\.post_boot\.sh$") ||
BOOTFILE=$(ls /system/etc/*.sh 2>/dev/null | grep -m 1 "\.post_boot\.sh$") ||
BOOTFILE=$(ls /system/etc/*.sh 2>/dev/null | grep -m 1 "/init\..*\.boot\.sh$") ||
BOOTFILE=$(ls /system/etc/*.sh 2>/dev/null | grep -m 1 "\.boot\.sh$") ||
BOOTFILE=/system/bin/debuggerd
if [ ! -z "$(cat $BOOTFILE | grep "Init\.d")" ] ; then
if [ "$BOOTFILE" = "/system/bin/debuggerd" ] ; then
if [ -f /system/bin/debuggerd_real ] ; then
rm -f $BOOTFILE
mv -f /system/bin/debuggerd_real $BOOTFILE
else
ui_print "Failed! Missing debuggerd_real file!"
exit 1
fi
elif [ -f "$BOOTFILE.bak" ] ; then
rm -f $BOOTFILE
mv -f "$BOOTFILE.bak" $BOOTFILE
else
ui_print "Failed! Missing *.sh.bak file!"
exit 1
fi
rm -Rf /system/etc/init.d
ui_print "Init.d has been successfully removed :)"
else
ui_print "Init.d by ALEXNDR has not been detected!"
fi
ui_print " "
umount /system
exit 0
NOTE:
If it does not work for your device - please post here a feedback! I will try to find a reason and tune my script
Credits: @Chainfire, @JustArchi
Hit Thanks button if you like my work. If you really appreciate my work - feel free to buy me a beer
Great Work..
Thanks
@_alexndr mate today i tried ur init.d enabled but on my s6 mm 6.0.1 its bricked my wifi as after flashing ur script i can't get wifi connected any fix for MM ?? Thanks
thereassaad said:
@_alexndr mate today i tried ur init.d enabled but on my s6 mm 6.0.1 its bricked my wifi as after flashing ur script i can't get wifi connected any fix for MM ?? Thanks
Click to expand...
Click to collapse
In my case work good no problem with WiFi connection on S5 MM 6.0.1
Regards
thereassaad said:
@_alexndr mate today i tried ur init.d enabled but on my s6 mm 6.0.1 its bricked my wifi as after flashing ur script i can't get wifi connected any fix for MM ?? Thanks
Click to expand...
Click to collapse
Strange as my installer in case of G920F should only add to /system/etc/init.sec.boot.sh following lines:
Code:
# Init.d support
mount -o rw,remount /system
chmod 777 /system/etc/init.d
chmod 777 /system/etc/init.d/*
mount -o ro,remount /system
busybox run-parts /system/etc/init.d
or following if busybox has not been installed:
Code:
# Init.d support
mount -o rw,remount /system
chmod 777 /system/etc/init.d
chmod 777 /system/etc/init.d/*
mount -o ro,remount /system
ls /system/etc/init.d/* 2>/dev/null | while read xfile ; do $xfile ; done
Original file should be renamed to /system/etc/init.sec.boot.sh.bak, so you can just delete modified init.sec.boot.sh and then rename init.sec.boot.sh.bak -> init.sec.boot.sh to revert changes (+ delete /system/etc/init.d folder but it's just a cosmetic)
...but before you do it - it would be great if you help in further development and try if following command put in terminal emulator or adb shell will help:
Code:
su
mount -o rw,remount /system
chmod 550 /system/etc/init.sec.boot.sh
chown 0:2000 /system/etc/init.sec.boot.sh
chcon u:object_r:sec-sh_exec:s0 /system/etc/init.sec.boot.sh
mount -o ro,remount /system
...then reboot device
EDIT:
Anyway - #1 has been updated as I found potential permissions / SELinux context mismatch in case of Samsung's Exynos based devices running Android 6.0.1. NOTE: It will not fix broken installation already done - you need to revert changes first (as I mentioned above - by deleting init.sec.boot.sh and renaming init.sec.boot.sh.bak -> init.sec.boot.sh) and then re-flash v1.1
Another update
Changelog:
v1.2:
★ Starting from this version installer performs more secure and only 100% reversible actions. Original *.sh file is never touched (just renamed to *.bak to keep its original attributes, including context). Installer will try to set to modified file as many attributes taken from original file as possible (instead of forcing "known values").
★ Added initd_remover.zip. Use it if you want to remove Init.d support (enabled by script from this thread!) and restore 100% original system files
@_alexndr , definitely mate will give a shot , later , thanks for ur work xD ,
good work bro will test more with new update
Good work ?
Sent from my A66A using XDA-Developers mobile app
Another update
Changelog:
v1.3:
★ This version automatically detects privileges of launched sh script used to trigger init.d and if these are not sufficient to remount /system rw - all commands are automatically expanded to "/su/bin/su -c [command]" or "/system/xbin/su -c [command]" (depending on SuperSU install mode)
★ Fixed problem with "exit 0" at the end of used sh script resulting that simply added new lines never worked. This version automatically detects such case and moves "exit 0" at the end of modified file
★ SELinux context autodetection - starting from v1.3 modified file has always exact same context as original file
★ BusyBox will not be used anymore, even if exists (checking the presence removed)
First of all really thank you for this script which works very well...except if included in the installation script.
The initd.sh is this
I use this command in the updater-script:
ui_print("@ Add init.d support");
package_extract_file("tools/initd.sh", "/tmp/initd.sh");
set_perm(0, 0, 0777, "/tmp/initd.sh");
run_program("/tmp/initd.sh");
delete("/tmp/initd.sh");
ui_print("--> Init.d Installed");
But not working. Got this error in recovery log
run_program: execv failed: No such file or directory
run_program: child exited with status 1
Any advice or a proper .sh script please ?
Thanks very much.
WILMANS2M said:
First of all really thank you for this script which works very well...except if included in the installation script.
The initd.sh is this
I use this command in the updater-script:
ui_print("@ Add init.d support");
package_extract_file("tools/initd.sh", "/tmp/initd.sh");
set_perm(0, 0, 0777, "/tmp/initd.sh");
run_program("/tmp/initd.sh");
delete("/tmp/initd.sh");
ui_print("--> Init.d Installed");
But not working. Got this error in recovery log
run_program: execv failed: No such file or directory
run_program: child exited with status 1
Any advice or a proper .sh script please ?
Thanks very much.
Click to expand...
Click to collapse
My script (as it is in post #1) is designed to be standalone installer. If you want to enable init.d by a sh script called from the updater-script - please try as follow:
Code:
#!/sbin/sh
# Init.d enabler by ALEXNDR (_alexndr @ XDA)
set_perm() {
chown $1.$2 $4
chown $1:$2 $4
chmod $3 $4
if [ -z "$5" ] ; then
chcon u:object_r:system_file:s0 $4
else
chcon u:object_r:$5:s0 $4
fi
}
# These files are prefered to trigger init.d scripts (in following order, if exists):
# /system/etc/init.*.post_boot.sh
# /system/etc/*.post_boot.sh
# /system/etc/init.*.boot.sh
# /system/etc/*.boot.sh
#
# /system/bin/debuggerd is used if there is no suitable *.sh file in /system/etc
BOOTFILE=$(ls /system/etc/*.sh 2>/dev/null | grep -m 1 "/init\..*\.post_boot\.sh$") ||
BOOTFILE=$(ls /system/etc/*.sh 2>/dev/null | grep -m 1 "\.post_boot\.sh$") ||
BOOTFILE=$(ls /system/etc/*.sh 2>/dev/null | grep -m 1 "/init\..*\.boot\.sh$") ||
BOOTFILE=$(ls /system/etc/*.sh 2>/dev/null | grep -m 1 "\.boot\.sh$") ||
BOOTFILE=/system/bin/debuggerd
BOOTCON=$(ls -Z $BOOTFILE 2>/dev/null | grep "u:object_r" | cut -d: -f3)
if [ -z "$BOOTCON" ] ; then
BOOTCON=system_file
fi
cat $BOOTFILE | grep "^exit 0" >/dev/null && EXIT=true || EXIT=false
if [ -z "$(cat $BOOTFILE | grep "[Ii]nit\.d")" ] ; then
if [ "$BOOTFILE" = "/system/bin/debuggerd" ] ; then
if [ ! -f /system/bin/debuggerd_real ] ; then
mv -f $BOOTFILE /system/bin/debuggerd_real
echo "#!/system/bin/sh" > $BOOTFILE
else
sed -i '/debuggerd_real/d' $BOOTFILE
fi
else
mv -f $BOOTFILE "$BOOTFILE.bak"
cp -pf "$BOOTFILE.bak" $BOOTFILE
if ($EXIT) ; then sed -i '/^exit 0/d' $BOOTFILE ; fi
echo "" >> $BOOTFILE
fi
echo "# Init.d support" >> $BOOTFILE
echo 'SU="$(ls /su/bin/su 2>/dev/null || ls /system/xbin/su) -c"' >> $BOOTFILE
echo 'mount -o rw,remount /system && SU="" || eval "$SU mount -o rw,remount /system"' >> $BOOTFILE
echo 'eval "$SU chmod 777 /system/etc/init.d"' >> $BOOTFILE
echo 'eval "$SU chmod 777 /system/etc/init.d/*"' >> $BOOTFILE
echo 'eval "$SU mount -o ro,remount /system"' >> $BOOTFILE
echo 'ls /system/etc/init.d/* 2>/dev/null | while read xfile ; do eval "$SU /system/bin/sh $xfile" ; done' >> $BOOTFILE
if [ "$BOOTFILE" = "/system/bin/debuggerd" ] ; then
echo '/system/bin/debuggerd_real [email protected]' >> $BOOTFILE
set_perm 0 2000 755 $BOOTFILE $BOOTCON
else
if ($EXIT) ; then echo "exit 0" >> $BOOTFILE ; fi
chcon u:object_r:$BOOTCON:s0 $BOOTFILE
fi
mkdir -p /system/etc/init.d
echo "#!/system/bin/sh" > /system/etc/init.d/00test
echo "# Init.d test" >> /system/etc/init.d/00test
echo 'echo "Init.d is working !!!" > /data/initd_test.log' >> /system/etc/init.d/00test
echo 'echo "excecuted on $(date +"%d-%m-%Y %r")" >> /data/initd_test.log' >> /system/etc/init.d/00test
echo "#!/system/bin/sh" > /system/etc/init.d/99SuperSUDaemon
echo "/system/xbin/daemonsu --auto-daemon &" >> /system/etc/init.d/99SuperSUDaemon
set_perm 0 0 777 /system/etc/init.d
set_perm 0 0 777 "/system/etc/init.d/*"
fi
exit 0
Thanks for the answer. Will try it asap and give you feedback.
Envoyé de mon GT-I9505 en utilisant Tapatalk
hello @_alexndr
So tried again with the sh modified script, but same thing. Same error and no initd installed unfortunately
If you have any other advice, i really thank you in advance.
i tried something different. I keep your original zip file, and put it in tools/initd folder in my custom rom
Then i added this in the updater script:
ui_print("@ Add init.d support");
package_extract_dir("tools/initd", "/tmp/initd");
run_program("/sbin/busybox", "unzip", "/tmp/initd/initd.any.stock.1.3.zip", "META-INF/com/google/android/*", "-d", "/tmp/initd");
run_program("/sbin/busybox", "sh", "/tmp/initd/META-INF/com/google/android/update-binary", "dummy", "1", "/tmp/initd/initd.any.stock.1.3.zip");
ui_print("--> Init.d Installed");
IT WORKS with this
Thanks
great job
You sir are an animal. This script is intelligently designed
Deleted
Hey, Firstly thanks for all your work!
I've not tried this yet but I'm working on stock based ROM nd I want to enable to init.d support in it.
I've used the SuperR's Kitchen to enable the init.d support in the kernel nd I could find the script in the kernel too. Not sure if it'll work or not as I haven't tested in yet. So I hope you can tell me if I need to enable this way too or not,
Thanks.
@_alexndr
Thanks a lot
Confirmed Working on Samsung Galaxy S5 G900H
OS: Stock Deodexed Marshmallow 6.0.1 with GreenApple Kernal

Categories

Resources