Detecting Swap Partition

If it does not fit any where else, then post it here.
SPAM is not allowed, here or any other forums

Postby tikbalang » Fri Nov 28, 2008 7:41 am

hello everyone!

i have not used freesco in a while and i'm glad it's still alive and active. i'm trying to modify a minilinux bootcd to add swap detection and activation in its /etc/rc.d/rc.S file. it only has busybox and its fstab is almost bare (i will need to specify partition to swapon):

/etc/fstab
Code: Select all

none  /proc  proc   defaults   0   0



here is the portion of the rc.S that detects the fat32 partition:

Code: Select all
if [ $DISK -eq 2 ]; then
   /bin/echo "Searching for Hard Disk..." > $CONSOLE 2>&1
   DEVICE="hda1 hda2 hda3 hda4 hda5 hda6 hda7 hda8 hda9 hda10 hdb1 hdb2 hdb3 hdb4 hdb5 hdb6 hdb7 hdb8 hdb9 hdb10 hdc1 hdc2 hdc3 hdc4 hdc5 hdc6 hdc7 hdc8 hdc9 hdc10 hdd1 hdd2 hdd3 hdd4 hdd5 hdd6 hdd7 hdd8 hdd9 hdd10"
   # Scan the devices
   for DEV in $DEVICE; do
  if [ -e /dev/$DEV ]; then
     /bin/echo "Checking $DEV..." > $CONSOLE 2>&1
     # You must specify the FS type if the /proc filesystem is not available
     if /bin/mount -t vfat -o sync /dev/$DEV $MNT >/dev/null 2>/dev/null; then
    if [ -e $MNT/$ID ]; then
       FOUND=1
       break
    else
       umount $MNT
    fi
     fi
  fi
   done
fi


i'd like to modify that section to add swap detection. kindly point me in the right direction if freesco doesn't do this. thanks.
User avatar
tikbalang
Newbie
 
Posts: 3
Joined: Wed Jun 18, 2003 3:25 pm

Postby Lightning » Mon Dec 15, 2008 8:39 pm

Unfortunately FREESCO has absolutely no auto detect of partitions or swap space, so we are not going to really be of much help on your script.
If you are afraid that you might make a mistake. The chances are high that you will never learn anything.
User avatar
Lightning
FREESCO GOD !!
 
Posts: 12079
Joined: Wed Nov 14, 2001 6:50 am
Location: Oregon, USA


Return to Other Discussions

Who is online

Users browsing this forum: No registered users and 1 guest

cron