My update for AIO Automatic Installation Script - Sony Ericsson XPERIA X10 Mini

Hello, Im useing this script http://forum.xda-developers.com/showthread.php?t=951274 to install JIT, DualTouch, etc.
I have some update for .sh script.
In JIT installation part:
Code:
echo "Backing up build.prob file"
busybox cp -f /system/build.prop /system/build.prop.stock
echo "Copying build.prop to /system/"
busybox cp -f data/jit/build.prop /system/build.prop
Here script rename system build.prop file to build.prop.stock and copy new build.prop from script folder to system.
And in JIT deinstallation part:
Code:
echo "Copying libraries and build.prop to /system/"
...
busybox cp -f data/jit/disable/build.prop /system/build.prop
And here script copy new build.prop from script folder to system.
BUT!
In deinstallation we need to get back our stock build.prop what was renamed in installation part!
So, i suggest to change
Code:
busybox cp -f data/jit/disable/build.prop /system/build.prop
to
Code:
busybox mv -f system/build.prop.stock system/build.prop
to rename build.prop.stock to build.prop.
And why did we copy/past this build.prop files? Why we cant copy stock build.prop and edit it this way:
Code:
echo "#DEVICE_PROVISIONED=1" >> /system/build.prop
echo "dalvik.vm.heapsize=30m" >> /system/build.prop
echo "#kernel.log=default" >> /system/build.prop
echo "dalvik.vm.execution-mode=int:jit" >> /system/build.prop
What do you think?
And sorry, I cant post this to Development forum because I have < 10 posts.

Iam searching in Google for help and so i find your Post here.
Maybe u can help me a bit.
I have a GalaxyNexus.
I have a Build.prop with and one without Tablet Mode.
I like to use sometimes TabletMode and sometimes not.
I think with a Script like u use here i can change what build.prop to use.
Lets say i have the "build.prop" with TabletMode and a "build.prop.stock" without that Mode.
How can i make it possible to activate the .stock and dissable the TabletMode. And then again the other way arround. ???

Related

[Q] Revolution HD add init.d script

Hi all,
I have a problem with the rom in the subject, the headphone amplifier level is too high for me and I want to set a lower value to it.
I created this script:
Code:
#!/system/bin/sh
echo 1 > /sys/devices/virtual/misc/scoobydoo_sound/headphone_eq
echo 40 > /sys/devices/virtual/misc/scoobydoo_sound/headphone_amplifier_level
I have saved it in the /system/etc/init.d/ folder, I have set user and group (root:shell) and permissions (755) like the other scripts in that folder but the script simply isn't started at boot time!
at the end of the file /system/etc/init.post_boot.sh there are these lines:
Code:
# Execute /system/etc/init.d scripts on boot
chgrp -R 2000 /system/etc/init.d
chmod -R 777 /system/etc/init.d
/system/xbin/busybox run-parts /system/etc/init.d
log -p i -t ARHD "init.d support activated"
;;
what I need to do to allow the system to start my script?
thank you!
k4po said:
Hi all,
I have a problem with the rom in the subject, the headphone amplifier level is too high for me and I want to set a lower value to it.
I created this script:
Code:
#!/system/bin/sh
echo 1 > /sys/devices/virtual/misc/scoobydoo_sound/headphone_eq
echo 40 > /sys/devices/virtual/misc/scoobydoo_sound/headphone_amplifier_level
I have saved it in the /system/etc/init.d/ folder, I have set user and group (root:shell) and permissions (755) like the other scripts in that folder but the script simply isn't started at boot time!
at the end of the file /system/etc/init.post_boot.sh there are these lines:
Code:
# Execute /system/etc/init.d scripts on boot
chgrp -R 2000 /system/etc/init.d
chmod -R 777 /system/etc/init.d
/system/xbin/busybox run-parts /system/etc/init.d
log -p i -t ARHD "init.d support activated"
;;
what I need to do to allow the system to start my script?
thank you!
Click to expand...
Click to collapse
actually it seems that no one file inside that directory is started on boot! also the file that already were into the directory!
Ok a developer told me that init.d support will be available from next release!
I'll try something different
Sent from my GT-I9300 using xda app-developers app

[HOW TO]Adding init.d support

