PDA

Bekijk de volledige versie : Free ramfs for external USB rootfs?



denny
23-06-2004, 08:28
Hi,

I have upgraded the firmware to 1.7.5.9-2,
and plugged an USB drive as root filesystem.
It works fine and I am wondering if we can free the memory
used by ramfs to run more or larger applications.
Since I have remount the USB drive as R/W,
is the ramfs still necessary? How to do that?

By the way, If I'd like to remount root automatically after boot,
which init script should I modify?
Thanks in advance.

erik_bies
26-06-2004, 04:40
Although written for older firm.. this might help you
http://wl500g.info/showthread.php?t=359

denny
26-06-2004, 14:59
Although written for older firm.. this might help you
http://wl500g.info/showthread.php?t=359

Thanks for your info.
Actually, my wl500g can successfully boot without
using ramfs. I modified the /init/boot script to achieve
that:

1. remove the symlink /etc, /tmp, /var, and /usr/local.
create real directories
2. don't mount ramfs, but remount USB FS with writable:
mount -o remount,rw,noatime /dev/scsi/host0/bus0/target0/lun0/part1 /
#mount -t ramfs ramfs /mnt/ramfs
3. change the way to initialize these directories:

cp -dpR /ramfs/etc/* /etc
#cp -dpR /ramfs/etc /mnt/ramfs
cp -dpR /ramfs/var/* /var
#cp -dpR /ramfs/var /mnt/ramfs

rm -Rf /tmp/*
#mkdir /mnt/ramfs/tmp
#mkdir /mnt/ramfs/local

I don't know if it is necessary to cp files from /ramfs/etc and /ramfs/var. From /proc/meminfo, I got at least 2MB+
memory without using ramfs.

jcw
27-06-2004, 22:53
cp -dpR /ramfs/etc/* /etc
#cp -dpR /ramfs/etc /mnt/ramfs
cp -dpR /ramfs/var/* /var
#cp -dpR /ramfs/var /mnt/ramfs

rm -Rf /tmp/*
#mkdir /mnt/ramfs/tmp
#mkdir /mnt/ramfs/local

I don't know if it is necessary to cp files from /ramfs/etc and /ramfs/var. From /proc/meminfo, I got at least 2MB+
memory without using ramfs.

You can avoid the copying altogether by moving etc and var:

rm /etc /var
mv /ramfs/etc /ramfs/var /
rmdir ramfs
Needs only be done once. Careful with changing the system while running, I did the above on a separate Linux box.