[Resolved] [Q] Problems on creating startup scripts - General Questions and Answers

Recently, I flashed CM10 to my phone. Since I bumped into the brightness problem, someone told me to run
Code:
echo 0,0,0,0,0,0,0 > /sys/class/leds/lcd-backlight/als/curve
and it did work.
So I wrote this script into /data/local/userinit.sh and hope it will automaticly edit the brightness level after every boot, but it didn't.
I'm sure I'm using userinit.sh correctly because I managed to run some other scripts like "echo test > /data/local/test.txt".
Is there any way to run this script correctly at startup? Or can I just edit the file permanently?
/*=========================================*/
Resolved by myself
It seems that the system will restore the file at startup after running the user script.
so just:
Code:
chmod 777 /sys/class/leds/lcd-backlight/als/curve
cat /data/local/curve > /sys/class/leds/lcd-backlight/als/curve
chmod 444 /sys/class/leds/lcd-backlight/als/curve
I've saved "0,0,0,0,0,0,0" to /data/local/curve

I tried
Code:
chmod 777 /sys/class/leds/lcd-backlight/als/curve
echo 0,0,0,0,0,0,0 > /sys/class/leds/lcd-backlight/als/curve
in the userinit.sh
Didn't work as well

Related

REQUEST/IDEA for a safety script for tweaking/OC