This is a quick how to on how to add init.d support to your device. I am posting this as i have had alot of intrest on the subject.
This method has been tested on the n7000 with a rooted rom and philz kernel if you test on other devices and it works(or does not work) please let me know and i will build a compatibility list
you are doing this at your own risk so do not complain when you mess it up.
use this method to test the init.d support if successful then just add your init.d scripts to the init.d folder.
1. Download the file from here: 00test.zip
2. Extract the file, you will get a file named 00test. DO NOT flash!
3. Paste it into /etc/init.d. If there is no init.d folder, most probably you DO NOT have init.d support. However, if you still wanna try, just create the folder named "init.d"
4. Change the permissions of the init.d folder and 00test into rwxrwxrwx.
5. Reboot.
6. If you see a file named Test.log in /data, you have init.d support. If not, you will have to run Uni-init, Term-init or Zip-init.
at step 3 you should have init.d support if you have a rooted rom and a kernel which has init.d support.
if i have helped you please hit thanks button. :good:​
Uhhh, this doesn't tell you at all how to add init.d support. It just tells you how to test and see if you already have init.d support. Thread title is misleading.
1. add this line
exec /system/bin/sysinit
in init.rc (in ramdisk) ,then compile boot.img
2.flash the boot.img
3.extract sysinit (from the attached file) and copy in /system/bin/ with permission rwxr-xr-x (755)
4.reboot
or you can cook it with dsixda kitchen ... ,
just use this apk called uni init.d it work well on my device ...
here is the link http://forum.xda-developers.com/showthread.php?t=1933849
Or, if you really want to learn a little, you can get the VTS (Virtual Ten Studio) from XDA Developers (free), Do a boot project, and add the following in init.rc
Code:
run-parts /etc/init.d
service sysinit /system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
disabled
oneshot
Then re-compile your boot image and flash or fastboot it.
MD
There is not init.rc in my boot.img ! What can I do now?
PHP:
# Adds kernel's Init.d
INITD() {
if [[ -e "/PATH/TO/init.rc" ]]; then
sed -i -e '0,/class_start /s//start sysinit\n\n class_start /' "/PATH/TO/init.rc"
sed -i -e 's/service media /service sysinit \/system\/bin\/logwrapper \/system\/xbin\/busybox run-parts \/system\/etc\/init.d\n disabled\n oneshot\n\nservice media /' "/PATH/TO/init.rc"
cd "$(dirname "$0")"
cd ..
# Call other methods
MOUNT
INSTALL_RECOVERY
SYSINT
PERMISSIONS
else
ui_print "ERROR, missing needed contents from the ramdisk?!";
rm -rf "$ACTIVE_PROJECT/TEMP"
return 1
fi
}
# Mount system as R/W
MOUNT() {
busybox mount -o remount,rw -t auto /system
}
# Build and write to install-recovery.sh
INSTALL_RECOVERY() {
if [ -e /system/etc/install-recovery.sh ]
then
busybox echo "# init.d support" >> /system/etc/install-recovery.sh
busybox echo "busybox run-parts /system/etc/init.d/" >> /system/etc/install-recovery.sh
busybox echo "" >> /system/etc/install-recovery.sh
busybox awk '!x[$0]++' /system/etc/install-recovery.sh > /tmp/install-recovery.sh
busybox cat /tmp/install-recovery.sh > /system/etc/install-recovery.sh
busybox echo "" >> /system/etc/install-recovery.sh
else
cat > /system/etc/install-recovery.sh
busybox echo "#!/system/bin/sh" >> /system/etc/install-recovery.sh
busybox echo "# init.d support" >> /system/etc/install-recovery.sh
busybox echo "busybox run-parts /system/etc/init.d/" >> /system/etc/install-recovery.sh
busybox echo "" >> /system/etc/install-recovery.sh
fi
}
# Build and write to systint
SYSINT() {
if [ -e /system/bin/sysint ]
then
busybox echo "#!/system/bin/sh" >> /system/bin/sysint
busybox echo "# init.d support" >> /system/bin/sysint
busybox echo "" >> /system/bin/sysint
busybox echo "export PATH=/sbin:/system/sbin:/system/bin:/system/xbin" >> /system/bin/sysint
busybox echo "/system/bin/logwrapper run-parts /system/etc/init.d" >> /system/bin/sysint
busybox echo "" >> /system/bin/sysint
busybox awk '!x[$0]++' /system/bin/sysint > /tmp/sysint
busybox cat /tmp/sysint > /system/bin/sysint
busybox echo "" >> /system/bin/sysint
else
busybox echo "#!/system/bin/sh" > /system/bin/sysint
busybox echo "# init.d support" >> /system/bin/sysint
busybox echo "" >> /system/bin/sysint
busybox echo "export PATH=/sbin:/system/sbin:/system/bin:/system/xbin" >> /system/bin/sysint
busybox echo "/system/bin/logwrapper run-parts /system/etc/init.d" >> /system/bin/sysint
busybox echo "" >> /system/bin/sysint
fi
}
# Set permissions accordingly
PERMISSIONS() {
busybox chmod 755 /system/etc/install-recovery.sh
busybox chown 0.0 /system/etc/install-recovery.sh
busybox chmod 755 /system/bin/sysint
busybox chown 0.2000 /system/bin/sysint
}
# Start process here
INITD
Here is a small snippet from my script that I use with MyMinds_Kernel_Swap for flashing in my recovery to pull my boot.img using dd, unpack using my unmkbootimg binary, edit init.rc and amongst other things in /system, swap kernel, build ramdisk with mkbootfs, build boot.img with mkbootimg, and flash using dd. Pretty much like AnyKernel, but I wrote my own because AnyKernel just didn't work.
Anyways, here you go. Remember, some adjustments are needed more in less but should give you an idea for init.rc support. If you wish to see my entire script then just look up my github and find my repo as named above.

