[Q] /system/bin 100% full? - Atrix 4G General

Hi,
I unrooted and ran the 4.5.141 update. I'm now on Android OS 2.3.6. I am now trying to follow the directions to re-root from here: http://www.android-advice.com/2012/root-the-motorola-atrix-4g-running-4-5-141/
However, when I get to the step where I run the command:
Code:
cp /preinstall/su /system/bin/
I get the error "cp: write error: No space left on device" which I thought was very odd....so, I ran the command
Code:
df /system/bin
and the output I see is:
Code:
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/block/mmcblk0p12
326071 326068 3 100% /system
Is this possible? How do I get su back on to /system/bin?
How can it be that the /system partition is full? Is there a way to resize it, if that's the case?
Please help!!!

did you do step 6 before step 4
check this out THIS

Obviously, otherwise it won't work. My problem is that /system has no free space. How is that possible?

quordandis said:
Obviously, otherwise it won't work.
Click to expand...
Click to collapse
a simple 'yes', without 'tude, would have sufficed.

Ok, here's what I had to do to make this work. First, you have to check if you have Superuser.apk saved in /system/app. If you do, delete it (you'll reinstall this later).
Since I also wanted to install the latest version of Swype, first, rename /system/lib/libSwypeCore.so to /system/lib/libSwypeCore.so.bak
Then, cp /system/app/Swype.apk /sdcard/Swype.apk.bak
After you've copied the stock Swype to the sdcard, then rm /system/app/Swype.apk
This should provide you with enough room on /system to cp /preinstall/su /system/bin/su
The rest should follow accordingly.
-Q

Related

cp: write error: no space left on device in system

I have been having this error message come up using the terminal. I was attempting to add the volume enhancements via Lucid's script on the hybrid JF 1.51 with the HTC apps. I have asked Lucid if he knew how to solve this, but i wanted to see if anyone else might know the solution. I have been searching on here and also on google and yahoo but I have yet to find anything. I even took out my sd card to see if that would help after restarting my phone but nothing. Did i just screw myself?
innerlight said:
I have been having this error message come up using the terminal. I was attempting to add the volume enhancements via Lucid's script on the hybrid JF 1.51 with the HTC apps. I have asked Lucid if he knew how to solve this, but i wanted to see if anyone else might know the solution. I have been searching on here and also on google and yahoo but I have yet to find anything. I even took out my sd card to see if that would help after restarting my phone but nothing. Did i just screw myself?
Click to expand...
Click to collapse
i'm not privvy to lucid's script, but..
remount /system rewrite
do a cp -f to the files you are replacing
remount /system read-only
if you still get no space left, reboot your phone, then try again.
pershoot said:
i'm not privvy to lucid's script, but..
remount /system rewrite
do a cp -f to the files you are replacing
remount /system read-only
if you still get no space left, reboot your phone, then try again.
Click to expand...
Click to collapse
forgive my ignorance but do I type this in terminal as is? Because when I do that it cannot find remount.
I think I found the problem as to why I saw that error. I went from JFs-1.51 US built to the hybrid one that cyanogen did (the JF-1.51 + HTC apps) and I think there maybe something wrong inside there. First wiped and flashed JF's one and then wiped and flashed the cyanogen one and the problem is there.
innerlight said:
forgive my ignorance but do I type this in terminal as is? Because when I do that it cannot find remount.
Click to expand...
Click to collapse
copy the three files needed for the volume increase (2 if your on JF (AudioFilter and AudioPara4)) on to the sdcard in to lets say a directory named 'audio'. make sure you have unmounted the sdcard from within your OS after you have completed the copy, and have unplugged the USB cable.
open up terminal (on your phone)
$ su
# mount -o rw,remount /dev/block/mtdblock3 /system
# cd /sdcard/audio
# mkdir BK
# cp -p /system/etc/Audio* ./BK
# cp -f AudioFilter.csv /system/etc
# cp -f AudioPara4.csv /system/etc
# cp -f AudioPara_TMUS.csv /system/etc
# mount -o ro,remount /dev/block/mtdblock3 /system
# exit
$ exit
bounce your phone.
pershoot said:
copy the three files needed for the volume increase (2 if your on JF (AudioFilter and AudioPara4)) on to the sdcard in to lets say a directory named 'audio'. make sure you have unmounted the sdcard from within your OS after you have completed the copy, and have unplugged the USB cable.
open up terminal (on your phone)
$ su
# mount -o rw,remount /dev/block/mtdblock3 /system
# cd /sdcard/audio
# mkdir BK
# cp -p /system/etc/Audio* ./BK
# cp -f AudioFilter.csv /system/etc
# cp -f AudioPara4.csv /system/etc
# cp -f AudioPara_TMUS.csv /system/etc
# mount -o ro,remount /dev/block/mtdblock3 /system
# exit
$ exit
bounce your phone.
Click to expand...
Click to collapse
Thanks for the reply. I am still getting the same error with the JF-1.51+HTC apps build. I told Cyanogen about it and hopefully he will get it sorted out because his built is faster than the regular JF build. I guess I have to decide if the added HTC apps are worth more than the sound increase.

