This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: Portable Cygwin on a CD
- From: <fergus at bonhard dot uklinux dot net>
- To: <cygwin at cygwin dot com>
- Cc: <fergus at bonhard dot uklinux dot net>
- Date: Wed, 7 May 2003 23:38:49 +0100
- Subject: Re: Portable Cygwin on a CD
- Reply-to: <fergus at bonhard dot uklinux dot net>
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/