On some roms i cant set swap, my 2nd partition is linux swap and than when i try to enable it its just showing enabling... and nothings happens, only got some SU permissions appearing all the time!
Is there any solution/fix for my problem?
goldenr said:
On some roms i cant set swap, my 2nd partition is linux swap and than when i try to enable it its just showing enabling... and nothings happens, only got some SU permissions appearing all the time!
Is there any solution/fix for my problem?
Click to expand...
Click to collapse
are you using swapper2 app? please specify more info on your problem
You dont need to use an app to get swap. I prefer three lines of code in /system/etc/hw_config.sh
mkswap /dev/block/mmcblk0p2
echo 30 > /proc/sys/vm/swappiness
swapon /dev/block/mmcblk0p2
Try this to see if works
hunff said:
You dont need to use an app to get swap. I prefer three lines of code in /system/etc/hw_config.sh
mkswap /dev/block/mmcblk0p2
echo 30 > /proc/sys/vm/swappiness
swapon /dev/block/mmcblk0p2
Try this to see if works
Click to expand...
Click to collapse
but if rom/kernel doesn't support then gonna use swapper2 from the market.
or else follow hunff instruction and open terminal emulator
-type free
-swap 0 0 0 = not active use swapper2
-swap any value other than 0 = active
Thank you it works!
CKKnot said:
are you using swapper2 app? please specify more info on your problem
Click to expand...
Click to collapse
I am using reset swap app as my title says!
but i tried swapper2 and it says such a directory doesnt exist or other error message forgot it.
I thought ,that swap doesn't work if the kernel doesn't supporting it.
So you say that you can have swap if you have stock kernel(by using swapper?.
Sent from my E15i using Tapatalk
not sure about what he said...
i know you cant use swap partition to set swap with stock kernel
but dont know about swapper through FAT32
Related
im running the latest Drizzys hero and i need to set up my swap can anybody put the commands please and what do i use to set it up?....i'm running it o a G1 thanks in advance!!
Do you already have the third partition? If you do, then you can do this in terminal:
Code:
echo 80 > /proc/sys/vm/swappiness
Where "80" is my value for swappiness
I am M3 said:
Do you already have the third partition? If you do, then you can do this in terminal:
Code:
echo 80 > /proc/sys/vm/swappiness
Where "80" is my value for swappiness
Click to expand...
Click to collapse
how do u do this permanently from terminal?
ok so let's see if i got it....i did open Terminal Emulator and after i put that code i just get a # should i get any confirmation option? what is the code to check my swappiness at the moment?...and one more thing i should this everytime i reboot right?
DKM119 said:
ok so let's see if i got it....i did open Terminal Emulator and after i put that code i just get a # should i get any confirmation option? what is the code to check my swappiness at the moment?...and one more thing i should this everytime i reboot right?
Click to expand...
Click to collapse
You won't get any varification you'll just recieve no errors. If you want to check the swappiness
Code:
su
vi /system/bin/user.conf
look for cc_swappiness= [] <-- That's what you're swappiness is at.
Got it working ^^
Hi guys. can you please help me on swap. how can i enable it and disable it. and also set it to the amount that i want it. im still a bit new to this and i have also tried to look for a guide but cant find 1. thanks
Rawdi said:
Hi guys. can you please help me on swap. how can i enable it and disable it. and also set it to the amount that i want it. im still a bit new to this and i have also tried to look for a guide but cant find 1. thanks
Click to expand...
Click to collapse
If you are on Kings rom, it may be running already.
Type #free in terminal and see if it shows swap.
Rawdi said:
Hi guys. can you please help me on swap. how can i enable it and disable it. and also set it to the amount that i want it. im still a bit new to this and i have also tried to look for a guide but cant find 1. thanks
Click to expand...
Click to collapse
bbuchacher said:
In Terminal:
echo 30 > /proc/sys/vm/swappiness to change swappiness to 30 replace number with any number 1-100
cat /proc/sys/vm/swappinesss to see a current level
Click to expand...
Click to collapse
bbuchacher, just wrote it
thanks but the rom that im using is not using swap. how to i setup swap? can i push a user file?
Rawdi said:
thanks but the rom that im using is not using swap. how to i setup swap? can i push a user file?
Click to expand...
Click to collapse
It definitely depends on the rom. Some King roms he has a script you run. Other roms, all you do is go to Spare Parts and set what you want. It may be best to ask in the thread for that rom.
I remembered using this when I used CM:
http://forum.xda-developers.com/showthread.php?t=581328&highlight=swap
Enable swap
I used the method to enable swap in Linux on this and it worked fine on Cyanogen and Super-D.
I used Amon_RA Recovery 1.52 to partition my SDCARD and the new recovery lets you choose the size of your partitions.
so I created a 256MB Swap.
from a console/terminal do the following after creating your swap partition the size you want it:
1. mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system (makes system dir writable)
2. mkswap /dev/block/mmcblk0p3 (formats the swap partition on SD with swap format)
3. vi /system/etc/init.d/05userinit (make a new line at the bottom and add "swapon -a" with out the quotes this forced the swap to mount on boot if it is disabled in a kernel)
4. vi /system/etc/fstab (add a line that says "/dev/block/mmcblk0p3 swap swap" with out the quotes)
5. reboot
Hope you know how to use vi editor If not google it. "I" is insert mode and push track ball and hit 1 at the same time and that will esc you to command mode, in command mode do a :wq! and hit enter and that will save the file.
This works on all roms i have run into and no matter what others say it does help the performance.
I can make it easier (short of putting this in a script). Type each line in order and hit enter after each.
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
mkswap /dev/block/mmcblk0p3
echo "swapon -a" >> /system/etc/init.d/05userinit
echo "/dev/block/mmcblk0p3 swap swap" >> /system/etc/fstab
reboot
TGA_Gunnman
The UNIX Dude
NOTE: This method has been somewhat superseded by JustAnotherCrowd's method in this thread:
http://forum.xda-developers.com/showthread.php?t=744655
It should still work, however, if you don't want to mess with Odin, but if you want to use ext4 and get the max speed AND stability, I recommend using JACs method.
There are two zip files attached. Consider them "Beginner" and "Advanced". You can only use one or the other, not both. No wipe is required for either, but you will want to clean and repair your ext partition if you plan on using one.
Beginner: If you have an SD card with an ext partition on it (no swap partition, just FAT/ext), ttabal has created a fantastic script to mount it on startup. This zip file runs that script at startup. Credit to ttabbal for the script.
IMPORTANT: You will need to install the latest version of busybox before installing this update or it will not work. You can find busybox on the market for free; download and install it and then open it and click "update busybox".
http://getyourboneon.com/vibranta2sd.zip
Advanced: Enables you to place a custom userinit.sh script in /data/local (make sure premissions are set to 755) and it will run on startup.
http://getyourboneon.com/enableuserinit.zip
An explanation of how this was done:
When looking through the init.rc, I realized that there was only one thing running as root that could safely be replaced; the boot logo player. So, all this does is replace the boot logo player with a script that calls userinit.sh from /data/local and then calls the (now renamed) bootlogo player for those of you who want that nifty startup screen
A super simple (and slightly dirty) hack but I figured it might come in handy for those of us who are impatient and would like to do our own tweaks.
Nice....
I'll be looking forward to this.
Edit:
Working great.
??
Can some one elaborate on what this does?:
BM1515 said:
Can some one elaborate on what this does?:
Click to expand...
Click to collapse
http://wiki.cyanogenmod.com/index.php?title=Userinit.sh
anomalous3 said:
I found a way to get a userinit.sh script working for the vibrant for those of us who would like to run anything at startup. Already got the proof of concept working, and am now busy packaging it into an easy script that will set everything up for you. Will update this post later tonight with the finalized script once it's done.
Click to expand...
Click to collapse
Nice work. What can you do on bootup on the vibrant? I havent looked at all the kernel settings.
oh, just stuff like mounting an ext partition or initializing the modules for the FM radio (assuming we can find them and the hardware's there).
anomalous3 said:
oh, just stuff like mounting an ext partition or initializing the modules for the FM radio (assuming we can find them and the hardware's there).
Click to expand...
Click to collapse
Yes the userinit can contain quite a few script functions and technically almost all of them that would be needed on a modifed rom.
E.G
Code:
insmod /system/lib/compcache/ramzswap.ko;
rzscontrol /dev/block/ramzswap0 -i -d 32768;
busybox swapon /dev/block/ramzswap0;
echo 528000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq;
echo 0 > /proc/sys/vm/page-cluster;
# Set "deadline" scheduler fifo batch to 1 for mtdblocks and mmc
for i in `ls -1 /sys/block/mtdblock*` /sys/block/mmcblk0
do
echo 1 > $i/queue/iosched/fifo_batch
done
busybox mount -o noatime,nodiratime -t auto /dev/block/mmcblk0p2 /system/sdcard/sd;
if [ "$?" = 0 ];
then
busybox chown 1000:1000 /system/sd;
busybox chmod 771 /system/sd;
# clean up any old symlinks, create data directories
for i in dalvik-cache data;
do
if [ -h /data/$i ];
then
rm /data/$i;
fi;
if [ ! -d /data/$i ];
then
mkdir /data/$i;
busybox chown 1000:1000 /data/$i;
busybox chmod 771 /data/$i;
fi;
done;
Updated. And to mount an ext partition you'd want to mount /dev/block/mmcblk1p2.
Got my ext mounted but haven't yet figured out how to get app data over to the external sd card without tons of force closes (I'm probably setting the permissions wrong).
anomalous3 said:
Updated. And to mount an ext partition you'd want to mount /dev/block/mmcblk1p2.
Got my ext mounted but haven't yet figured out how to get app data over to the external sd card without tons of force closes (I'm probably setting the permissions wrong).
Click to expand...
Click to collapse
Those were some examples not specifically for the Vibrant.
justanothercrowd said:
Those were some examples not specifically for the Vibrant.
Click to expand...
Click to collapse
I know I could tell by the echo 528000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq;
I was just sayin' though in case anyone was interested in making this work....too tired to mess with it anymore tonight.
anomalous3 said:
Updated. And to mount an ext partition you'd want to mount /dev/block/mmcblk1p2.
Got my ext mounted but haven't yet figured out how to get app data over to the external sd card without tons of force closes (I'm probably setting the permissions wrong).
Click to expand...
Click to collapse
I've been trying to get the ext partition to mount, but I keep getting errors from mount. This is just with "adb shell". I did "su", and have root. What command are you using? Does it only work from the userinit?
# mount /dev/block/mmcblk1p2 /system/sd
Usage: mount [-r] [-w] [-o options] [-t type] device directory
# mount -t auto /dev/block/mmcblk1p2 /system/sd
mount: No such device
# ls /dev/block/mmcblk1p2
/dev/block/mmcblk1p2
The device and mount directory do exist, so I'm a bit lost. I'll give it a go with the userinit hack and see if that gets things running.
EDIT: Nevermind, I forgot to do "busybox mount". grrrrr.. that works now.
EDIT2: Ummm... it mounts as a j4fs with a bunch of crap I've never seen on there. WTF?!? I didn't even know that filesystem existed.
maybe try
Code:
busybox mount -t ext3 /dev/block/mmcblk1p1 /system/sd
? I got it to mount and recognize the ext partition, my trouble was getting the data over to it. maybe a symlink isn't the best way to do it and I could try a bind mount.....
OK. I got it working, had to use mkfs.ext2 to re-format the ext partition. I have no idea what put that other crap there, but it wasn't me and formatting doesn't seem to have bothered anything.
Here's a rough draft of my userinit.sh. I have booted with it, and it seems to work fine. No warranty, obviously. It bind mounts /data/data to a directory on the ext partition, copying files if needed. It might do with some more cleanup and safety checking, but seems to work OK for me.
Speed wise, it seems to work pretty good.
Oh, you need to create the /system/sd directory yourself. I didn't add that in the script. remount rw and "mkdir /system/sd". A root file manager should be able to handle that as well, or add it to the script.
I've never had lag on my Vibrant so the lag fixes have always confused me a bit. Screwing with the phone is what its all about though.
well I'll be damned. It works. I wonder if we'll see an improvement from moving the dalvik-cache over too, seeing as how those are the actual executables for the applications.
[edit] It seems to have killed my mobile data connection.[/edit]
anomalous3 said:
well I'll be damned. It works. I wonder if we'll see an improvement from moving the dalvik-cache over too, seeing as how those are the actual executables for the applications.
Click to expand...
Click to collapse
Possibly. I haven't tried that yet. Maybe I'll toss it on and see. I did another version that moves the mount to /sd-ext like CM5. I'll add that in here, it automated, no need to make the mount point yourself. It feels a little more "standard" to have it there.
OK. For grins, I moved dalvik-cache as well. Here's the update, same mechanism. It feels like it might be a little faster, I'm not sure. I'll let everyone have a try at it and see what you think.
it works and data works too! Also seems noticeably quicker!
With your permission, I'd like to package this into an update.zip along with the userinit enabler (once you feel it's ready) so we can have a reliable way to get apps2sd working.
so with this userinit.sh we can apply the mimocan fix, not that i have noticed a hell lot of stalling but there is somewhat stalling after a while. only to make a great phone even better.
anomalous3 said:
it works and data works too! Also seems noticeably quicker!
With your permission, I'd like to package this into an update.zip along with the userinit enabler (once you feel it's ready) so we can have a reliable way to get apps2sd working.
Click to expand...
Click to collapse
just one question... why would we need a2sd? i remember when i had my mt3g and whenever i ran any sense rom or regular rom that a2sd slows it down significantly but when i stored everything on the phone it was way smoother and its not like we dont have the space..
possible fix workaround for the DSI errors on Motorola Milestone Froyo on nadlabaks github
http://github.com/nadlabak/android_...mmit/e1bb339b133dd88389a4c3a80bad3a984d12db50
EDIT:
IanTester said:
echo 1 > /sys/devices/omapdss/display0/update_mode
Click to expand...
Click to collapse
should do the same
EDIT:
<nadlabak> it causes slight tearing, visible e.g. when scrolling through email list...
Click to expand...
Click to collapse
but better than reboots or freezes
also fps might drop
EDIT:
for stock 2.2.1, customroms should use their 2nd init (CM7 HowTo):
move original file:
Code:
mv /system/bin/mot_boot_mode /system/bin/mot_boot_mode.bin
create file /system/bin/mot_boot_mode:
Code:
#!/system/bin/sh
export PATH=/system/bin:$PATH
mot_boot_mode.bin
echo 1 > /sys/devices/omapdss/display0/update_mode
set rights:
Code:
chmod 755 /system/bin/mot_boot_mode
EDIT:
made HowTo more clear, hopefully
How to apply this?
Sent from my Milestone using XDA App
to apply this fix you hafe to (as root or in OR)
if /system is readonly:
Code:
mount -o rw,remount /system
then edit /system/etc/rootfs/init.mapphone_umts.rc and add
Code:
# Set OMAP DSS update_mode to 1 (auto) to get rid of the DSI errors
write /sys/devices/omapdss/display0/update_mode 1
after these lines
Code:
# Enable panic on softlockup
write /proc/sys/kernel/softlockup_panic 1
reboot Milestone
Maybe it should be
mount -o ro,remount /dev/block/mtdblock6 /system
Hm, there is no directory rootfs in /system/etc/ ... Have you tried what you are writing here? Maybe "rootfs" refers to the root dir "/" and the file to edit is "/init.mapphone_umts.rc".
You don't need a reboot.
echo 1 > /sys/devices/omapdss/display0/update_mode
Click to expand...
Click to collapse
(I presume that's what that command in the rc file does, right?)
But make the changes to the rc file as well, so the above action is performed on subsequant boots.
as it's on nadlabaks github for cyanogenmod4milestone (CM7) it might differ from the way to do in official froyo. but IanTesters way should do the same
ColdSphinX said:
as it's on nadlabaks github for cyanogenmod4milestone (CM7) it might differ from the way to do in official froyo. but IanTesters way should do the same
Click to expand...
Click to collapse
Seems to be the case. But since I'm not able to edit /init.mapphone_umts.rc (that's the reason why there is an extra dir for this in cyanogenmod), how am I supposed to implement this fix in the official froyo?
Done on CM6.
Yesterday I was browsing the system folders and found this file, full of customizable options, now I know that it's useful.
@tuxor1337: look for the mot_boot_mode hack to run a script as it's used for overclock
IanTester said:
echo 1 > /sys/devices/omapdss/display0/update_mode
Click to expand...
Click to collapse
For stock Froyo roms, i applied VR and then ran AOR, connected phone to pc and used the following commands in command prompt.
adb devices ( should show your device as connected )
adb shell
echo 1 > /sys/devices/omapdss/display0/update_mode
reboot
Upon reboot, i did not find any errors in dmesg which i usually find.
Can someone with more knowledge than me confirm if this is ok?
I know that can be a noobish question but what VR stands for ?
fuggii said:
I know that can be a noobish question but what VR stands for ?
Click to expand...
Click to collapse
VR --> Vulnerable recovery
AOR --> Androidiani openrecovery
I had to do it because adb was not recognising my phone while in the stock recovery menu.
Once i ran AOR, adb recognised my phone to be in recovery mode.
I make this "echo 1 > /sys/devices/omapdss/display0/update_mode" from terminal emulator and after reboot its back to "2" it must be done form adb in AOR ?
it has to be done on or after any boot.
I edited the 1st post to include the changes to do on stock 2.2.1
fuggii said:
I make this "echo 1 > /sys/devices/omapdss/display0/update_mode" from terminal emulator and after reboot its back to "2" it must be done form adb in AOR ?
Click to expand...
Click to collapse
Looks like it loses it during reboot, so it could be added to the init.rc file as well. I am not sure, that's why i asked with someone more knowledge to confirm this.
Anyone?
I have Autostart app and i make autostart.sh with that command and now its start every system boot.
In home i will try that ColdSphinX method and see what happend
@fuggii it's not my method, it's just a mot_boot_mode hack so you don't need any app and the fix get's applyed as early as we can
I think this should work but I copied all of this https://github.com/nadlabak/android...b50/prebuilt/etc/rootfs/init.mapphone_umts.rc
And used that as init.mapphone_umts.rc
Hey the OP needs updating....
It's missing the 1
echo 1 > /sys/devices/omapdss/display0/update_mode 1
zeppelinrox said:
It's missing the 1
echo 1 > /sys/devices/omapdss/display0/update_mode 1
Click to expand...
Click to collapse
no
Code:
echo [B]1[/B] > /sys/devices/omapdss/display0/update_mode
writest the value 1 into file /sys/devices/omapdss/display0/update_mode it's an other syntax then using write in the .rc
i finally get it to work.
this script (if kernel support) create a swapfile on mostly unused /cache partition
-copy the script to phone
-chmod
-add it to end of hw_config.sh (or any other way of bootexecute)
have fun
inteks
update:
new version creates own loopdevice (thx to hygge)
pls guider install ??
niceee.
Does this work on rooted and locked 2.3.4 Arc ?
dubist said:
niceee.
Does this work on rooted and locked 2.3.4 Arc ?
Click to expand...
Click to collapse
sorry but you need a kernel with swap support ...
le_manhpro said:
pls guider install ??
Click to expand...
Click to collapse
the easiest way is to use i.e. rootexplorer to run the script but then you have to do it after every reboot.
maybe a good idea for testing
will it work on ray?
What's benefits we have using swap file?
Thx for answer
inteks said:
sorry but you need a kernel with swap support ...
Click to expand...
Click to collapse
So what kind of kernel, is DoomKernel support? why you dont give a sameple?
Interesting idea, I have setup swap as descriped but I had to change loop device to /dev/block/loop18 which was the only unused loop device on my mobile.
It was wierd, because all new loop devices I created was quickly reserved for the same app by the system, rather annoying. But luckily I had one unused allready available.
I will let you know how it works, how the system performance is percieved after some testing. I would think it could slow down the device, the memeory is increased but it will be on slower memory.
donghungx said:
So what kind of kernel, is DoomKernel support? why you dont give a sameple?
Click to expand...
Click to collapse
yepp, doomkernel support swap
Sent from my MT15i using Tapatalk
Hi inteks
Thanks allot for your script, it actually feels like its memory has been increased with 64MB. I have a few times experienced a slight lag when starting up memory hungry games but the homescreen no longer has to redraw when returning from the game
It is usually problematic in the Order and Chaos game to chat as the game loads the default keyboard which takes some time as it is removed from memory again as soon as you have send your message. The swap makes the keyboard stay in memory and open up instantly
I am also able to keep more applications open during normal use, I would normally have problems having mail, web and other document open at the same time.
I had to modify your script and manually create a new loop device, all loop devices from loop0 to loop38 was allready used.
# mknod -m640 /dev/block/loop50 b 7 50
hygge said:
Hi inteks
Thanks allot for your script, it actually feels like its memory has been increased with 64MB. I have a few times experienced a slight lag when starting up memory hungry games but the homescreen no longer has to redraw when returning from the game
It is usually problematic in the Order and Chaos game to chat as the game loads the default keyboard which takes some time as it is removed from memory again as soon as you have send your message. The swap makes the keyboard stay in memory and open up instantly
I am also able to keep more applications open during normal use, I would normally have problems having mail, web and other document open at the same time.
I had to modify your script and manually create a new loop device, all loop devices from loop0 to loop38 was allready used.
# mknod -m640 /dev/block/loop50 b 7 50
Click to expand...
Click to collapse
pls guider install tks
le_manhpro said:
pls guider install tks
Click to expand...
Click to collapse
Here is the script with my modifications manually creating a new loop devices. I have used loop50 as 0-38 was allready in use and it would leave some room for new loop devices.
I am using scriptmanager to either run the script manually or run it at boot.
Have marked my changes with bold
#!/system/bin/sh
if busybox [ ! -f /cache/swap/swapfile.swp ]
then
echo "Create Swapfile"
mkdir /cache/swap
busybox dd if=/dev/zero of=/cache/swap/swapfile.swp bs=1M count=64
busybox mkswap /cache/swap/swapfile.swp
busybox chmod 0600 /cache/swap/swapfile.swp
else
echo "Swapfile Exist"
fi
echo "connect loop devices"
mknod -m640 /dev/block/loop50 b 7 50
losetup /dev/block/loop50 /cache/swap/swapfile.swp
echo "use loopdev for swap"
swapon /dev/block/loop50
echo "raise swappiness 2 "
echo 90 > /proc/sys/vm/swappiness
cat /proc/sys/vm/swappiness
free
Thanks a lot for the script. What is this loop anyways?
matus201 said:
Thanks a lot for the script. What is this loop anyways?
Click to expand...
Click to collapse
It is a device driver in linux, the loop device driver is created as a block device which functions as disc device. The loop device driver are used to loop back into local imagefiles on the existing filesystem.
You then use losetup to point the loop device file towards an imagefile on the existing memory devices. In this case it is configured to point towards the new empty 64MB file that are created in the beginning of the script.
You now have a small 64MB filesystem attached that we can use as linux swap
Why not making a 128 swap file to improve even more?!
I'm a noob... So I just intested to know how it works...
Sent from my LT15i using XDA App
must this be added for your kernel to start swapping inactive applications from the RAM to the cache partition ?!
thanks man
---------- Post added at 09:30 PM ---------- Previous post was at 09:29 PM ----------
haimelf said:
Why not making a 128 swap file to improve even more?!
I'm a noob... So I just intested to know how it works...
Sent from my LT15i using XDA App
Click to expand...
Click to collapse
the cache partition is only 100mb
yes
Sent from my MT15i using Tapatalk
i heard that swap would wear the cache partition in time thus making it un-useful @ all for it's original use , i believe that cache is used for stuff like downloading apps from market !
thanks
What is "chmod" ??
Sent from my LT15i using xda premium