Hy guys. I have a question here. Is there any similar rc.local file on Android? FYI, rc.local is a small script in UNIX system which allow you to start a service when system is starting up.
Perhaps can I create a new file under /system/etc/init.d directory? If I can, I'm worrying about it's file permission.
Related
I need to copy a single file using an update-script (update.zip's script)
I know that command to copy a dir is
Code:
copy_dir
But if i want to copy only a single file how can i do?
Exit93 said:
I need to copy a single file using an update-script (update.zip's script)
I know that command to copy a dir is
Code:
copy_dir
But if i want to copy only a single file how can i do?
Click to expand...
Click to collapse
put only a single file in the dir? not sure i get your problem, the script should copy everything from the update.zip to the flash memory, why would there be a need to copy a single file?
Kendon is right. Just
Code:
show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
show_progress 0.1 10
is needed to copy a single file into the system directory. That script is from one to install WaveSecure to ROM. All it does is copy the contents of the system folder (which is a folder called app, to that location on the system partition of the phone. As there is only one file in the folder app, that file is added or overwritten. Nothing else is changed.
No, i need to copy only one file form SYSTEM to DATA
Then format SYSTEM and recopy that file from DATA to SYSTEM
How can i do?
Exit93 said:
No, i need to copy only one file form SYSTEM to DATA
Then format SYSTEM and recopy that file from DATA to SYSTEM
How can i do?
Click to expand...
Click to collapse
i don't think this is possible with update-script, as it wasn't made for this purpose. care to elaborate what your main goal is, maybe we can find other ways?
kendong2 said:
i don't think this is possible with update-script, as it wasn't made for this purpose. care to elaborate what your main goal is, maybe we can find other ways?
Click to expand...
Click to collapse
I have to format system partition but i have to preserve /system/init.rc file
Deleting all system's subdirs doesn't work
Hi..
I've had problems with Gmail and Maps applications previously with Neophyte ROMs. In that case one of the solutions was removing the apks for these apps from with the /system/app folder of the ROM zip.
My question is:
Is it possible to add our own apks to the custom ROM so that these apks come preinstalled on the ROM when someone flashes it..in a manner, a kind of 2nd generation mod?
Is it possible to add our own system variables and settings files so that the ROM autoinstalls it on First Install? In particular, I'd like to preset my own APN file for the network.
The simple answer is yes.
The entire system folder in the zip file is written to your /system partition, with the full architecture of folders and so on, so any changes made in there will also be on the system, when it is flashed.
There is also a script file, in the META-INF folder, which you can use to run commands to delete or edit something along with the flash, whenever the zip file is flashed. This is a bit more advanced though.
edit: it is the same for the data folder of course, which folders is flashed and where to is also specified in the script file mentioned above.
Thank you!
In that case, for installation of a program like Gmail.apk or Maps.apk, would be as simple as adding the .apk to the /system/app, or would I have to include other files? Would there be dependancies in other folders?
Well the apps have their own data folder on the data partition, but this is for storing changes in settings and so on, and it should be created by the app itself on first boot just like right after you wipe the data partition/factory reset
Thanks..Got some mod modding to do!
So in case I'd want to manually uninstall/manually install an apk, what would be the steps I'd have to go through?
Would there be filesystem config files (like the older Windows versions), or a central database of entries of the likes of the Registry tables of newer Windows? How does Android go about installing a file? Like which folders and files would be modified other than /system/app and /data/app? Any common files with entries? And in case of the latter, whether it would be machine readable or plain text?
Hello,
After reading theads about this universal problem.
I'm still looking for a solution to edit hosts file.
I don't want to pay for root explorer app (sorry).
I've tried AdFree but it adds only "127.0.0.1 localhost"
is there a way to edit this f*** file. I've a hosts file to use but no possibilies to use it...
If someone can help me, (s)he will be very kind....
re Hello,
I've seen a thead a patch to make a link to a file on the sdcard (I don't know where on the forum exactly)
Is there someone to help me ?
I recently have been looking into changing my own hosts file. I use Astro with the root option enabled to copy the hosts file in /system/etc/ to my SD card. With Astro you can change file extensions. Rename your SD copy to hosts.txt and you can edit it with ThinkFree. As for copying that back over, I'm not sure if it's as direct. I would suggest using an Android terminal to do the edits because you can edit without having to use ADB (I found all this out through other threads). Make sure you're root(ed) as well (su command). Also you might have to reboot after copying over your new file. My PC has trouble with my hosts file.
Basically what I've seen is that there's a line in the file that the device can't "understand" (or find) perhaps. My PC file has a couple groups of sites that I copied from a website (after checking for loopback). All in all there was a box or something somewhere because the encoding wasn't the right one. (If you add the .txt extension on the device ThinkFree will ask you what encoding. I use the suggested but that's probably my issue on my PC.) My PC kept making a new, blank copy of my hosts and turning my custom one into an iCal file (?).
Hope this helps a little, even though you're only adding one line...
Sent from my SPH-M910 using Tapatalk
Hello
Thanks for the info.
I've manage to do a link to a hosts file located in the sdcard using adb when I'm in recovery mode.
Now When I use AdFree, the app can update without problem the file
Lol you could do adb shell
cd /etc/
cat hosts
and see what it outputs. If it's wrong just do echo urlhere 127.0.0.1 >> hosts
Indirect said:
Lol you could do adb shell
cd /etc/
cat hosts
and see what it outputs. If it's wrong just do echo urlhere 127.0.0.1 >> hosts
Click to expand...
Click to collapse
It's Ok,
when I do this, it outputs all the adress associated with 127.0.0.1
It displays the content of /sdcard/etc/hosts file.
Easy Host File
I have been able to change my hosts file with no paid apps,adb, or recovery. This will work with Astro or ES File Explorer.
Find and download the hosts file you wish to use; I use mvps. If you want to edit it or add entries do so now. To save it with no file extension on Windows under tools-->folder options enable "show file extensions for known types". Control click and select "rename"; rename "hosts.txt" as "hosts". Window will warn you about changing the extension but clear the warning. Copy this to the root of your sdcard.
On your rooted phone open your file manager (Astro or ES) and click menu. Allow root permission. You will see a legend that says your app has been granted superuser privileges. Navigate to sdcard and copy your desired hosts file. Go to root directory and paste the new file in /system/etc. You will get a warning that files will be overwritten/folders merged. Allow. Now you're done, easy money!
---------- Post added at 06:21 PM ---------- Previous post was at 06:15 PM ----------
To avoid a "blank" you have to show file types for known extensions. Editing is easy in Notepad++. This way you can add new annoyances at will. There's no place like 127.0.0.1!
I Understand the good side of your method.
Just a question. Can we do a link (ln -s....) via ADB with the original recovery ( the unrooted one) ?
Hey guys,
For a few days, I was wondering what could happen if we could compile the Standard C library (not trimmed one like Bionic) and compile some linux applications for ARM processor (say, Desire). I successfully compiled the GlibC, and now do have the .a and .so files.
The problem is, I don't know where to put them, so the dynamically linked applications can reach them! I could put them to /system/lib, but I don't want to overwrite the files already there (I don't want to crash the working parts of the system). I was thinking to put them to (say) /data and create symbolic links to /system/lib, but - as I said - what about the libraries which have the same name?
Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums and Read THIS
Moving to General
Sorry for the wrong section post. I found the solution though..
The thing is to be done is editing the Ramdisk/init.rc; changing LD_LIBRARY_PATH variable, accordingly (say, /data/lib). Once you do that, the system loads libraries from the folders, in specified order.
However, you must be cautious because since at the boot time, Data might not be mounted yet, the libraries that are installed there could not be read. Ergo, don't delete (or move) the system libraries (like I did ) - the phone won't boot without them.
Another issue is libc. Since bash shell is compiled with bionic, it requires bionic version of libc; not glibc. I'm going to try to overcome this by recompling shell; yet still there might be other problems (there might be other native executables need Bionic Libc)
I'll update this thread as I try new things.
theGanymedes said:
Sorry for the wrong section post. I found the solution though..
The thing is to be done is editing the Ramdisk/init.rc; changing LD_LIBRARY_PATH variable, accordingly (say, /data/lib). Once you do that, the system loads libraries from the folders, in specified order.
However, you must be cautious because since at the boot time, Data might not be mounted yet, the libraries that are installed there could not be read. Ergo, don't delete (or move) the system libraries (like I did ) - the phone won't boot without them.
Another issue is libc. Since bash shell is compiled with bionic, it requires bionic version of libc; not glibc. I'm going to try to overcome this by recompling shell; yet still there might be other problems (there might be other native executables need Bionic Libc)
I'll update this thread as I try new things.
Click to expand...
Click to collapse
I just put glibc in /lib, at boot /lib is empty, but then I mount the contents of /lib aftwards. Ideally it would mount from a custom init.rc script. I suppose if you put the libc in /data/lib you could sym link that to /lib during boot. I am pretty sure that /lib needs to be in the root dir and its contents must be executable. I found I had to edit some header file somewhere, I'll get back to ya once I start poking my head round Android again, syncing back up atm.
It seems LG Backup Application simply combine files using 'tar' command with -p option and rename it to *.lbf file.
So, is it possible to gain root access by compressing superuser files(apk and binary) with proper permissions?
I can't test it since I don't have ubuntu installed on my computer
p.s First folder(ex /data) has 644 permission, instead 755.
p.s2 Tar format is ustar