Kernel nie gra roli. Jeśli chcesz to załatwić skryptem to rom musi obsługiwać init.dTak wygląda przykładowy skrypt do aktywacji swap (wyciągnięty z mojego starego hd2)
#!/system/bin/sh#----------------------------------------------------------------------# Hard Swap activation by Yank555.lu v1.2 for SGS3#----------------------------------------------------------------------# XDA thread : http://forum.xda-developers.com/showthread.php?t=1814311 #----------------------------------------------------------------------# Removed busybox predefined location (/system/xbin)#----------------------------------------------------------------------logfile_location="/data"sdcard_device="/dev/block/mmcblk0"swap_partition=`fdisk -l $sdcard_device | grep swap | awk '{print $1;}'`swappiness=60sdcard_wait=30activate_swap () { echo "------- SD-card partition table ------" >>$logfile_location/swap.0.log; fdisk -l $sdcard_device >>$logfile_location/swap.0.log; echo "------- before activating swap -------" >>$logfile_location/swap.0.log; free >>$logfile_location/swap.0.log; echo "--------------------------------------" >>$logfile_location/swap.0.log; cat /proc/swaps >>$logfile_location/swap.0.log; echo "-------- activating swap now ---------" >>$logfile_location/swap.0.log; echo " - swapon $swap_partition" >>$logfile_location/swap.0.log; swapon $swap_partition >>$logfile_location/swap.0.log; echo " - setting swappiness to $swappiness" >>$logfile_location/swap.0.log; echo $swappiness > /proc/sys/vm/swappiness; echo "------- after activating swap --------" >>$logfile_location/swap.0.log; free >>$logfile_location/swap.0.log; echo "--------------------------------------" >>$logfile_location/swap.0.log; cat /proc/swaps >>$logfile_location/swap.0.log; echo "--------------------------------------" >>$logfile_location/swap.0.log;}# Cycle Log filesrm $logfile_location/swap.4.log;mv $logfile_location/swap.3.log $logfile_location/swap.4.log;mv $logfile_location/swap.2.log $logfile_location/swap.3.log;mv $logfile_location/swap.1.log $logfile_location/swap.2.log;mv $logfile_location/swap.0.log $logfile_location/swap.1.log;# Try to use swap partitionif [ "$swap_partition" != "" ]; # Check if a swap partition could be found then echo "SD-card swap partition has been found ... good !" >>$logfile_location/swap.0.log; if [ -e $swap_partition ]; # Check if swap partition device exists then echo "SD-card swap partition device is present as well ... excellent !" >>$logfile_location/swap.0.log; activate_swap; else echo "SD-card swap partition device not present yet ... waiting another $sdcard_wait seconds for SD-card to become ready ..." >>$logfile_location/swap.0.log; sleep $sdcard_wait; # SD-card swap partition found, but no swap partition device yet, wait for slow card if [ -e $swap_partition ]; then echo "SD-card swap partition device is present now ... eventually !" >>$logfile_location/swap.0.log; activate_swap; else echo "... still no swap partition device available after $sdcard_wait seconds, quitting ... sorry no swap for you, I'm afraid !" >>$logfile_location/swap.0.log; echo " " >>$logfile_location/swap.0.log; echo "------- SD-card partition table ------" >>$logfile_location/swap.0.log; fdisk -l $sdcard_device >>$logfile_location/swap.0.log; echo " - setting swappiness to $swappiness" >>$logfile_location/swap.0.log; cat /proc/sys/vm/swappiness; >>$logfile_location/swap.0.log; fi; fi; else echo "No SD-card swap partition has been found, quitting ... sorry no swap for you, I'm afraid !" >>$logfile_location/swap.0.log; echo " " >>$logfile_location/swap.0.log; echo "------- SD-card partition table ------" >>$logfile_location/swap.0.log; fdisk -l $sdcard_device >>$logfile_location/swap.0.log; echo "----------- swappiness ---------------" >>$logfile_location/swap.0.log; cat /proc/sys/vm/swappiness; >>$logfile_location/swap.0.log;fi;
Oczywiście potrzebna jest Partycja swap na karcie sd. Oczywiście to tylko przykład bo choćby układ partycji jest inny ale tak to mniej więcej wygląda. Ew można próbować programów do swap ale skrypt jest wygodniejszy bo wygrywasz go raz i zapominasz.