F2 swap

From FON Wiki Beta

Jump to: navigation, search
Changes and instructions described in this page are meant to be done by developers only. Applying these changes to your La Fonera might irremediably damage it. FON will not be held responsible for their consequences. Read instructions carefully!

Contents

Description

I managed to activate swap on lafonera. it uses every swap file made on any attached usbstick for example with

dd if=/dev/zero of=swap bs=1k count=21024
mkswap swap

here is how

  • edit the file /etc/opkg.conf and replace the first fine with this:
src snapshots http://ipkg.nslu2-linux.org/feeds/openwrt/fon-ng/mips/
opkg update; opkg install swap-utils libblkid libuuid
  • put this to /etc/init.d/swap
vi /etc/init.d/swap
#!/bin/sh /etc/rc.common
# Copyright (C) 2009 Peter Karoly "Stone" Juhasz
START=40
start() {
      [ -f /sbin/swapon ] && {
              echo "Activating swap..."
              find /tmp/mounts/ -follow -name swap -exec echo '  {}' \; -exec swapon{} \;
              }
        }
stop()  {
      [ -f /sbin/swapoff ] && {
              echo "Deactivating swap..."
              swapoff -a
              }
        }
  • after you saved the file, don't forget to
chmod +x /etc/init.d/swap
  • to start it just do
/etc/init.d/swap start
  • and to stop
/etc/init.d/swap stop


optional

  • if you want to you can install nano (it is in the new repo you just added), which I prefer over vi as the default editor
opkg install nano

Contributions

Personal tools