I have a PC104 board running Linux (Debian sarge) from a CF card. Naturally this is set up so that Linux mounts the card using a read only file system with a ram drive to manage tmp, var, etc... At boot time I want to give the user a chance to mount the file system read/write and kill off the ram drive if they so choose. So I pass a variable to the kernel at boot time 'ROOT_READ_WRITE=1' that gets set as an environment variable that an init.tab script can pick up on. This script in turn creates the ramdisk and symlinks fstab to either a read only or read/write version of fstab.
This works great, except that I am forced to maintain two fstab files (one read only, one read/write) and substitute the appropriate one in at boot time. This is a pain from a maintenance standpoint and I would much prefer to implement a conditional inside of fstab (if [ $ROOT_READ_WRITE eq 1 ]; then...) but it does not seem to work. Is there a more elegant solution to handle this?
Thanks in advance, David Tucker