OESF Portables Forum

Model Specific Forums => Sharp Zaurus => Zaurus - pdaXrom => Topic started by: dinorex on June 29, 2006, 07:24:13 am

Title: Auto Swap Partition Attachment In 1.1.0 Beta 4
Post by: dinorex on June 29, 2006, 07:24:13 am
initially i have posted in hk www.pumb.org forum for this stuff, but i think that's worthy of mentioning here... so i cross post here as well...

you can re-format  to the SD / CF in c1k (/dev/mmcblk0  | /dev/hda1) or MD in c3k or above (/dev/hda1 - 3), however, for the sake of housekeeping the original SHARP ROM / cacko configuration, you'd better keep the partition table of MD in c3k or above in hda1 - 2 respectively.

you can make use of fdisk /dev/mmcblk0 or fdisk /dev/hda to give the following partition table: -
Code: [Select]
in c1k,

/dev/mmcblk0p1  --> Linux (swap partition) --> suggest to use 128M as the basis....
/dev/mmcblk0p2  --> data (ext3 format)

in c3k or above,

/dev/hda1  --> leave it as is
/dev/hda2  --> leave it as is
/dev/hda3  --> Linux (swap partition) --> suggest to use 128M as the basis....
/dev/hda4  --> data (ext3 format)

format this swap partiton:-
Code: [Select]
in c1k,

mkswap /dev/mmcblk0p1

in c3k or above,

mkswap /dev/hda3

format the data partiton:-
Code: [Select]
in c1k,
echo y | mke2fs /dev/mmcblk0p2

in c3k or above,
echo y | mke2fs /dev/hda4

add the following line in /etc/fstab: -
Code: [Select]
in c1k,
/dev/mmcblk0p1    swap    swap    defaults   0  0

in c3k or above,
/dev/hda3    swap    swap    defaults   0  0

modify /etc/rc.d/rc.sysinit: -
Code: [Select]
from this segment: -
for dev in `/sbin/fdisk -l | grep 'Linux Swap' | cut -d '  ' -f 1`; do
 Â    action "Found swap on $dev, turn it on:" /sbin/swapon $dev
 Â    break
done

to change to the following line: -
#for dev in `/sbin/fdisk -l | grep 'Linux Swap' | cut -d '  ' -f 1`; do
#    action "Found swap on $dev, turn it on:" /sbin/swapon $dev
#     break
#done
action "Found swap, turn it on:" /sbin/swapon -a

(you can # comment these 4 lines, or # comment the 3 lines, and modify the line with  'action' at the end with the text in double quotation marks or whatsoever... )

the reason of changing as that in rc.sysinit, is so simple: you can take a look on the output to fdisk -l...

since the partition listing in fdisk -l has no recognition to "Linux Swap" type, the only way you can make use of auto-mounting is to make use of the /etc/fstab entries coming with the 'swapon -a' command in the sysinit stage... or rc.rofilesys stage which is not recommended here....

for closing the swap partition , you can make use of swapoff -a to perform mandatory closure.

after this patch, during your pdaxrom booting, your dmesg will see this statement: "Found swap, turn it on.....   [OK] " -- that means you are successfully made....  

for double checking, you can make use of free command, or meanie's recommended cat /proc/swaps command....


for another possible work-around dealing with /etc/rc.d/rc.rofilesys, personally i don't suggest to do so as the result may NOT be so positive....  
Title: Auto Swap Partition Attachment In 1.1.0 Beta 4
Post by: ZDevil on June 29, 2006, 08:53:21 am
Hey, that's cool!    
So in other words:
We gotta reformat and repartition the cards or MD,
then add a few lines in fstab and rc.sysinit to force boot with swapon.
So would it be the reason why ppl fail to boot with auto swapon in the past (only changed fstab but not rc.sysinit)?
Just one quick question: must the card be formatted in ext3?
(Cross post too. Hehe...)
Title: Auto Swap Partition Attachment In 1.1.0 Beta 4
Post by: dinorex on June 29, 2006, 11:16:05 am
Quote
Hey, that's cool!    
So in other words:
We gotta reformat and repartition the cards or MD,
then add a few lines in fstab and rc.sysinit to force boot with swapon.
So would it be the reason why ppl fail to boot with auto swapon in the past (only changed fstab but not rc.sysinit)?
Just one quick question: must the card be formatted in ext3?
(Cross post too. Hehe...)
[div align=\"right\"][a href=\"index.php?act=findpost&pid=133306\"][{POST_SNAPBACK}][/a][/div]

actually i 've tried many combinations (like under /dev/mmcblk0p1 , part another /dev/mmcblk0p1p1 /dev/mmcblk01p1p2 and so on in order to keep the vfat partition unchanged...)

however, on reboot, the /dev/mmcblk0p1p? cannot re-exist upon inserting the sd card again...

therefore, for this sake, and the speed issue, i recommend to totally re-format that to be ext3 (in primary partition) in order to play that right away... (but may be risk of non-reversing to original SHARP / Cacko stuff .......     )
Title: Auto Swap Partition Attachment In 1.1.0 Beta 4
Post by: dinorex on June 29, 2006, 01:30:55 pm
really work out now...

no need to modify /etc/rc.d/rc.sysinit....

just use the fdisk /dev/mmcblk0 (for c1k) and fdisk /dev/hda (for c3k or above), modify the /dev/mmcblk0p1  or /dev/hda3 partition's system id (command t) as type '82' (Linux swap / Solaris), the original rc.sysinit can be run swiftly....