Hi,
When you want to perform some scripts at boot-time, there is two possibilities :
- modify init.rc, but it requires to reflashing the rootfs image (modification in / does not hold after a reboot),
- using an android app like script manager, which will load your scripts at java/dalvik platform boot-time.
I've managed to find a way based on activating tf-daemon, which is a script called by the asus/ventana initrc, but disabled at boot-time. Basically, we're re-enabling this daemon by setting the property tf.enable to yes, and then creating a script called tf-daemon and put it in /system/bin. Since this script is called by init.ventana.rc as root, you can put whatever you want inside this script.
I don't know what is the original purpose of this daemon, but probably it's used by the asus team for internal and debugging purpose.
Be aware that in the next firmware update, this possibility could disappear.Let's hope the asus team does not read this post. Or at least they could allow power users to call custom scripts at boot-time.
As a case study, you will find as attachment a script for loading nfs modules at boot-time.
PS: damn, can't upload. Here is a temporary link : http://dl.free.fr/hwTZ0YBq2
Untar the archive, then su, and sh install.sh
At reboot, you should have nfs modules loaded.
Good find:
I gave this a try just to load a couple of my own modules that work with the kernel I'm using. Works fine -- Thanks, -
Another method is to make a script and just call it in the init.rc. After a firmware update you only have to add the "exec myscript.sh" line to init.rc. I personally prefer this method because it allows me to control when the script is executed, whereas the tf-daemon method is always executed at the same point(AFAIK). Good research though, always nice to know all the boot calls.
Modifying the init.rc was my first shot, but the problem is that init.rc lies in ramdisk. So when trying to modify, the modification does not hold
after reboot. So a real modification involves to reflash rootfs with nvflash, too much hassle for me. The method I'm providing is for lazy ones. ;-)
nice find, but the link is dead, could you please provide a new link for the script?
also, how do I load nfs module for there is none under /lib/modules, compile the kernel myself?
Hi,
I'm new to the business and I spent some time to learn the environment trying different applications and different approaches for almos every action I took. Today, I have not much bigger knowledge, but I finally decided to take few things in my own hands because existing software is not fulfilling my wishes.
I started with this simple script which eases the pain of reinstalling all applications after ROM upgrade. There are few such tools already, but I found those quite bloated with unnecessary thing for my own approach.
With this script I assume:
1. There is/was SSHDroid installed (or any tool with busybox and you can access shell command line) both in old and new ROMs and your ROM have bash installed in /system/bin/.
2. Backup/restore operation includes only INTERNALLY installed applications, it completely ignores SYSTEM and SDCARD installed ones.
3. This is TEMPORARY backup so it should be as fast as possible not caring about occupied space (!). Althought I added -zip parameter to enable compression if you are running out of space on your sd.
4. Installed ROM is clean with no additional apps installed (excluding those needed by the script)
5. You have basic knowledge about bash scripting, because I take NO RESPONSIBILITY of the script behavior or data loss it can do.
So, basically it is simple. It runs like this:
1. On old ROM type: sbackup -backup
2. Flash your ROM
3. On new rom type: sbackup -restore
Just like that. The applications data is tar'ed in one file per application so if you want to get rid of any, just delete it from backup directory. The directory name is same as script name on sdcard but you can change it adding a parameter without a '-' sign at runtime (first non-option parameter is treated as backup directory path). The file is zipped because this forum disallows files without an extension so... it is zipped ;D
It was tested on my fresh LeeDroid 3.3.3 GB AFTER i installed some apps. I backed them up and then restored. All seems to be perfect right now, but I will test it more thoroghly very soon because I'm planninig to have CM7 based ROM too just to choose that I need Sense or not (two nandroids for fast switch weekly ;P).
With this script and MyBackup functionality of backing up contacts, sms, history and similar it should be quite complete approach to restore all the data needed on the fresh ROM. In the future maybe I will look at the MyBackup part too. Maybe.
Feel free to comment, use, suggest or anything you like, and have fun ;P.
How do I run this script? Do i run it from sdcard or from system /bin? When i do it from system bin it says cannot create directory. When i run it from sdcard/sbackup it says permissions denied?
Sent from my ADR6400L using Tapatalk
jgrimberg1979 said:
How do I run this script? Do i run it from sdcard or from system /bin? When i do it from system bin it says cannot create directory. When i run it from sdcard/sbackup it says permissions denied?
Sent from my ADR6400L using Tapatalk
Click to expand...
Click to collapse
And thats why I mentioned in topic about not being a newbie (and I meant not forum newbie but more a linux newbie). The thing is, it's a simple script - without any user-proof capabilities, comments inside or something BUT...
But ok, I will try to help you run it. First of all, you have to set permissions to the script. It has to have executable permission to be run by the system (and I mean filesystem permission). This can be done by chmod instruction of busybox. Most of the times it's done like this:
chmod 755 filename
This is a reason of not running form sdcard if your sdcard is NOT ext filesystem (it is usually windows fat filesystem not to generate problems with reading it under windows).
Second thing to run is to have /system/bin/bash because first line of the script (a comment like this: #!/system/bin/bash) instructs busybox to execute script using bash. This can be simply changed by modifying this line, but you have to remember that changing the shell executing script have consequences. Differens shells have sometimes different syntax, althoght i wrote this script simply so it should run on most of them, especially sh.
Third thing is to have write permissions to the directory in which the backup will be created. In original version of the script it is /sdcard, because backup is made in /sdcard/sbackup. So, you have to check it (second error - problems with creating directory).
And a last tip - it can be run from ANYWHERE. Even if your partition does not alolow executing, you can do it like this:
bash-3.2# /sdcard/test
bash: /sdcard/test: /system/bin/bash: bad interpreter: Permission denied
bash-3.2# . /sdcard/test
OK
bash-3.2#
First try does not succeded, but second did. The trick is a dot which means to execute file with a shell not caring about why or permissions.
And thats most simple introduction I could write. It applies to ANY script you want to run.
Please anyone - if you want me to help, paste your results here because without a precise error message it can be very hard to deduce what caused for example permission denial or anything usual.
For now, I won't add any more error handling, but if there will be more users caring about, I will add it.
hi,
i flashed paranoid android 1.992 and
[KERNEL][GPL][Linaro][OC 1.6GHz][UV][GPU+][ZRAM][SIO+V(R)] 2012-08-10 motley 1.1.1
and i wanted to run init.d scripts like the butter script that disables fsync and i used system tuner to set sd card cache to 1024... but that doesnt work .
the script from system tuner is there... in etc/init.d but when i look into settings in system tuner cache is set back to 2048
when i run the script from init.d folder with script manager and then look into system tuner again 1024 is finally set...
so init.d support is not there
does anyone know what the problem could be ?
thx
Dude, if you use the pre-made scripts and put into the proper place. I don't think you need system tuner to do anything. I don't even have it installed on mine. From what I read from the thread, system tuner was originally used to generate some of the scripts but since someone already did it, you don't need to use system tuner. I might be oblivious to whats going on since I'm still a noob but after using the scripts my quadrant score skyrocketed and my N7 just feels way way way snappier.
What is an ODEX file?
In Android file system, applications come in packages with the extension .apk. These application packages, or APKs contain certain .odex files whose supposed function is to save space. These ‘odex’ files are actually collections of parts of an application that are optimized before booting. Doing so speeds up the boot process, as it preloads part of an application. On the other hand, it also makes hacking those applications difficult because a part of the coding has already been extracted to another location before execution.
What is an DEODEX file?
Deodexing is basically repackaging of these APKs in a certain way, such that they are reassembled into classes.dex files. By doing that, all pieces of an application package are put together back in one place, thus eliminating the worry of a modified APK conflicting with some separate odexed parts.
So, Deodexed ROMs (or APKs) have all their application packages put back together in one place, allowing for easy modification such as theming. Since no pieces of code are coming from any external location, custom ROMs or APKs are always deodexed to ensure integrity.
How this works?
For the majority noobs amongst us, Android OS uses a Java-based virtual machine called the Dalvik Virtual Machine. A deodexed or .dex file contains the cache used by this virtual machine (referred to as Dalvik-cache) for a program, and it is stored inside the APK. An .odex file, on the other hand, is an optimized version of this same .dex file that is stored next to the APK as opposed to inside it. Android applies this technique by default to all the system applications.
When an Android-based system is booting, the davlik cache for the Davlik VM is built using these .odex files, allowing the OS to learn in advance what applications will be loaded, and thus speeds up the booting process.
By deodexing these APKs, a developer actually puts the .odex files back inside their respective APK packages. Since all code is now contained within the APK itself, it becomes possible to modify any application package without conflicting with the operating system’s execution environment.
Advanteges & Disadvantages
The advantage of deodexing is in modification possibilities. This is most widely used in custom ROMs and themes. A developer building a custom ROM would almost always choose to deodex the ROM package first, since that would not only allow him to modify various APKs, but also leave room for post-install theming.
On the other hand, since the .odex files were supposed to quickly build the dalvik cache, removing them would mean longer initial boot times. However, this is true only for the first ever boot after deodexing, since the cache would still get built over time as applications are used. Longer boot times may only be seen again if the dalvik cache is wiped for some reason.
Note:Themes for android come in APKs too, and if you want to modify any of those, you should always choose a dedoexed custom ROM.
What is Zipalign?
Zipalign is an archive alignment tool introduced first time with 1.6 Android SDK (Software Development Kit). It optimizes the way an Android application package (APK) is packaged. Doing so enables the Android operating system to interact with the application more efficiently, and hence has the potential to make the application and overall the whole system much faster. Execution time is minimized for zipaligned applications, resulting is lesser amount of RAM consumption when running the APK.
How does it exact work?
In an Android operating environment, data files stored in each application package are accessed by multiple processes, for example, the installer will read the data manifest to determine the associated permissions; the system server can read these resources for multiple reasons, like displaying notifications; the Home application, for example, will read resources to get the application’s name and icon. Since Android is based on a a true multi-tasking operating infrastructure, these files are continually and repeatedly accessed. Finally, but not least, the application itself reads the manifest data.
As Android is Linux-based, memory-mapping plays a key role in efficient handling of processes. Essentially, the optimal alignment for the Android OS’ resource-handling code is 4-byte boundaries. What this means is that, if APKs are memory-mapped to 4-byte boundaries, and aligned accordingly, the OS will not need to ‘read through’ the whole application package to get to the desired data manifest. Every system process will know in advance where to look for it’s desired resources, and hence will execute much smoother and faster.
Summing it up, zipaligning an APK results in all uncompressed data within the package to be aligned on 4-byte boundaries, allowing all portions to be accessed directly with the memory-map. RAM consumption is lowered while execution because the querying code doesn’t have to read through the entire application package.
Disavantages of unaligned APKs
Quite understandably, situation would be reserved for unaligned application packages. Resource reading would be slow and memory usage would be on the higher end of the spectrum. It would also depend on how many unaligned applications are present. For example, if less number of applications with an unaligned home application, you’d see slower application launch times. This is the best case scenario. For a worst case scenario, having a number of unaligned applications will result in the system repeatedly starting and killing processes, struggling with lags and huge battery drain.
How to make APKs zipaligned?
As mentioned earlier, the zipalign tool became a part of Android SDK from 1.6 onwards. It can be found under the ‘tools’ folder of the SDK. To use it, simply run the command:
zipalign [-f] [-v] <alignment> infile.apk outfile.apk
Click to expand...
Click to collapse
...where infile.apk is the source file, and outfile.apk is the output file.
You can also verify the alignment of an APK file using the following command:
zipalign -c -v <alignment> existing.apk
Click to expand...
Click to collapse
...where existing.apk can be any application package that you need to get verified. Also, the <alignment> tag in both the commands needs to be an integral value (otherwise the command will return invalid). This value, although can be any integer, MUST always be 4, which would provide 32-bit alignment. Any other value and it will effectively do nothing.
Finally, for the flags used in these commands,
-f - overwrites existing outfile.zip
-v - will give verbose output
-c - will confirm the alignment of a given file
Click to expand...
Click to collapse
CAUTION: Zipalign operation must only be performed after you have signed the APK file with your private key. If zipaligned before signing, the signing procedure will disturb the alignment. Same holds true for any other alteration, addition or removal to the APK file. Any change after running zipalign will undo the alignment.
Source: addictivetips
Reserved.
Hi
Was searching for Linux SWAP Enabling Scripts many times, Linux SWAP Partition or SWAP File, was using Ram Expander for mount my Linux SWAP Partition, and didn't found nothing apart tutorials how to make it…
So I decided to make my own Linux SWAP mounting script.
It's not the first version, so many bugs are already fixed, also included some Low Memory TaskKiller Tweaks.
And because I'm using SdCard EXT4 Partition for secondary Roms I added Script to mount it like other storage on data/media/0, so it's also accessible via PC Connection
Tested on my Xperia Z1 Running Stock Android 5.1.1, but must work
on all Xperia Z Line Models…
Also made some simple Application With TASKER App Factory for change Ram Profiles when Android is booted
To Completely Remove it Simply don't change Aroma Installer Options, press next 4 times, and all of my Stuff's will be Completely Removed
Here is tutorial, how to correctly create Linux SWAP or EXT4 Partition, or both
It's highly recommended to use Class 8 or higher Micro SD-CARD, otherwise it will slowdown your system…
If you don't want to lose your data on SDCARD simply choose move/resize option, make primary partition smaller, then create other partition, or partitions on free space.
⇧⇧⇧Only works with Windows method ⇧⇧⇧
And if somebody don't want to make any changes, hi can use SWAP File, my Installer will create 512Mb, 1Gb or 2Gb SWAP Files on SDCARD or on DATA Partition
My Script and Application don't require SWAP, so you can use it only for RAM PROFILES or EXT4 PARTITION MOUNTING , everything can be selected apart
Now init.d support also don't required, my app repeating all actions, but atleast one option must be selected, because my app and script use flags to know what to make and if no option is selected my script and app have nothing to do…
Requirements : Latest BusyBox Version is Required (Can be Installed by the Same Installer ) .
WARNING : Using of Linux SWAP Partition or SWAP File can reduce your memory life, because of many rewrites!..
⇩⇩⇩Download folder, will upload my script there ⇩⇩⇩
⇝Download Link⇜
Changelog :
V 1.1.1 Initial Public Release .
V 1.2.2 Update :
1)Some bugs fixed;
2)SdCard1 and Linux SWAP Partitions Dual SWAP Added;
3)Added SdCard1 SWAP Files;
4)Cleaning Script Added to Installer.
V 1.3.3 Update :
1)Some small bugs fixed;
2)Memory Manager Application Added;
3)Memory Manager Application Logs Added.
V 1.3.4 Update :
1)Script Code Improved;
2)Memory Manager Application Improved;
3)Added Script for App Installation on
ALL Android Versions;
4)Some Small Aroma Installer Improvements.
5)⇩⇩⇩Performance Control App Added to Installer⇩⇩⇩.
Extracted From RockZ1L ROM Credits to Venkat Kamesh.
V 1.3.5 Update :
1)Some Script Code Improvements;
2)Application Improved;
3)Small Bugs Fixes.
V 1.3.6 Update :
1)Application Improved;
2)Application Logs System Improved;
3)Small Script Improvements.
V 1.4.7 Update :
1)ZRAM and ALL Combinations Added;
2)TRIPLE SWAP SYSTEM Added;
3)Some bugs fixed;
4)Small Improvements.
V 2.5.8 Update :
1)Latest ARM BUSYBOX V1.24.1-Stericson Added to Installer;
2)Aroma Installer Improved;
3)Added RAM MEMORY Status Before and After Script Execution;
4)Application Improved;
5)Some Small Code Improvements.
V 2.5.9 Update :
1)Application Improved;
2)Application Instlling Script Improved;
3)Normal Application Installers Added;
Planned :
1)More Improvements and Stuffs...
Click to expand...
Click to collapse
Thanks to /Credits :
Venkat Kamesh for Butifull Animated Aroma Splash and Performance Control Application, thank you
Amarullz for Great Aroma Installer, thank you very much
[NUT] for applications installing script (I used his script for apps installation, to not complicate my life ), thanks for good script .
Enjoy
Searching for Ideas
Thanks for Everyone ho thanked me
But , sorry, was waiting for any suggestions…
If someone want me to add something New, please let me know
Now planned to add Lcd Density changing script and maybe something more, if I can, so still waiting for suggestions, or simply ideas, to make it Really Good
Edition :
If someone have problems with my Stuff's, please provide me Aroma Installer Log and All XZRAMCONTROL SDCARD1 Folder content
My App and Script have inbuilt logs system…
This way I can investigate what is wrong, maybe I made the error, Only One that don't making nothing never made errors
Operation successful
Finally I changed internal battery of my Z1
So I believe it will work two years more
And now I have many many ideas…
Thinking to make D_Vovan_238 Pack, with all stuff's and editions that I use…
But it will take time and will work only on Z1
Also updated my rom to latest .216 Sony build by MXNice And latest v16 Advanced Kernel by Sharonliu, so will work with those stuff's
P.S. everything what I made, I made with my Xperia Z1 (C6903)…
Work this on z1 compact d5503 too?
Sent from my D5503 using XDA Free mobile app
Giesama said:
Work this on z1 compact d5503 too?
Sent from my D5503 using XDA Free mobile app
Click to expand...
Click to collapse
Not tested, but must work
Try it and if it's not work, simply remove it with the same installer
Just launch installer and don't change any Aroma options and it will be completely removed
Update
Now uploaded new version of Memory Manager
Application Improved, some small bugs fixed in Installer and Script and the Thread also updated
Enjoy
D_Vovan_238 said:
Hi
Was searching for Linux SWAP Enabling Scripts many times, Linux SWAP Partition or SWAP File, was using Ram Expander for mount my Linux SWAP Partition, and didn't found nothing apart tutorials how to make it…
So I decided to make my own Linux SWAP mounting script.
Enjoy
Click to expand...
Click to collapse
Thanks , work on my z1 , :good: what the best recommended selection on aroma installer? its so many selection there
iedafarha said:
Thanks , work on my z1 , :good: what the best recommended selection on aroma installer? its so many selection there
Click to expand...
Click to collapse
There is no best Aroma settings, everything depends of what you want.
I'm using 1.4 Gb LINUX SWAP PARTITION MMCBLK1P2 and 8G EXT4 STORAGE MMCBLK1P3 for external Roms.
But if somebody want more performance, hi can use Dual SWAP, LINUX SWAP PARTITION and SDCARD OR DATA SWAP FILE.
But recently discovered that Dual SWAP, Linux SWAP Partition and SDCARD SWAP FILE don't work good on all roms
Also mostly use MultiTasking RAM Profile and ofcourse using my Apps
New Version Available
Just finished update of the Memory Manager
Application Logs System Improved, added separated log for application, which will provide more detailed information about Ram Memory, and app script log…
Enjoy
New Version !!! Big Update
Just added new version of Memory Manager
ZRAM added to installer, Triple SWAP finally added...
Check ChangeLog inside Aroma Installer
Planned
Because now its turning more itresting, I am thinking about to add Latest BusyBox ONLY for Memory Manager...
And when I will made it, I will create DEVDB Progect
But want to ask this stuff users:"Should i post it on Cross DEVICE or ONLY In XPERIA Z1 Android Development Departament?!."?..
If I will get no respond, I will create DEVDB Project ON Xperia Z1 Android Development...
Old Thread will be like Q&A Thread, or unmantained …
how can this improve battery life ?
draligus said:
how can this improve battery life ?
Click to expand...
Click to collapse
This is not for battery, its for more multitasking , better performance and sd-ext4 partition mount(like bonus).
Is it possible to swap internal and external sd? I mean my 128gig sdcard will be recognized as sdcard0 so all the high-end games will be installed on external sdcard
Odoslané z D6603 pomocou Tapatalku
NetSkill said:
Is it possible to swap internal and external sd? I mean my 128gig sdcard will be recognized as sdcard0 so all the high-end games will be installed on external sdcard
Odoslané z D6603 pomocou Tapatalku
Click to expand...
Click to collapse
The point of this stuff is Virtual Ram Memory
But if you want to move some heavy game files from internal memory to external sdcard, I suggest you to use obb on sd xposed module, if you have active Xposed Framework ofcourse, this way you can move all, or almost all, sdcard/android/obb and sdcard/android/data to sdcard1/android folder
It will free up a lot of memory on internal storage
how come this is an exact copy of this : http://forum.xda-developers.com/showthread.php?t=2145133 ?
mayank22 said:
how come this is an exact copy of this : http://forum.xda-developers.com/showthread.php?t=2145133 ?
Click to expand...
Click to collapse
No it's not a copy, I didn't found this thread when was searching for Linux SWAP Scripts, other thing I didn't see Xperia Z1 in supported devices and third I didn't see option of dual swap and triple swap and ext4 mounting option.
I made my script on my own, you can find the history in RockZ1L kernel thread
Will take a look inside this installer, I believe it's very different from my…
My installer using only one big script with flags to determine what to make…
Edition :
Was looking inside the Turbo Boost Mod, it's very very different from my script and it's working different way…
My Installer create SWAP File, not the script, like the other.
I think it's a bad idea to create SWAP File on boot, some users can take this slowdown like bootloop...
And there are many many different things, if you have basic android programming knowledge, take a look your self, I think you will found more then 10 different things
And if you will try to flash Turbo mod on Xperia Z1, you will be surprised, the installer will exit without making something, because Z1 is unsupported model
And I know why, some values are not good for our Z1
Edition 2 :
Was reading aroma.config file from Turbo Boost Mod Installer and now I see that it also can install dual and triple swap, but it not using Linux SWAP Partition, only SWAP Files…
It's also very good work, like I think…
Almost made new Update
But must fix bugs related with changes that I made, I think in one day, maybe two, we will have new stable version.
It will be awesome
Which app you use on your picture? If the app? If the app should be installed with, it does not happen with me.
Sent from my D5503 using XDA Free mobile app
Giesama said:
Which app you use on your picture? If the app? If the app should be installed with, it does not happen with me.
Sent from my D5503 using XDA Free mobile app
Click to expand...
Click to collapse
I used my application, maid by Tasker App Factory, for screenshots.
Are you using KK or LP Android?
And did you changed Android version in build.prop file?
Theoretically App installation script looking I to build.prop file to know how to install apps…
Be sure to select option to install apps in aroma installer, if not selected no apps will be installed