[Q] Can someone please help me run this script?

Hi everyone
I am trying to run a script on my android that extracts asec files back to apk's on my phone. The scripts works fine when i put in every line manually into terminal though obviously that is a pain in the ass. So i put it into a .sh file and put the .sh file in system root for ease of execution..
i then do:
su
sh deasec.sh
though it returns:
unexpected syntax error: do
can someone tell me what i am doing wrong? - thank you kindly! (will press thanks!)
Code is below
Code:
#!/system/xbin/sh
LD_LIBRARY_PATH="/system/lib"
PATH="/system/xbin:/system/sbin:/system/bin"
for ASEC in $(find /data/app-asec/ -name '*.asec')
do
echo "Deasec $ASEC"
PKG=$(basename $ASEC|cut -d'-' -f1)
echo "Package name $PKG"
if [ -d /mnt/asec/$PKG*/lib ]
then
echo "Relocate libs"
find /data/data/$PKG/ -type l -name lib -exec rm {} \;
cp -r /mnt/asec/$PKG*/lib /data/data/$PKG/
echo "Fix libs permissions"
chown -R system:system /data/data/$PKG/lib
chmod -R 755 /data/data/$PKG/lib
fi
APK=$(pm path $PKG|cut -d':' -f2)
echo "APK location $APK"
cp $APK /data/local/tmp/pkg.apk
chmod 644 /data/local/tmp/pkg.apk
pm install -r -f /data/local/tmp/pkg.apk && rm /data/local/tmp/pkg.apk
done
Have you done the script under Windows, you don't? You need to write the script under Linux. You can also write the script directly in your phone:
Open Terminal Emulator, and write the lines one by one this way:
Code:
echo line1 >> /sdcard/script.sh
echo line2 >> /sdcard/script.sh
echo line3 >> /sdcard/script.sh
...
Then move the script to its final location, and give it permissions (if needed).
nice one mate Thankyou

Pulling my hair out regarding shell scripts

Last night, I had a pair of working scripts that
a) Added a string to the build.prop
b) Removed that very string from the build.prop
Here they are:
Code:
#!/sbin/sh
chmod 777 /system/build.prop
echo "debug.sf.nobootanimation=1" >> /system/build.prop
Code:
#!/sbin/sh
busybox mount -o remount,rw /system
busybox sed -i '/debug.sf.nobootanimation=1/d' /system/build.prop
As you can see, it enables and disables the boot animation.
Now, these very same scripts causes a bootloop and corrupts the build.prop
I cannot figure out why... or why it should even do that in the first place. One minute it works, the next it's breaking things in a way that makes zero sense.
Does chmod work on a readonly filesystem? You might try to mount it readwrite in the first script just like you did in the second.
By the way what does "corrupts the build.prop" mean exactly?
You could also try booting the phone and start "adb logcat" so you can see the debug messages on your PC.

[Q] edit init.rc to run shell scripts on boot (help urgent!l

I've added the following lines into init.rc
"service sysinit /system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d"
My script is created inside the init.d directory.
#!/system/bin/sh
echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb
Actually, the above action is worked. But when I have added one more script below the echo "2048... script, the problem was come.
( echo "1337" > /system/etc/init.d/gg.txt) p.s. gg.txt is not existed at the beginning
So, finally read_ahead_kb file has changed, but the gg.txt hasn't been created.
Can any one provide the reason and the solution to me?? Emergent! Thanks a lot!!
Or is it necessary for me to add ";" symbol at the end of each script?
If I want to use an infinity loop's script on boot (while : do xxxx done )
is it possible to do so? And how? Thanks
Any body can help?
No one??
hades94720 said:
No one??
Click to expand...
Click to collapse
use double >>
echo 11111 >> abc.txt
echo 2222 >> abc.txt

Categories

Resources