Why 'adb remount' failed on a Rooted neuxs one

Hi,
I have rooted my Nexus one. I can do "'adb shell and then 'su' under the shell"
But on my MacOS Desktop, when I execute 'adb remount', it still said
$ adb remount
remount failed: Operation not permitted
Click to expand...
Click to collapse
Can anyone please help me resolve this?
Thank you.
[size=+4]DO *NOT* POST QUESTIONS IN THIS FORUM - only tips/info/etc.[/size]
Right at the top. Why does this have to be repeated on a daily basis?
Can you please move my thread to the right forum? I can't find a way to do it.
Anyhow, to answer you question... you "adb remount" is disabled in production releases... just rooting does not allow this.
You need a modified boot image where ro.secure=0 in default.props, instead of ro.secure=1. The ro.secure flag in the boot image indicates whether the root filesystem can be remounted as read/write... 0 indicated it can be... 1 indicated it cannot be.
If ro.secure=0, this is referred to as insecure boot.
Most custom ROMs have this by default... some rooted stock ROMs do not have this...
Will the Modified GRI40 (2.3.3 Gingerbread) ROM from this
http:// forum.xda-developers.com/showthread.php?t=968396
Does what I need? Thanks.
Or you can also use these commands to mount and unmount the system partition as writable:
Code:
mount -o remount,rw /dev/block/mtdblock3 /system
mount -o remount,ro /dev/block/mtdblock3 /system
Thank you. That seems to be an easier solution for me.
But after I did
$ adb shell
$ su
# mount -o remount,rw /dev/block/mtdblock3 /system
Click to expand...
Click to collapse
I go to another shell and i did
adb push sqlite3 /system
failed to copy 'sqlite3' to '/system/sqlite3': Read-only file system
$ adb push sqlite3 /system/bin
failed to copy 'sqlite3' to '/system/bin/sqlite3': Permission denied
Click to expand...
Click to collapse
It still does not let me push 'sqlite3' to /system or /system/bin
That is what I need.
Thank you for any more pointers.
hap497 said:
Thank you. That seems to be an easier solution for me.
But after I did
I go to another shell and i did
It still does not let me push 'sqlite3' to /system or /system/bin
That is what I need.
Thank you for any more pointers.
Click to expand...
Click to collapse
Don't try to combine adb commands with shell commands.
Copy/move/push the file to your sdcard first.
Then open a root shell, mount it as rw, then copy the file from your sdcard to the directory you want.
Thanks. but I get 'failed on '/sdcard/sqlite3' - Cross-device link'
$ su
# mount -o remount,rw /dev/block/mtdblock3 /system
# mv /sdcard/sqlite3 /system/
failed on '/sdcard/sqlite3' - Cross-device link
# ls -l /sdcard/sqlite3
----rwxr-x system sdcard_rw 24120 2010-10-16 22:04 sqlite3
Click to expand...
Click to collapse
and i have tried:
# mv /mnt/sdcard/sqlite3 /system/bin/
failed on '/mnt/sdcard/sqlite3' - Cross-device link
# ls -l /mnt/sdcard/sqlite3
----rwxr-x system sdcard_rw 24120 2010-10-16 22:04 sqlite3
Click to expand...
Click to collapse
I get the 'sqlite3' from SuperOneClickv1.7-ShortFuse.zip.
Wholly crap, don't use the mv command! Bad idea!!! mv does not move the data, it moves the hardlink to the data! Thank your lucky stars mv wouldn't let you do it.
Use cp instead. cp will actually copy the data to where you're going.
Thank you. But I don't have 'cp' in my adb shell.
# cp
cp: not found
# /system/bin/cp
/system/bin/cp: not found
Click to expand...
Click to collapse
From here:
http://android-tricks.blogspot.com/2009/02/cp-on-android.html
I use 'cat' command to move to /system/bin
How do you have mv but not cp? Do you not have BusyBox installed?
No. I just need to search 'BusyBox' on Android market and install it? That is?
hap497 said:
Thank you. But I don't have 'cp' in my adb shell.
From here:
http://android-tricks.blogspot.com/2009/02/cp-on-android.html
I use 'cat' command to move to /system/bin
Click to expand...
Click to collapse
The cat command will work fine, no busybox needed: cat source_file > dest_file
efrant said:
The cat command will work fine, no busybox needed: cat source_file > dest_file
Click to expand...
Click to collapse
Woah there partner. Cat shouldn't be used on binary files, only ascii files. While it might work fine, it is not the recommended practice and really should not be done.
OP, Yes, BusyBox can be installed from the market.
GldRush98 said:
Woah there partner. Cat shouldn't be used on binary files, only ascii files. While it might work fine, it is not the recommended practice and really should not be done.
Click to expand...
Click to collapse
Really? I was unaware of that. It worked every time I used it.
efrant said:
Really? I was unaware of that. It worked every time I used it.
Click to expand...
Click to collapse
On standard Unix/Linux/etc. systems, cat works fine for binary files. It's only under DOS that cat or type shouldn't be used for binaries.
back in my ADB days.. itd say remount failed or w.e but i could still access my phone..
but i dont know.. ever since i switched to linux i stopped using ADB.. hahah

