| The Following User Says Thank You to elipsoid For This Useful Post: | ||
|
|
2010-10-19
, 22:06
|
|
Posts: 561 |
Thanked: 75 times |
Joined on Jan 2010
@ Spain
|
#82
|
|
|
2010-10-19
, 22:14
|
|
Posts: 561 |
Thanked: 75 times |
Joined on Jan 2010
@ Spain
|
#83
|
|
|
2010-10-20
, 13:35
|
|
Posts: 692 |
Thanked: 264 times |
Joined on Dec 2009
|
#84
|
start on started hildon-desktop
stop on starting shutdown
console none
service
script
drivelist=$(sfdisk -lnq /dev/mmcblk1)
swapmicro=$(echo "$drivelist" -n | grep swap | awk '/mmcblk1p2/ {print $1}')
if [ "$swapmicro" ]; then
swapon $swapmicro
swapoff /dev/mmcblk0p3
swapon /dev/mmcblk0p3
fi
end script
|
|
2010-10-20
, 16:03
|
|
Posts: 561 |
Thanked: 75 times |
Joined on Jan 2010
@ Spain
|
#85
|
testmicro = "/ dev/mmcblk1p2"
swapmicro = $ (echo "$ drivelist"-n | grep / dev/mmcblk1p2 | awk '/ mmcblk1p2 / {print $ 1}')
drivelist = $ (sfdisk -ln /dev/mmcblk1 | grep swap)
swapmicro = $ (echo "$ drivelist"-n | awk ' /mmcblk1p/ {print $ 1}')
if [ "$ testmicro" == "$ swapmicro" ]; then
swapon / dev/mmcblk1p2
swapoff / dev/mmcblk0p3
swapon / dev/mmcblk0p3
if [ $ swapmicro ]; then
swapon $ swapmicro
swapoff /dev/mmcblk0p3
swapon /dev/mmcblk0p3
| The Following User Says Thank You to WhiteWolf For This Useful Post: | ||
|
|
2010-10-20
, 16:22
|
|
Posts: 692 |
Thanked: 264 times |
Joined on Dec 2009
|
#86
|
|
|
2010-10-20
, 18:44
|
|
Posts: 561 |
Thanked: 75 times |
Joined on Jan 2010
@ Spain
|
#87
|
|
|
2010-10-20
, 19:27
|
|
Posts: 32 |
Thanked: 24 times |
Joined on Sep 2010
|
#88
|
|
|
2010-10-20
, 19:33
|
|
Posts: 561 |
Thanked: 75 times |
Joined on Jan 2010
@ Spain
|
#89
|
|
|
2010-10-20
, 19:35
|
|
Posts: 124 |
Thanked: 105 times |
Joined on Jul 2010
|
#90
|
As I am personally going to stick to running a script manually after a reboot, and following Whitewolfs lead using sfdisk, I have added the lines below to my tuning script to ensure the uSD swap is available before making any changes.
testmicro="/dev/mmcblk1p2" swapmicro=$(sfdisk -l /dev/mmcblk1 | grep /dev/mmcblk1p2 | awk '/mmcblk1p2/ {print $1}') if [ "$testmicro" == "$swapmicro" ]; then swapon /dev/mmcblk1p2 swapoff /dev/mmcblk0p3 swapon /dev/mmcblk0p3 else echo "Cannot find swap parition on uSD card, swap still on internal memory" fiI have tested this by running with no SD card, and it works; if mmcblk1p2 is not present it will make no swap changes.
I'd like to be able to get this added to the wiki page, as the current instructions only sets up the faster swap as secondary- and it will never get used considering the huge default primary swap. As I've said I'm kinda new to all this so I wouldn't dream of doing so unless somebody with some experience had a look at the above code and gave me some feedback.
Does it look safe enough to add to the wiki?