Portable Cygwin on a CD
fergus@bonhard.uklinux.net
fergus@bonhard.uklinux.net
Wed May 7 22:38:00 GMT 2003
Earlier I said I was a bit nervy about automating too much of this. But I
think the following bat-file "cygmin.bat" works well to record any existing
mount points on the host machine, start up a portable process, and then
recover the host mount points after the portable process is closed.
%1\bin\mount -m | %1\bin\sed s/mount/"%1\\/bin\\/mount"/ > %2
%1\bin\umount -A
%1\bin\mount -bfu %1/ /
%1\bin\rxvt -e /bin/bash --login -i
%1\bin\umount -A
%1\bin\bash %2
The whole thing can be driven by [say]
Start -> Run -> cygmin e: c:\tmp\mount.log
or
Start -> Run -> cygmin g: a:\mnt.sh
or whatever: %1 is the host CD driveletter and %2 is the name and location
of the temporary file where you save the host mount points for later
recovery.
Fergus
PS. I guess it would be neater to name it cygmin.sh and run it as [something
like]
Start -> Run -> e:\bin\bash cygmin.sh e: c:/tmp/mount.log
but I don't quite know how %1 %2 works in a shell script; probably some \
would need to be / and v-v.
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
More information about the Cygwin
mailing list