sl4a shell script help

Hi all,
I'm trying to run a shell script in sl4a but I'm running into problems. Here's what I want to do: change ADW configuration files in one click (since the app doesn't yet do it natively). There are two files that need to be changed for this to happen:
Code:
/data/data/org.adwfreak.launcher/databases/launcher.db
/data/data/org.adwfreak.launcher/shared_prefs/adw_ex_preferences.xml
I'm trying to delete those files and copy in new files from a stored location on the SD card but I can't get the sl4a script to run the following rm commands:
Code:
rm -rR /data/data/org.adwfreak.launcher/databases/launcher.db
rm -rR /data/data/org.adwfreak.launcher/shared_prefs/adw_ex_preferences.xml
I use
Code:
su -c
before the rm commands to run them as root, but the error then is that the /data partition is not mounted (which I find strange since it should be rw anyway...). I've tried using
Code:
mount -o remount,rw /dev/block/userdata /data
and it looks like it runs but then it doesn't work and I can't rm the files anyway.
Am I running into a limitation of sl4a or shell scripts in sl4a? I can rm the files from the terminal, so I'm not sure what the issue is. I'm very new to this (obviously) so any tips would be helpful. Thanks!
Here is my full script currently:
Code:
#!
kill android.process.acore
kill org.adwfreak.launcher
busybox rm -R /data/data/org.adwfreak.launcher/databases/*
busybox rm -R /data/data/org.adwfreak.launcher/files/*
busybox rm -R /data/data/org.adwfreak.launcher/shared_prefs/*
cp /sdcard/adw_ex_launcher.db /sdcard/ADW/Honeycomb/adw_ex_launcher.db
cp /sdcard/adw_ex_settings.xml /sdcard/ADW/Honeycomb/adw_ex_settings.xml
cp /sdcard/ADW/Portrait/adw_ex_launcher.db /sdcard/adw_ex_launcher.db
cp /sdcard/ADW/Portrait/adw_ex_launcher.db /data/data/org.adwfreak.launcher/databases/launcher.db
chmod 664 /data/data/org.adwfreak.launcher/databases/launcher.db
cp /sdcard/ADW/Portrait/adw_ex_settings.xml /sdcard/adw_ex_settings.xml
cp /sdcard/ADW/Portrait/adw_ex_settings.xml /data/data/org.adwfreak.launcher/shared_prefs/adw_ex_preferences.xml
chmod 664 /data/data/org.adwfreak.launcher/shared_prefs/adw_ex_preferences.xml
exit
When I test the rm commands in the sl4a shell, they don't remove the files even when the /data partition is mounted. I've tried all that I know. Help please!
Sent from my DROIDX
I don't know what you are trying in your second post, but from your first post I would say:
Code:
su
busybox rm -r /data/data/org.adwfreak.launcher/databases/*
busybox rm -r /data/data/org.adwfreak.launcher/files/*
busybox rm -r /data/data/org.adwfreak.launcher/shared_prefs/*
cp /sdcard/adw/prefs.xml /data/data/org.adwfreak.launcher/shared_prefs/
..
kill org.adwfreak.launcher
If you do "chmod 664" on the files, you also have to do "chown & chgrp" or the launcher won't be able to write into the settings xml's/db's.
And /data ist mounted rw, everything else would be senseless.
Thanks for the response.
I'm trying to change ADW configuration with one click. I'm going to use Tasker to create a widget that, when clicked, runs a script. That script will:
1. delete the current ADW configuration files (launcher.db and adw_ex_preferences.xml)
2. copy the target configuration files to the proper places (and set permissions, owner, group)
3. restart ADW so that the configuration is loaded
OR
3. open the ADW settings page so that I can click "restore desktop" and "restore preferences" and have the configuration loaded in an almost-one-click solution.
The script in the 2nd post is my best effort at that. I have tried the busybox part of the script, but I don't believe it makes a difference. I will try again, though, and report back.
As far as chown and chgrp goes, I'll add in what I think that should be and post that back later, too.
Fr4gg0r said:
I don't know what you are trying in your second post, but from your first post I would say:
Code:
su
busybox rm -r /data/data/org.adwfreak.launcher/databases/*
busybox rm -r /data/data/org.adwfreak.launcher/files/*
busybox rm -r /data/data/org.adwfreak.launcher/shared_prefs/*
cp /sdcard/adw/prefs.xml /data/data/org.adwfreak.launcher/shared_prefs/
..
kill org.adwfreak.launcher
If you do "chmod 664" on the files, you also have to do "chown & chgrp" or the launcher won't be able to write into the settings xml's/db's.
And /data ist mounted rw, everything else would be senseless.
Click to expand...
Click to collapse
Progress update: Success! More or less.
I realized I wouldn't need to remove the files since the ones I was copying in would just overwrite them anyway, so that cleared up that issue.
I did add chown and chgrp (a piece of information I'm sure I'll find useful in the future) so I'm sure that helped. Making sure to get the group and owner right PER YOUR OWN SETUP was key. When I changed ROMs I had to redo it... so check properties with Root Explorer or whatever.
I revised my script a little to add the background wall paper, too.
The true key, however, was using Lua in SL4A and using the 'sush' script in this post here:
http://code.google.com/p/android-scripting/issues/detail?id=184 (comment #9). That allowed me to run my script in the 'sush' format and do what I wanted.
I also had to add a line to kill the launcher process (android.process.acore) so it would restart itself.
I now have a one-click solution to changing between two ADW desktop configurations/settings!
I've attached my script if anyone would like it. Just get SL4A, the Lua interpreter, and put the pieces together! (Use a custom shortcut on the desktop and not a widget and the desktop setup will be preserved; widgets aren't supported in any method...)

Can not root and Update OTA again after unroot.

When I rooted ,I backup and delete some some flexT9 input file, then I find out I can not recive SMS after root .
So I unroot ,now I get OTA update but it's says error about I miss some flexT9 file.I can not restore file without root.
Now I can never root again ,and I can not even UPDATE OTA because system fille ar change.
What can I do NOW ?
Just make a full restore, root, ota rootkeeper, backup, temp unroot, OTA, re-root with OTA-Rootkeeper, install your apps.
I try restore, but sitll the same,I can't root...
Do you use OTA RootKeeper to unroot?
If so, you have a su-backup in /system which you an use to get the full root back.
Even when RootKeeper fails to restore, you an do in the shell.
JA.de said:
Do you use OTA RootKeeper to unroot?
If so, you have a su-backup in /system which you an use to get the full root back.
Even when RootKeeper fails to restore, you an do in the shell.
Click to expand...
Click to collapse
I do found the su-backup in /system.
How to get it back? How to do in the shell? I am new on Android. Thanks!
Download the zip which works before OTA2
Extract it to /sdcard/Download
Install Termial Emulator Form market ("Android Terminal Emulator", ConnectBot or so)
Start it and type: /system/su-backup
Prompt change to #
Type:
mount -o rw,remount /system
rm /system/xbin/su
rm /system/bin/su
dd if=/system/su-backup of=/system/xbin/su
ln -s /system/xbin/su /system/bin/su
chmod 6755 /system/xbin/su
rm /system/xbin/busybox
dd if=/sdcard/Download/busybox of=/system/xbin/busybox
chmod 755 /system/xbin/busybox
/system/xbin/busybox --install /system/xbin/
dd if=/sdcard/Download/Superuser.apk of=/system/app/Superuser.apk
chmod 644 /system/app/Superuser.apk
mount -o ro,remount /system
exit
exit
Terminate the Emulator.
I have some trouble with rerooting. I've just done the following:
Rooted the TPT
Installed RootKeeper
Backup up root
Temp unroot
Installed OTA2
Tried to reroot - no success
RootKeeper says "filesystem supports root protection" and "protected su copy available"​When clicking Restore root it says "root su restored", but the checklist still says its not rooted (titanium backup says the same)​
Installed superuser from market
Tried to reroot again - still no success
Installed Terminal Emulator
Wrote /system/su-backup - and received "Permission denied"
Wrote mount -o rw,remount /system - and received "mount: Operation not permitted"
Any suggestions on how to get root back?
@krister461:
Just do what I have written.
You must have /system/su-backup, I think.
JA.de said:
@krister461:
Just do what I have written.
You must have /system/su-backup, I think.
Click to expand...
Click to collapse
I did try, see step 9-11.
I do have /system/su-backup, but I get permission denied when trying to use it from the terminal window.
type:
cd /system
ls -l su-backup
Owner should be: root
Group should be: root
Permissions have to be: rwsr-sr-w
If so - all is good and you have made a mistake.
If Not - :-(
Following your instructions, my screen says:
-rwsr-sr-x root root
and then mentions the Rootkeeper backup and it's size.
Am I okay?
toenail_flicker said:
Following your instructions, my screen says:
-rwsr-sr-x root root
and then mentions the Rootkeeper backup and it's size.
Am I okay?
Click to expand...
Click to collapse
Mine says the same.
Sorry for the w at the last character of the Permissions.
My fault. You are right. The x is correct.
I made another mistake.
Type cd /system before /system/su-backup
/system is not in PATH.
Good luck.
So our permissions are correct? We are okay? I'm sorry, just new to root and adb. Thanks
Yes all is okay. Only you have to start with
cd /system
in the shell. That's all.
I still get permission denied :-S
Just checked: cd /system is not necessary.
/system/su-backup gives you root (and
the #-prompt).
@krister461:
Did you type "/system/su-backup"?
The shell is case sensitive.
Is filesize the same as the su in the
zipfile?
Maybe your terminal emulator did not work properly.
The two that I mentioned are okay.
I am using Android Terminal Emulator, and writing it correctly. If I misspell it it says "not found".
Thanks for your help so far though

[HOWTO] Add init.d to stock ROM + a few other goodies

I have been resisting the urge to flash a custom ROM for a bit, but I really miss having init.d support. So I read a few threads for other phones and rolled my own.
Warnings
I borrowed bits and pieces from various places. If you don't know what init.d is, you probably don't want to do this. If you aren't willing to take responsibility for bricking your tablet, don't do this. Seriously, the risk of bricking is very low, but if you aren't comfortable booting into an adb shell from recovery, maybe this is not for you. Strongly suggest a nandroid backup before you get started so if you totally bork things you can just hit rewind.
Note: The latest CWM may prompt you on a reboot that the ROM may overwrite the bootloader and offer to fix it for you. Don't do that. The init.d hack takes over the bootloader install script, but does not change your bootloader! If you accidentally do let it fix things for you, just rebuild the install-bootloader.sh file. The other steps should be fine.
Prerequisites
First, you need root, busybox, and some sort of terminal (either adb, or some terminal you like using on the tablet).
I have found that I like Busybox Installer (from the market; https://play.google.com/store/apps/details?id=com.jrummy.busybox.installer) but for some reason it doesn't create new symlinks unless you click advanced install.
Let's get to it!
In the shell (don't type # or anything after #):
Code:
su # get root
mount -o remount,rw /system # get access to /system (4.04 seems to mount ro as is usual; seems like the original mounted rw)
which run-parts # if you don't see /system/xbin/run-parts you need to install/reinstall busybox; if it is somewhere else, note it
mkdir /system/etc/init.d
Create a file called sysinit -- we are going to put it in /system/bin. You can edit it in place with vi, mount your tablet and edit it on your computer, or create it on the computer and push it via adb. Whatever.
Here's the file (you do need the # and the things after it in the file!):
Code:
#!/system/bin/sh
export PATH=/sbin:/system/sbin:/system/bin:/system/xbin
/system/bin/logwrapper /system/xbin/run-parts /system/etc/init.d
Note that if your run-parts is not in /system/xbin (from the which command) then fix the above to reflect your reality.
In the shell, make it executable
Code:
chmod 755 /system/bin/sysinit
Now go in the init.d directory and create some things you want to run at start up. For example:
Code:
cd /system/etc/init.d
echo '#!/system/bin/sh' >99test # note: you do need the first # in this line but not the 2nd!
echo 'date >>/data/tmp/init.d-log.txt' >>99test
chmod 755 99test
Here's a more practical one (yes, you need the # signs). Name it something like 10diskperf -- don't forget to chmod it.
Code:
#!/system/bin/sh
# Set disk read aheads to 1024
chmod 777 /sys/block/mmcblk0/queue/read_ahead_kb
echo "1024" > /sys/block/mmcblk0/queue/read_ahead_kb
chmod 777 /sys/block/mmcblk1/queue/read_ahead_kb
echo "1024" > /sys/block/mmcblk1/queue/read_ahead_kb
chmod 777 /sys/devices/virtual/bdi/179:0/read_ahead_kb
echo "1024" > /sys/devices/virtual/bdi/179:0/read_ahead_kb
Or here is one to tweak some TCP parameters (25sysctl):
Code:
#!/system/bin/sh
sysctl -w net.core.rmem_max=524288
sysctl -w net.core.wmem_max=524288
sysctl -w net.ipv4.tcp_rmem=6144 87380 524288
sysctl -w net.ipv4.tcp_wmem=6144 87380 524288
Whatever files you put in, you need to remember to make them executable (chmod 755).
Finally, you need to kick it all off at start up. The hack for that is we are going to create /system/etc/install-recovery.sh which apparently runs on each boot.
Code:
cd /system/etc
echo '#!/system/bin/sh' >install-recovery.sh
echo '/system/bin/sysinit' >>install-recovery.sh
chmod 755 install-recovery.sh
Tips and troubleshooting
If you are too lazy to cut and paste I have the files here (View attachment init.d-support.zip) that you can just move to the right places and change permission. If you are really lazy there is lightly tested install script below.
I like to try running the whole thing before a reboot to see if I get any errors:
Code:
/system/etc/install-recovery.sh
I'd suggest putting the 99test file in first. Verify that you get the expected file in /data/tmp and then reboot and check again. Then you can remove 99test.
Same goes for adding new scripts. Try running them from the shell to see if they throw errors before you reboot!
If you have trouble, see if this looks right:
Code:
ls -ld /system/etc/install-recovery.sh /system/bin/sysinit /system/etc/init.d /system/xbin/run-parts
-rwxr-xr-x root root 39 2012-07-14 10:00 install-recovery.sh
-rwxr-xr-x root root 140 2012-07-14 10:01 sysinit
drwxrwxrwx root root 2012-07-14 10:10 init.d
lrwxrwxrwx root root 2012-07-14 09:55 run-parts -> /system/xbin/busybox
For the brave
The install-init.d zip file (View attachment install-init.d.zip) contains a lightly tested script that SHOULD do the install steps for you.
Send the file to your android to someplace that can execute code (e.g., /system/xbin; I had to use adb to put it on the sdcard and then move it to /systemxbin in the shell since I don't have the adb root kernel installed).
Code:
cd /system/xbin # or wherever you have it
chmod 755 install-init.d
./install-init.d
It performs rude checks to see if init.d exists, and tries to handle moving or missing busybox. It only installs 99test as a script.
Let me know if this works or doesn't work for you.
For the extra brave: There is no reason this should only work on the Samsung. This ought to work on pretty much most stock ROMs as long as they execute install-recovery.sh on start up.
Scripts
What do you put in your init.d? If you post anything cool I'll put it up here in the op.
One that gave me some real gains in I/O performance required a new version of the tune2fs executable. By default, it is part of busybox but the busybox one only has a few simple options. I've included a stand alone version and the script 10disktune here View attachment disktune.zip. Unpack the zip and put the 10disktune in /system/etc/init.d (don't forget to chmod) and put tune2fs in /system/bin (chmod that too). Note that busybox has one in /system/xbin but the script specifically calls out the one in /system/bin.
Here's one that will zipalign your apks on each boot
Code:
#!/system/bin/sh
for apk in /data/app/*.apk ; do
zipalign -c 4 $apk
ZCHECK=$?
if [ $ZCHECK -eq 1 ]; then
zipalign -f 4 $apk /cache/$(basename $apk)
if [ -e /cache/$(basename $apk) ]; then
cp -p -f /cache/$(basename $apk) $apk
rm /cache/$(basename $apk)
fi;
fi;
done;
Fin
Corrections welcome. I considered using exec or . to load some of this into one shell but given that it runs once at startup, I figured it is fine as is.
All files for reference
View attachment init.d-support.zip
View attachment install-init.d.zip
View attachment disktune.zip
Great guide, gonna try it tonight.
Sent from a GNote, hell yeah!
SirRhor said:
Great guide, gonna try it tonight.
Sent from a GNote, hell yeah!
Click to expand...
Click to collapse
I'm curious how it went. If you ran into any issues, let me know so I can update the op. Thanks!
Hmm did anyone get this to work?
wd5gnr said:
Hmm did anyone get this to work?
Click to expand...
Click to collapse
I did it on my Galaxy Nexus.
It works great, I had a bit of problem with the sysinit file, but when I downloaded your zip file and used your sysinit, it worked, so it must be a problem from my side
Thanks for this, I can finally use "Odex Me"
aavan said:
I did it on my Galaxy Nexus.
It works great, I had a bit of problem with the sysinit file, but when I downloaded your zip file and used your sysinit, it worked, so it must be a problem from my side
Thanks for this, I can finally use "Odex Me"
Click to expand...
Click to collapse
Great, just wanted to be sure I hadn't made any typos/errors in the guide.
A lot of init.d files collected here: http://forum.xda-developers.com/showthread.php?t=1227269
Also build.prop things, etc.
Thanks, I use your guide and worksperfect for my RK3066 devices. Very simple to understand all steps and what we are doing to our system, perfect for me. Thanks again dude
Melch1zedeK said:
Thanks, I use your guide and worksperfect for my RK3066 devices. Very simple to understand all steps and what we are doing to our system, perfect for me. Thanks again dude
Click to expand...
Click to collapse
Glad to help!
What is thhe utility of this?
moliverac8 said:
What is thhe utility of this?
Click to expand...
Click to collapse
Init.d is how Linux and many Android (which is kind of Linux, after all) systems manage executing commands on boot up.
The /etc/init.d files run in numerical order as root and you can do things like change system settings, manipulate the file system, etc.
See the init.d section linked below for some ideas.
http://forum.xda-developers.com/showthread.php?t=1227269
Question? what is the difference in this method and running a script?
wd5gnr said:
Init.d is how Linux and many Android (which is kind of Linux, after all) systems manage executing commands on boot up.
The /etc/init.d files run in numerical order as root and you can do things like change system settings, manipulate the file system, etc.
See the init.d section linked below for some ideas.
http://forum.xda-developers.com/showthread.php?t=1227269
Click to expand...
Click to collapse
I use the "swap memory script" and was wondering if it would also work this way with the init.d If so would there be any benefit this way over the current way of running it one way or the other? One drawback I see running the script as is is that I have to wait once the system has fully booted until the script has run and I see the Smanager screen to let me know that my memory has been remounted.
Thanks for the info and the learning process.
Here is the script and the link.
http://forum.xda-developers.com/showthread.php?t=1961097
Code:
sleep 5
mount -o remount,rw /
mount -t vfat -o umask=0000 /dev/block/vold/179:25 /mnt/sdcard
sleep 5
mount -o bind /data/media /mnt/extSdCard
As long as the device is ready to mount at boot time and doesn't get remounted, ought to work. Backup and try it
External memory wasn't ready
wd5gnr said:
As long as the device is ready to mount at boot time and doesn't get remounted, ought to work. Backup and try it
Click to expand...
Click to collapse
Thanks for the guide, but I think that the external memory was not ready to be mounted at that time. it didn't see the card till after boot. It was worth a shot, Reverted back to the script in /data and all worked again,
Note: I didn't find /system/xbin/run-parts however, I did find /system/bin/run-parts and changed the path to reflect that, I don't think this was an issue but I'm not 100% sure.

Categories

Resources