I had an Idea for a script that would run at bootup, and if a certain variable had a "value" of NOT 1.
then the script would change the CHMOD of a userinit.sh located in the sd-ext from 050 or 777 to 750 then it would change the variable "value" to 0 were it would stay untill another script that runs at shut down or reboot setts the variable to 1 and changes CHMOD back to 050 or 777 so that the userinit.sh is not run.
That way if a change is made during operating the phone that causes the phone to crash with out shutting down properly the script runs which causes the userinit.sh to run and "resets" userinit.sh values to a "default". Otherwise if shut down properly nothing happens.
This could be expanded on to include repairing the EXT or clearing some special cache or other stuff I am unfamiliar with but that you might want to run after a crash.(like logcat?)
any way what do you think? any promise?
I think, for overclocking purposes anyway, making the userinit.sh unrunnable would make the phone break immediately, as I think it would go to the highest available frequency. However, I like the idea, though I'm not sure how to run scripts on shutdown. I think for overclocking, it would check if the shutdown was clean on startup, and if not change the applicable line to the next lowest number, which it would get either from a seperate file or maybe it could be stuffed in the script itself. (Just my somewhat uneducated thoughts)
TheNewGuy said:
I had an Idea for a script that would run at bootup, and if a certain variable had a "value" of NOT 1.
then the script would change the CHMOD of a userinit.sh located in the sd-ext from 050 or 777 to 750 then it would change the variable "value" to 0 were it would stay untill another script that runs at shut down or reboot setts the variable to 1 and changes CHMOD back to 050 or 777 so that the userinit.sh is not run.
That way if a change is made during operating the phone that causes the phone to crash with out shutting down properly the script runs which causes the userinit.sh to run and "resets" userinit.sh values to a "default". Otherwise if shut down properly nothing happens.
This could be expanded on to include repairing the EXT or clearing some special cache or other stuff I am unfamiliar with but that you might want to run after a crash.(like logcat?)
any way what do you think? any promise?
Click to expand...
Click to collapse
Keep it simple. If a change in userinit.sh breaks your system, reboot to recovery and edit it and reboot again.
TheNewGuy said:
I had an Idea for a script that would run at bootup, and if a certain variable had a "value" of NOT 1.
then the script would change the CHMOD of a userinit.sh located in the sd-ext from 050 or 777 to 750 then it would change the variable "value" to 0 were it would stay untill another script that runs at shut down or reboot setts the variable to 1 and changes CHMOD back to 050 or 777 so that the userinit.sh is not run.
That way if a change is made during operating the phone that causes the phone to crash with out shutting down properly the script runs which causes the userinit.sh to run and "resets" userinit.sh values to a "default". Otherwise if shut down properly nothing happens.
This could be expanded on to include repairing the EXT or clearing some special cache or other stuff I am unfamiliar with but that you might want to run after a crash.(like logcat?)
any way what do you think? any promise?
Click to expand...
Click to collapse
most rom devs/tweakers launch userinit.sh by calling it with a sh
e.g.
/system/bin/sh /system/sd/userinit.sh
so it will still run !! ( as init doesn't care about permissions, it is god )
don't believe me?
Code:
echo "echo I ran" > /data/test.sh
chmod 000 /data/test.sh
sh /data/test.sh
Keep it simple. If a change in userinit.sh breaks your system, reboot to recovery and edit it and reboot again.
Click to expand...
Click to collapse
Yea thats the easy way!...
(Seriously I'm not that good at Linux Command Line code,wording,but i'm getting there.)
I think, for overclocking purposes anyway, making the userinit.sh unrunnable would make the phone break immediately, as I think it would go to the highest available frequency. However, I like the idea, though I'm not sure how to run scripts on shutdown. I think for overclocking, it would check if the shutdown was clean on startup, and if not change the applicable line to the next lowest number, which it would get either from a seperate file or maybe it could be stuffed in the script itself. (Just my somewhat uneducated thoughts)
Reply With Quote
Click to expand...
Click to collapse
And I know that most roms now have a script called something like in /system/etc/init.d/20userinit that runs at startup and checks to see if a userinit.sh is present in sd-ext,if so it runs it.Also I noticed that the script can be there but if it is CHMOD to 777 it wont run. This is the "Reset script" Set to restet to something you like and run other tasks to help Fix/Diagnose probs.
The OC changes would be made from a different script such as 86supersettings
Or a userinit located in system/sd maybe ?
The thing is making sure one is read before the other.
Any way I probably will just learn the language better and do it from recovery console.
Thanks again
TheNewGuy said:
Yea thats the easy way!...
(Seriously I'm not that good at Linux Command Line code,wording,but i'm getting there.)
And I know that most roms now have a script called something like in /system/etc/init.d/20userinit that runs at startup and checks to see if a userinit.sh is present in sd-ext,if so it runs it.Also I noticed that the script can be there but if it is CHMOD to 777 it wont run. This is the "Reset script" Set to restet to something you like and run other tasks to help Fix/Diagnose probs.
The OC changes would be made from a different script such as 86supersettings
Or a userinit located in system/sd maybe ?
The thing is making sure one is read before the other.
Any way I probably will just learn the language better and do it from recovery console.
Thanks again
Click to expand...
Click to collapse
chmod 777 makes it rw and executable by everyone!!!!!!!!
have a look here
http://www.comptechdoc.org/os/linux/usersguide/linux_ugfilesp.html
but as I mentioned above, init ( the initial progam runs as root and doesn't care about permissions, ( it wouldn't be very good at doing initialising the system if it had to seek permission )
Yea your right. Well I said I wasn't that good at this linux stuff! Now I Proved it.
Any way as you can see this is more of a request..... I still think it's a good Idea.
Thanks for your help FireRat.
Keep it simple. If a change in userinit.sh breaks your system, reboot to recovery and edit it and reboot again.
Click to expand...
Click to collapse
I understand how I could manualy Replace the modified script with a default one that was on my sdcard from within recovery after a faild OC change...but..
Are you saying I could actualy modify the original script from recover? Do you have any info on how? A link?
TheNewGuy said:
I understand how I could manualy Replace the modified script with a default one that was on my sdcard from within recovery after a faild OC change...but..
Are you saying I could actualy modify the original script from recover? Do you have any info on how? A link?
Click to expand...
Click to collapse
If you have RA-Recovery, adb works, so you can pull/push the userinit.sh script. You can also enter the terminal and use vi to edit it from recovery. You may have to mount the ext partition first, but that's pretty easy. "mount /system/sd" will do it, if /system/sd doesn't exist, "mkdir /system/sd".
Ok, Thanks that makes sense. I'm still learning adb though. And I tried vi once before with no luck. But now I know what to learn about.
Thanks a lot I appreciate it.
TheNewGuy said:
Ok, Thanks that makes sense. I'm still learning adb though. And I tried vi once before with no luck. But now I know what to learn about.
Thanks a lot I appreciate it.
Click to expand...
Click to collapse
ok, this would do what you want
/system/bin/shutdown
bold is new
Code:
#!/system/bin/sh
stop;
stop dhcpcd;
sleep 1;
[B]echo "1" > /data/cleanshutdown[/B]
for i in `cat /proc/mounts | cut -f 2 -d " "`;
do
busybox mount -o remount,ro $i 2>&1 > /dev/null;
done
sync;
if [ "$1" = "-r" ];
then
toolbox reboot -f;
else
toolbox reboot -fp;
fi
your script
Code:
#!/system/bin/sh
if [ "`cat /data/cleanshutdown`" != "1" ];
then
echo "shutdown was not clean"
[B]your tweaks[/B]
else
echo "shutdown was clean"
[B]your tweaks[/B]
fi
echo "0" > /data/cleanshutdown
I'm not sure you need it,
this is for education value, if you want to play ^^^ is where to start
Thank You!
That is perfect
I need to add all of this to the startup script right?
if [ "`cat /data/cleanshutdown`" != "1" ];
then
echo "shutdown was not clean"
your tweaks
else
echo "shutdown was clean"
your tweaks
fi
echo "0" > /data/cleanshutdown
Click to expand...
Click to collapse
I am going to use the beta boot up script from ZKX called 86Supersettings, but I could use a userinit/user.conf like most do. Correct?
TheNewGuy said:
Thank You!
That is perfect
I need to add all of this to the startup script right?
I am going to use the beta boot up script from ZKX called 86Supersettings, but I could use a userinit/user.conf like most do. Correct?
Click to expand...
Click to collapse
well, a .conf file should be just that
a file with configurations , not an executable script
well, a .conf file should be just that
a file with configurations , not an executable script
Click to expand...
Click to collapse
OK. I guess I meant both together. I would use the user.conf to make tweaks. Then have to modify the userinit.sh with the part you made. Something like.
#!/system/bin/sh--LEAVE THIS OUT. ITS ALL READY AT THE BEGINNING
if [ "`cat /data/cleanshutdown`" != "1" ];
then
echo "shutdown was not clean"
Dont run user.conf
and set cpu or other stuff to "default"
else
echo "shutdown was clean"
Run user.conf for tweaked settings
fi
echo "0" > /data/cleanshutdown
Click to expand...
Click to collapse
If I'm way off then I guess I need to re-read the Userinit thread.
TheNewGuy said:
OK. I guess I meant both together. I would use the user.conf to make tweaks. Then have to modify the userinit.sh with the part you made. Something like.
If I'm way off then I guess I need to re-read the Userinit thread.
Click to expand...
Click to collapse
well, in practise it doesn't matter
the file extension is only for use humans, if I'm looking in a directory and I see .conf I expect it to be a configuration file, I see .sh, its a shell script, .py python, pl perl .......
I see. Well Thanks again for your help. Your script does work. I tried it. crash on purpose.
I still have a lot to learn.
Folks;
1) If you're OC'ing via SetCPU, remember that this doesn't change the recovery kernel, and you can uninstall SetCPU from Recovery. From there, all you need is a "safe" userinit.sh.
3) If you're OC'ing via userinit.sh -- same deal. Your phone crashes on you and you just edit it to a safe config from recovery.
Tweak away.
This is what I ended up with
Thanks to
XxKolohexX
FireRat
Licknuts
Code:
#!/system/bin/sh
#
echo 255 >/sys/class/leds/blue/brightness;
echo "+++ Now entering the speedy madness of Z.X.D.!"
echo "----- let's clear that Cache first."
echo "----- Too much DBs make System go sloow..."
echo "----- Also be shure to check out CacheMate"
echo "----- It's in the Market. (Made by Android AppCritic)."
echo "----- It's way more powerfull than this script!"
echo "----- (Times 10 or 100... Clears everything :P)"
echo "----- And this script already took hours to build..."
echo "----- domenukk - 2010."
find /data/data -name app_admob_cache | while read line; do du -s $line/* | cut -f1; rm -Rf $line/*; done;
find /data/data -name cache | while read line; do du -s $line/* | cut -f1; rm -Rf $line/*; done;
find /data/data -name google_analytics.db | while read line; do du -s $line | cut -f1; rm -Rf $line; done;
find /data/data -name webviewCache.db | while read line; do du -s $line | cut -f1; rm -Rf $line; done;
rm -rf /data/data/com.facebook.katana/files
rm -rf /data/data/com.google.android.apps.genie.geniewidget/app_news_image_cache
rm -rf /data/data/com.code.i.music/app_admob_cache
rm -rf /data/data/fm.last.android/databases/google_analytics.db
echo "--- All the Cache has been cleared."
sleep 10
echo 0 >/sys/class/leds/blue/brightness;
####determin if shutdown was clean####
if [ "`cat /data/cleanshutdown`" != "1" ];
then
####RUN CLEAN SHUTDOWN SCRIPT####
echo 255 >/sys/class/leds/green/brightness;
####Turbo Script by [email protected]####
####Prioritize everyting ####
echo "----- Enabling Turbo."
dirty_writeback_centisecs=500
/system/bin/prior &
#
# Linux-SWAP
#
if [ -e /dev/block/mmcblk0p3 ];
then
if [ -n /dev/block/mmcblk0p3 ];
then
echo "+++ Set Linux Swap"
busybox mkswap /dev/block/mmcblk0p3;
fi;
if [ -e /dev/block/mmcblk0p3 ];
then
echo "+++ Set Swapiness"
echo 100 > /proc/sys/vm/swappiness;
echo "+++ Activate Swap"
busybox swapon /dev/block/mmcblk0p3;
fi;
fi;
####Better CPU Settings...####
echo "----- Speed up the CPU"
echo 633600 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq;
echo 122800 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq;
echo 95 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold;
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/ignore_nice_load;
echo 100000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate;
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/powersave_bias;
echo 0 >/sys/class/leds/green/brightness;
echo 255 >/sys/class/leds/blue/brightness;
else
####RUN DIRTY SHUTDOWN SCRIPT####
echo 255 >/sys/class/leds/red/brightness;
####Turbo Script by [email protected]####
####Prioritize everyting ####
echo "----- Enabling Turbo."
dirty_writeback_centisecs=500
/system/bin/prior &
#
# Linux-SWAP
#
if [ -e /dev/block/mmcblk0p3 ];
then
if [ -n /dev/block/mmcblk0p3 ];
then
echo "+++ Set Linux Swap"
busybox mkswap /dev/block/mmcblk0p3;
fi;
if [ -e /dev/block/mmcblk0p3 ];
then
echo "+++ Set Swapiness"
echo 83 > /proc/sys/vm/swappiness;
echo "+++ Activate Swap"
busybox swapon /dev/block/mmcblk0p3;
fi;
fi;
####Better CPU Settings...####
echo "----- Speed up the CPU"
echo 576000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq;
echo 122800 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq;
echo 45 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold;
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/ignore_nice_load;
echo 2000000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate;
echo 200 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/powersave_bias;
fi;
echo "0" > /data/cleanshutdown
echo "+++ continue on lame stock SuperD boot "
##Clearing Davlik-Cache##
for dc in dalvik-cache;
do
umount /cache/$dc;
rm -fr /cache/$dc;
mkdir /cache/$dc;
chown 1000:1000 /cache/$dc;
chmod 771 /cache/$dc;
mount -o bind /data/$dc /cache/$dc;
done;
Named 86supersettings so it runs after userinit.sh if one exists.
I put some Led indicators in so you can tell if it ran right at boot up. (about all I did besides copy and paste) Thinking about adding some other stuff like repair ext, or some kind of log to help me see what happed... any suggestions.
OK, here's another Idea for another safety feature...
I would like to "hard code" a temp fail-safe in to the code. I would like to get rid of SetCPU and when OC-ing it's nice to have a temp failsafe.SHUTDOWN!LOL
Any way I guess I would just add a few lines to some existing script in my phone?.... Any suggestions.
Thanks for your time.

[FIX]Facebook contact icon fix for 3rd party apps

I make no claims to be any good at this but I was searching around for a fix to the contacts not displaying in 3rd party apps issue and came across a user named erishasnobattery on teambamf.net that had come up with a solution in addition to the zerg rush temp root script and incorporated the two for the HTC rezound. So I took a look at it and figured that it could be applied to my Sensation, didn't have a usb cable at work with me so I just did it manually but I've modified the batch file that he was using to push via adb from a PC and I've attached it.
I saw when I posted this that there is an app that does it but I also saw that some people don't like installing 3rd party apps for small little issues like this so I figured I'd put it up anyways, mods can determine whether it should stay up or not.
Like I said I'm no expert and I didn't use the batch file, I modified the permissions with root explorer and downloaded the files to the appropriate directories and ran the script, rebooted the phone and bam all contact pics in handcent so it works. I did notice when I went to move the sqlite3 file to /system/xbin it was already there so I just changed the permissions on the existing file instead of overwriting with the one included.
Contents of the batch file are as follows:
:cd %:h
@echo off
echo Waiting for Device....
adb wait-for-device > NUL 2>&1
echo Pushing Files...
adb push sqlite3 /system/xbin/sqlite3 > NUL 2>&1
adb shell chmod 777 /system/xbin/sqlite3 > NUL 2>&1
adb push fix_contacts.sh /system/etc/fix_contacts.sh > NUL 2>&1
adb shell chmod 777 /system/etc/fix_contacts.sh > NUL 2>&1
adb shell /system/etc/fix_contacts.sh > NUL 2>&1
echo Fix Complete, Hit Enter to reboot.
pause
adb reboot > NUL 2>&1
contents of the fix_contacts.sh file are as follows:
#!/system/bin/sh/system/xbin/sqlite3 /data/data/com.android.providers.contacts/databases/contacts2.db "UPDATE raw_contacts SET is_restricted=0 WHERE is_restricted!=0"
You can determine for yourself if you want to use it, obviously not responsible for any problems it may cause and as always do a backup first.
Thanks,
Court
cotawa said:
I make no claims to be any good at this but I was searching around for a fix to the contacts not displaying in 3rd party apps issue and came across a user named erishasnobattery on teambamf.net that had come up with a solution in addition to the zerg rush temp root script and incorporated the two for the HTC rezound. So I took a look at it and figured that it could be applied to my Sensation, didn't have a usb cable at work with me so I just did it manually but I've modified the batch file that he was using to push via adb from a PC and I've attached it.
I saw when I posted this that there is an app that does it but I also saw that some people don't like installing 3rd party apps for small little issues like this so I figured I'd put it up anyways, mods can determine whether it should stay up or not.
Like I said I'm no expert and I didn't use the batch file, I modified the permissions with root explorer and downloaded the files to the appropriate directories and ran the script, rebooted the phone and bam all contact pics in handcent so it works. I did notice when I went to move the sqlite3 file to /system/xbin it was already there so I just changed the permissions on the existing file instead of overwriting with the one included.
Contents of the batch file are as follows:
:cd %:h
@echo off
echo Waiting for Device....
adb wait-for-device > NUL 2>&1
echo Pushing Files...
adb push sqlite3 /system/xbin/sqlite3 > NUL 2>&1
adb shell chmod 777 /system/xbin/sqlite3 > NUL 2>&1
adb push fix_contacts.sh /system/etc/fix_contacts.sh > NUL 2>&1
adb shell chmod 777 /system/etc/fix_contacts.sh > NUL 2>&1
adb shell /system/etc/fix_contacts.sh > NUL 2>&1
echo Fix Complete, Hit Enter to reboot.
pause
adb reboot > NUL 2>&1
contents of the fix_contacts.sh file are as follows:
#!/system/bin/sh/system/xbin/sqlite3 /data/data/com.android.providers.contacts/databases/contacts2.db "UPDATE raw_contacts SET is_restricted=0 WHERE is_restricted!=0"
You can determine for yourself if you want to use it, obviously not responsible for any problems it may cause and as always do a backup first.
Thanks,
Court
Click to expand...
Click to collapse
Thanks for sharing the fix, it works.
This just changes one of the attributes for the raw_contact entity, which I suppose is quite safe if you don't install untrustworthy apps.
(Any application that has been granted permission to access your contacts during install will now have access to your facebook contacts & possibly other restricted contacts too.)
If you are already running a custom ROM, then I recommend you follow these instructions:
Download Terminal Emulator from Google Play
Open Terminal Emulator
Type
Code:
su
and hit enter
Type
Code:
cp /data/data/com.android.providers.contacts/databases/contacts2.db /sdcard/contacts2.db
and hit enter
Type
Code:
/data/data/com.android.providers.contacts/databases/contacts2.db "UPDATE raw_contacts SET is_restricted=0 WHERE is_restricted!=0"
and hit enter.
Type
Code:
exit
and hit enter.
Reboot the phone.
Done. That's all you need.
You may need to repeat this everytime a new contact is added.

[GUIDE] Add init.d scripts support for padfone/padfone 2

First of all, if you don't know what does init.d means then you probably won't need this and I'm not responsible if your padfone explodes when running this . Seriously this is almost completely sure but your device, your responsibility.
Credits:
I gathered information from this thread from DooMLoRD http://forum.xda-developers.com/showthread.php?t=1236446 as well as from others in this forum, but i believe he was the first.
Pre-requisites:
A rooted padfone, busybox and a command-line (adb, terminal, ...)
Explanation:
We are going to use the install-recovery.sh script that recreates the recovery partition (if it has been modified) while the device boots.
The way it works is simple:
- the boot process calls install-recovery.sh while executing init.rc
- the install-recovery.sh calls sysinit script
- the sysinit script runs /system/etc/init.d/* in order
Issues:
I found that the script is called in an early state where the date is still not set (is said Jan 28 1970!!!) and only a few fs are mounted:
/system, /data, /persist, /cache
so no sdcard, no Removable ...
Howto:
you can either copy the following text to a file in your device or download the attached file and in a terminal run:
$su
#cd to the directory where the script was stored
#sh ./enable_initd.sh
Code:
#!/system/bin/sh
echo ''
echo 'This script will enable init.d'
echo ''
echo 'You will need to reboot to check if it worked'
echo ''
echo 'If the script successfully enabled init.d you will'
echo 'have a file in /data/log called init.d-log.txt'
echo 'after the device is done rebooting.'
echo 'Once checked that it is working, you can delete'
echo '/system/etc/init.d/99test and /data/log/init.d-log.txt'
echo 'Remember to always set the proper permissions in your'
echo 'scripts or they will not work.'
echo ''
if [ ! -f /system/xbin/busybox -a ! -f /system/bin/busybox ]
then
echo 'no busybox found! please re-install/update your busybox'
else
# Mount system as rw in order to prepare the paths and scripts
mount -o remount,rw /system
# Create init.d dir
if [ -d '/system/etc/init.d' ]
then
chmod 755 /system/etc/init.d
else
mkdir /system/etc/init.d
chmod 755 /system/etc/init.d
fi
# Create sysinit script if needed
if [ -f /system/bin/sysinit ]
then
echo 'sysinit exists, init.d should be enabled'
chmod 755 /system/bin/sysinit
else
touch /system/bin/sysinit
echo '#!/system/bin/sh' >> /system/bin/sysinit
echo 'export PATH=/sbin:/system/sbin:/system/bin:/system/xbin' >> /system/bin/sysinit
echo '/system/bin/logwrapper busybox run-parts /system/etc/init.d' >> /system/bin/sysinit
chmod 755 /system/bin/sysinit
fi
# Create / modify install-recovery.sh
if [ -f /system/etc/install-recovery.sh ]
then
if cat /system/etc/install-recovery.sh | egrep -i "sysinit"
then
echo 'sysinit already present in install-recovery.sh, skipping this step.'
else
cp /system/etc/install-recovery.sh /system/etc/install-recovery.sh.old
echo '' >> /system/etc/install-recovery.sh
echo '#init.d scripts integration' >> /system/etc/install-recovery.sh
echo '/system/bin/sysinit' >> /system/etc/install-recovery.sh
fi
else
touch /system/etc/install-recovery.sh
echo '#!/system/bin/sh' > /system/etc/install-recovery.sh
echo '' >> /system/etc/install-recovery.sh
echo '/system/bin/sysinit' >> /system/etc/install-recovery.sh
chmod 755 /system/etc/install-recovery.sh
fi
# Create 99test script to check if init.d works
echo '#!/system/bin/sh' > /system/etc/init.d/99test
echo '' >> /system/etc/init.d/99test
echo 'date >> /data/log/init.d-log.txt' >> /system/etc/init.d/99test
echo 'echo init.d works >> /data/log/init.d-log.txt' >> /system/etc/init.d/99test
chmod 755 /system/etc/init.d/99test
# Sync and remount system
sync
mount -o remount,ro /system
#done!
echo 'job done :)'
echo 'reboot your phone and check on'
echo '/data/log/init.d-log.txt to see if it worked'
fi
Good luck!
please make new forum request for the padfone2 here
http://forum.xda-developers.com/showthread.php?t=1660354
we can't be sure that admins look here
Sendt fra min PadFone 2 med Tapatalk2
Thanks
Very Useful! Thanks for your guide.

[Q] Empty efs folder, no lockscreen, no power menu

Recently was running ParanoidKANGdroid and then updated to ParanoidKANGdroid 2.30 (4/5) but phone got stuck in samsung logo. (phone wouldnt boot up). I then had to use this method to restore my phone http://forum.xda-developers.com/showthread.php?t=1762204
It was the only way to get my phone to get bootup and have su.
I finally got it back to working but now it shows factory test mode has stopped working and keeps popping up on my verizon galaxy s3. I ve tried every possible solution. I am on rooted stock rom and i cannot install any other rom. I have my IMEI number but when I look in the /efs folder there are no files. I did not create a backup. Please help
Oh and I tried the following but it did not help it just says it cannot create folder.
Open a terminal emulator
Type su
Then enter the following after the #
echo -n ON > /efs/FactoryApp/factorymode
i found this
Open terminal emulator and type as ;
su
rm /efs/FactoryApp/keystr
rm /efs/FactoryApp/factorymode
echo -n ON >> /efs/FactoryApp/keystr
echo -n ON >> /efs/FactoryApp/factorymode
chown 1000.1000 /efs/FactoryApp/keystr
chown 1000.1000 /efs/FactoryApp/factorymode
chmod 0744 /efs/FactoryApp/keystr
chmod 0744 /efs/FactoryApp/factorymode
reboot
I tried that but right after I enter
rm /efs/FactoryApp/keystr
It gives me the following:
rm failed for /efs/FactoryApp/keystr, No such file or directory
Same problem with me
psychojv said:
I tried that but right after I enter
rm /efs/FactoryApp/keystr
It gives me the following:
rm failed for /efs/FactoryApp/keystr, No such file or directory
Click to expand...
Click to collapse
same problem is coming with me..
some one help..
i have same here, solutions?

[HOW-TO] Fix when the phone stuck in boot splash after apply V6 Supercharger

You may have applied V6 Supercharger to your phone. And after reboot, you stuck at the boot splash. Reboot once and V6 Supercharger install script tell you that you aren't supercharged. Here is how to fix it. (If you get looped in boot animation, this is NOT your fix. Sorry!)
Depend on your rom, you may have to do one of following:
Open the (rooted) File Manager, open the directory /etc/init.d/ and open file 99SuperCharger. OR
Turn on ADB on your phone, use your computer to pull the file /etc/init.d/99Supercharger by running
Code:
adb pull /etc/init.d/99SuperCharger
Edit the file at the almost bottom of the file, change the following code:
Code:
if [ "`ps | grep -m 1 [a]ndroid`" ]; then HellzYeah;
else HellzYeah &; fi;
To look like this:
Code:
if [ "`ps | grep -m 1 [a]ndroid`" ] || [ $1 = "bypass" ]; then HellzYeah;
else
rm $bootloopcookie
$0 bypass &
fi;
Depend on what you have done on step 1, do the following:
If you use (root) file manager, save the file. Grant the superuser permission if needed. Then browse to /data and delete file !!SuperChargerBootLoopMessage.log. Don't worry if it's not exist.
If you use your computer to edit your file, run the following command:
Code:
adb root
adb remount
abd push /path/of/99SuperCharger /etc/init.d/99SuperCharger
adb shell
And inside the adb shell, run:
Code:
chmod 755 /etc/init.d/99SuperCharger
rm /data/!!SuperChargerBootLoopMessage.log
exit
Don't worry if file /data/!!SuperChargerBootLoopMessage.log doesn't exist.
And that's it! The V6 Supercharger bootscript is worked as it's designed to. Thanks to zeppelinrox to make this great script.
For one who want to know some technical info (and my assumption of the cause), wait me until tomorow and i'll explain how i found it. read on:
In order to run script in /etc/init.d at boot, the line like this is inserted in init.rc:
Code:
on boot
...
# Start the init.d service
exec /system/bin/sysinit
(In case of cm - for example)
But, what does the /system/bin/sysinit do? Just this:
Code:
#!/system/bin/sh
export PATH=/sbin:/system/sbin:/system/bin:/system/xbin
/system/bin/logwrapper /system/xbin/run-parts /system/etc/init.d
And this is the real source of problem. For some reason run-parts with logwrapper doesn't move on when you run a shell script function in background. If you scroll up in file 99SuperCharger, you'll found that "HellzYeah" is actually a function. And when it's execute in a boot process, "HellzYeah" will wait for boot process to continue. But run-parts (and the whole boot process) is waiting for the script to finish. You see? A deadlock!
The workaround is to execute function in the other way. What my modification do is re-executing the script with the parameter "bypass" in the background. This way, run-parts will not wait for it anymore. Then, when the script is re-executed, it will detect that it's called with the parameter "bypass". It'll run the function "HellzYeah", wait for boot process to finish, and, when the boot process is finished, supercharge your phone!
(if anyone is reading this, please inform zeppelinrox about this problem. I'm not able to post on the development forum yet.)
(This is my first post in xda. Hopefully it's helpful)

Categories

Resources