Thread: iLiad SWAP on iLiad
View Single Post
Old 11-09-2007, 10:11 AM   #3
tirsales
MIA ... but returning som
tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.tirsales ought to be getting tired of karma fortunes by now.
 
tirsales's Avatar
 
Posts: 1,600
Karma: 511342
Join Date: Nov 2007
Location: Germany
Device: PRS-505 and *Really* not owning a PRS-700
Quote:
Originally Posted by wallcraft
I would be concerned about adding swap on a CF card, because these don't always mount at boot time.
I agree, this clearly speaks for MMC.

Quote:
Originally Posted by wallcraft
In any case, the addition of card-based swap would need to allow for the possibility that the card was missing at boot time.
This is why I proposed a script that tests for the existance of a swap-partition.
For MMC this could be changed to :

* Test if MMC-Card present
* Mount MMC-Card (alternativ: test if already mounted)
* Test if SWAP-File present (fairly easy)
* activate SWAP.

run at boot-time or after inserting the card - Linux is fairly easy on adding or removing swap.

--edit:

Creating the swap-file:

'dd if=/dev/zero of=[path to mmc-card]/swpfile bs=1M count=[größe des swapfiles in MB]'
'mkswap [path to mmc-card]/swpfile'

Example:

dd if=/dev/zero of=/media/mmc/swpfile bs=1M count=256
mkswap /media/mmc/swpfile

(erzeugt ein 256MB Swapfile)

Shellskript (assuming that MMC-cards are mounted at boot-time and that the command 'swapon' is available.)

#! /bin/bash
mmcFolder = [Pfad zu MMC auf iLiad]
swapActivated = 0
if ( -e $mmcFolder/swpfile ) ; then
swapon $mmcFolder/swpfile && swapActivated = 1
fi
if ( $swapActivated -gt 0 ) ; then
echo "Jipii! We have swap!"
free
else
echo "Baah, no swapping for you!"
fi

---

The last 'if' could be used for a more sofisticated error-handling, but it should do as an example.

If someone would be willing to test it, I could try to compile the swap-utils and the appropriate kernel - with absolutely NO WARRANTY that it won't brick your system as it would be completely untested.
On the other hand it should be fairly easy to implement yourself.

-- edit 2:
https://www.mobileread.com/forums/sho...ghlight=swapon
mentions, that Adam B. has ported a busybox-variant with swapon / swapoff. Thus only the kernel is missing.

Or am I just being stupid and writing stuff everybody knows?

-- edit 3:

Seems I really am stupid - and much to used to kernel 2.6 .. IIRC the option to "disallow" swapping has been added to the kernel-config in kernelfamily 2.6, 2.4 doesn't have this option ... So: Swapping should already be possible. If not it is more difficult.
Anybody willing to try if swap is working? Or perhaps has already done so?

Last edited by tirsales; 11-09-2007 at 11:40 AM. Reason: Adding stuff, spelling
tirsales is offline   Reply With Quote