Adding swap, and adding a menu entry to activate it
January 12th, 2006
I followed the instructions given in this blog, and added a swap file on my removable card to try to improve the perfomance of the system.
All the following steps are done in the Nokia 770.
I created a script at /root/addswap with these contents:
#!/bin/sh
mkswap /media/mmc1/swap 24576
swapon /media/mmc1/swap
I am wondering if the often writings due to swapping can damage the removable card (indeed, I asked about that in the maemo-developers mailing list). So, I created also a script /root/delswap, with these contents:
#!/bin/sh
swapoff /media/mmc1/swap
I pretend to execute these scripts as a normal user, creating an entry in the menus. So, I added the scripts to the /etc/sudoers file. I added these lines:
user ALL = NOPASSWD: /root/addswap
user ALL = NOPASSWD: /root/delswap
Now, they can be executed as a non-root user using sudo. For example, sudo /root/addswap. Create two scripts /root/addswap_user and /root/delswap_user containing sudo /root/addswap and sudo /root/delswap. Give execution permissions (with chmod a+x script_name) to all the scripts.
Next step is to add the scripts to the main menu, to add or remove swap with a point and click.
Go to /var/lib/install/etc/others-menu/extra_applications, and create two files. First addswap.desktop containing
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=Add swap
Exec=/root/addswap_user
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable
and delswap.desktop containing
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=Remove swap
Exec=/root/delswap_user
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable
Now you have the opportunity of turning on and off the swap just clicking in the applications menu.
I made some tests. With these applications open, the perfomance was very good (take a look at the output of the free command).




1 Comment Add your own
1. Connecting geeks » &hellip | January 13th, 2006 at 3:26 am
[…] Maybe you want to know how to add the swap options, set up your bluetooth keyboard, or install the SSH server and set up an ad-hoc network between your computer and the Nokia 770. […]
Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>
Trackback this post | Subscribe to the comments via RSS Feed