Welcome to CyanogenMod
![]() |
Welcome to our forum. Like most online communities you must register to post, but don't worry this is a simple free process that requires minimal information for you to signup. Be a part of the CyanogenMod Forum by signing in or creating an account. You can even sign in with your Facebook or Twitter account.
|
Enabling swap
Started by marzib, Jul 12 2010 12:27 AM
202 replies to this topic
#1
Posted 12 July 2010 - 12:27 AM
How do you enable swap on CM6 for G1? Does a userinit.sh script work still? If that's the case, where does CM6 mount the ext partition? I don't see the sd-ext folder anymore...
#4
Posted 12 July 2010 - 09:26 AM
It may crawl, but without swap CM6 (just as CM5) gives me an iphone...
I did it the quick and dirty way: patch /etc/init.d/20userinit, adding at the beginning:
This re-activates my old userinit.sh activating the swap partition.
I don't understand why ext is not mounted by default in CM6. Maybe because they feal it's useless while ext app2sd is not finished...
I did it the quick and dirty way: patch /etc/init.d/20userinit, adding at the beginning:
mount -o remount,rw / mkdir -p /sd-ext mount /dev/block/mmcblk0p2 /sd-ext mount -o remount,ro /
This re-activates my old userinit.sh activating the swap partition.
I don't understand why ext is not mounted by default in CM6. Maybe because they feal it's useless while ext app2sd is not finished...
#5
Posted 12 July 2010 - 09:58 AM
#6
Posted 12 July 2010 - 01:54 PM
Made a Script "83swapon" and pushed it into /system/etc/init.d/
83swapon:
Doesn't start on boot!?
Anyone know why?
83swapon:
swapon /dev/block/mmcblk0p3; sysctl -w vm.swappiness=60;
Doesn't start on boot!?
Anyone know why?
#7
Posted 12 July 2010 - 02:30 PM
th2811, on 12 July 2010 - 01:54 PM, said:
Made a Script "83swapon" and pushed it into /system/etc/init.d/
83swapon:
Doesn't start on boot!?
Anyone know why?
83swapon:
swapon /dev/block/mmcblk0p3; sysctl -w vm.swappiness=60;
Doesn't start on boot!?
Anyone know why?
I'm guessing you didn't make it executable
adb shell chmod 700 /system/etc/init.d/83swapon
will do the trick
#8
Posted 12 July 2010 - 02:41 PM
Firerat, on 12 July 2010 - 02:30 PM, said:
I'm guessing you didn't make it executable
will do the trick
adb shell chmod 700 /system/etc/init.d/83swapon
will do the trick
THANK YOU VERY MUCH
EDIT:
Swap was running on first boot but after second reboot: swap 0
When I type
swapon /dev/block/mmcblk0p3;
sysctl -w vm.swappiness=60;
into terminal (after system is startet) swap is active, but not automatic on boot?
Permissions are right
also testet to put the line "echo 255 >/sys/class/leds/blue/brightness;" into the 83swapon-file and led is lighting but swap not active
#9
Posted 12 July 2010 - 03:22 PM
I guess we have similar issues: it seems the SD card takes some time to get detected at boot time.
Quote
--------- beginning of /dev/log/main
I/cm ( 65): Welcome to Android 2.2 / CyanogenMod-6.0.0-DS-RC1
I/cm ( 66): _
I/cm ( 67): __ __ _ ___ _ _ __ ___ __ _ _ _ _ __ __))
I/cm ( 68): ((_ \(/'((_( ((\( ((_)((_( (('((\( ((`1( ((_)((_(
I/cm ( 69): )) _))
I/cm ( 70):
I//system/xbin/run-parts( 60): mount: mounting /dev/block/mmcblk0p2 on /sd-ext failed: No such file or directory
I/DEBUG ( 91): debuggerd: Jul 10 2010 23:59:19
D/AKMD ( 98): akmd 1.6.6 START
D/AKMD ( 98): library version: 1.2.1.1129
--------- beginning of /dev/log/system
I/Vold ( 89): Vold 2.1 (the revenge) firing up
I/Netd ( 90): Netd 1.0 starting
D/Vold ( 89): Volume sdcard state changing -1 (Initializing) -> 0 (No-Media)
D/Vold ( 89): Volume sdcard state changing 0 (No-Media) -> 2 (Pending)
D/Vold ( 89): Volume sdcard state changing 2 (Pending) -> 1 (Idle-Unmounted)
I/cm ( 65): Welcome to Android 2.2 / CyanogenMod-6.0.0-DS-RC1
I/cm ( 66): _
I/cm ( 67): __ __ _ ___ _ _ __ ___ __ _ _ _ _ __ __))
I/cm ( 68): ((_ \(/'((_( ((\( ((_)((_( (('((\( ((`1( ((_)((_(
I/cm ( 69): )) _))
I/cm ( 70):
I//system/xbin/run-parts( 60): mount: mounting /dev/block/mmcblk0p2 on /sd-ext failed: No such file or directory
I/DEBUG ( 91): debuggerd: Jul 10 2010 23:59:19
D/AKMD ( 98): akmd 1.6.6 START
D/AKMD ( 98): library version: 1.2.1.1129
--------- beginning of /dev/log/system
I/Vold ( 89): Vold 2.1 (the revenge) firing up
I/Netd ( 90): Netd 1.0 starting
D/Vold ( 89): Volume sdcard state changing -1 (Initializing) -> 0 (No-Media)
D/Vold ( 89): Volume sdcard state changing 0 (No-Media) -> 2 (Pending)
D/Vold ( 89): Volume sdcard state changing 2 (Pending) -> 1 (Idle-Unmounted)
#11
Posted 12 July 2010 - 03:43 PM
Vilbrekin, on 12 July 2010 - 03:22 PM, said:
I guess we have similar issues: it seems the SD card takes some time to get detected at boot time.
th2811, on 12 July 2010 - 03:37 PM, said:
yes I also think this is the problem - any way to change this?
(i.e. executing the script later)
(i.e. executing the script later)
you are already running the script 'late'
add a shabang
#!/system/bin/sh
#12
Posted 12 July 2010 - 03:50 PM
Psycho13oy told me in IRC in different words to basically not expect a fix for this.
So basically that 20userinit script in init.d is absolutely useless as the ext part can't be mounted at boot for some reason.
So basically that 20userinit script in init.d is absolutely useless as the ext part can't be mounted at boot for some reason.
#13
Posted 12 July 2010 - 04:43 PM
Well, a simple retry loop with smal delay should do the trick, giving enough time to initialize the SD card reader.
#14
Posted 12 July 2010 - 05:10 PM
Firerat,
With all due respect -- and I respect the heck out of you -- I must disagree. I have an MT3G and swap is the only thing that makes life worth living (OK, not really
). But, it significantly improves performance from the moment I enable it. I've run it in 5.0.8 and now in 6.0.0. The market app particularly sucks without it. So, I think it's affect on system performance really depends on the hardware platform. As always, your actual mileage may vary...
Thanks,
Bob
With all due respect -- and I respect the heck out of you -- I must disagree. I have an MT3G and swap is the only thing that makes life worth living (OK, not really
Thanks,
Bob
#15
Posted 12 July 2010 - 07:56 PM
FYI, I've tried with the following script, which seems to do the trick:
if [ ! -d /sd-ext ]; then
mount -o remount,rw /
mkdir -p /sd-ext
mount -o remount,ro /
fi
PART=/dev/block/mmcblk0p2
for i in 1 2 3 4 5; do
if [ -e $PART ]; then
mount $PART /sd-ext
break
else
echo "$PART does not exist (yet); sleeping a bit..."
sleep 2
fi
done
#16
Posted 12 July 2010 - 08:27 PM
Swap is still very necessary on my 32B I find, without it the launcher has to do a complete reload every time you've gone into an app more complicated than settings which gets very very tiresome. A minimal amount of swap (24-32mb) makes the phone so much more responsive it's not funny. Essentially I go from
Home key > wait 5 seconds > hit apps button > wait 2 seconds > scroll and select app
to
Home key > wait 1-2 seconds > hit apps button > scroll and select app
The difference in usability is night and day.
Edit: I should add I use 3 homescreens and fairly minimal widgets, all I have is power control, calwidget, facebook and music.
Home key > wait 5 seconds > hit apps button > wait 2 seconds > scroll and select app
to
Home key > wait 1-2 seconds > hit apps button > scroll and select app
The difference in usability is night and day.
Edit: I should add I use 3 homescreens and fairly minimal widgets, all I have is power control, calwidget, facebook and music.
#17
Posted 13 July 2010 - 12:23 AM
i use the swapper app from market.. takes care of everything.. i get lazy.
#18
Posted 13 July 2010 - 03:07 AM
I gotta agree with Firerat here. I turned my swap on today just to check and it was miserable. I thought the swap was super cool and necessary, until on 5.0.8 my phone was running like crap, so I turned swap off and the phone was manageable again. Though, my sd card is only class 4, the decrease in performance and loading I saw today was so bad I doubt the class of the sd card had a whole lot to do with it. I have my swappiness set at 30 and a 64mb swap partition.
#19
Posted 13 July 2010 - 03:09 AM
Gotta disagree, phone doesn't multitask, adw doesn't stay in memory, browser doesn't persist state, after swap on swappiness 40 32mb swap, everything runs perfectly.
#20
Posted 13 July 2010 - 04:13 AM
Firerat would you mind explaining why Swap is bad for CM6? I am considering turning it on so my g1 would quit having to load the launcher everytime I leave it. and I currently have a 128mb swap that I made a while ago. should I use that or make another one of smaller size like a 32 or 64. Thx


















