I have a rom that supports swap, but the swap script is missing.
How would i make that swap script manually?
I.E: What code would be in the file /etc/init.d/07swapon?
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It only takes a minute to sign up.
Sign up to join this communityI have a rom that supports swap, but the swap script is missing.
How would i make that swap script manually?
I.E: What code would be in the file /etc/init.d/07swapon?
How about this?
Open a console, navigate to the android SDK tools folder.
Type "adb mount /system", without the quotes doh!
Type "adb shell".
At the shell copy paste the following commands one by one and press enter after pasting them.
echo "#!/system/bin/sh" > /system/etc/init.d/05userinit
echo "swapon -a" >> /system/etc/init.d/05userinit
echo "/dev/block/mmcblk0p3 swap swap" >> /system/etc/fstab
chmod +x /system/etc/init.d/05userinit
chmod g-w /system/etc/init.d/05userinit
chmod o-w /system/etc/init.d/05userinit
chmod g-w /system/etc/fstab
chmod o-w /system/etc/fstab
exit
Now you are back at the normal command prompt, type "adb reboot".
Device will reboot, when its done open a terminal and type "free".
It should show swap space allocated.
And with some programs in memory you can see swap being used:
adb shell
free
total used free shared buffers
Mem: 407860 399940 7920 0 872
Swap: 249596 16596 233000
Total: 657456 416536 240920
Information from here