delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/05/07/08:35:00

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Authentication-Warning: localhost.localdomain: ronald owned process doing -bs
Date: Wed, 7 May 2003 13:56:40 +0200 (CEST)
From: Ronald Landheer-Cieslak <ronald AT landheer DOT com>
X-X-Sender: ronald AT localhost DOT localdomain
To: fergus AT bonhard DOT uklinux DOT net
cc: cygwin AT cygwin DOT com
Subject: Re: Portable Cygwin on a CD
In-Reply-To: <000901c313d5$e9f1b700$6fc82486@medschool.dundee.ac.uk>
Message-ID: <Pine.LNX.4.44.0305071220230.10125-100000@localhost.localdomain>
MIME-Version: 1.0

On Tue, 6 May 2003 fergus AT bonhard DOT uklinux DOT net wrote:

> 1. There was a suggestion that the CD might usefully start with a
> autorun.inf file. I feel a bit nervy about this. Two reasons: a. if the
> host machine has Cygwin available then I would be inclined first to
> investigate using that version, as the platform for any application I
> might be interested in running; b. and if the host machine may even be
> _running_ Cygwin at the time the CD is inserted, what would be the
> potential confusion arising from an autorun script which would be
> something like "\bin\rxvt -e /bin/bash --login -i" or whatever?
As Setup knows whether Cygwin is installed or not, the autorun program 
should find that out too (and possibly in the same way - this is all open 
source software, so you can just reap the source ;)

So: yes, it should check; no, it's not a show-stopper :)

> So the way I've got things set up at the moment is rather meagre on the
> automation. But it works (well, I think) as follows:
> 
> 2. If the host machine does not have Cygwin, then insert the CD and
> 
>     Start -> Run -> f:\bin\rxvt {switches}-e /bin/bash --login -i
>     mount -bfu f:/ /
>     {do stuff}
>     umount -A
>     ^D
> 
> 3. If the host machine does have Cygwin, then try starting it up, inserting
> the CD, and
> 
>     cd f:/usr/local/
>     {do stuff}
>     ^D
> 
> which might work well, or not ...
hmm.. as long as whatever you need from Cygwin (which is, of course, on 
the CD) is already installed on the system, it'll work. If not, if you 
ever try to run something in f:/usr/bin you'll run into (serious) trouble 
if the Cygwin versions are not the same..

> 4. In my case (and maybe others) this doesn't work at all well because
> when I attempt to {do stuff}, things are in the wrong place. So instead
> I start the host version of Cygwin with the intention of immediately
> (though temporarily) disabling it and utilising the CD-bound "local"
> resource as follows:
> 
>     Start the host version of Cygwin
>     mount -m > a:/mount.tmp # or somewhere convenient
>     umount -A
>     {insert the CD}
>     f:/bin/mount -bfu f:/ /
>     {do stuff}
>     umount -A
>     f:/bin/bash a:/mount.tmp # to recover the host setup
>     ^D
Very cool :)
Just a bit empty where automation is concerned (because you have to do it 
all yourself)..

> Personally I do not mind the explicit mount-ing and umount-ing, explicit
> references to the CD driveletter f:, etc. Actually the thought of
> irretrievably (or even retrievably) hosing the host Cygwin installation
> is frightening enough to make this explicit rather mechanical approach
> preferable to something automated, however elegant that approach would
> undeniably be.
And if you do the same thing in an automated fashion? What does mount -m 
say if there's no mount table?

As I see it, the steps to do are:
? is Cygwin running?
+ * bail out
* lock CD drive
? does a mount table exist?
+ * save it (or remember it)
\ * hose it
* install a new mount table
* run rxvt, bash or whatever
o ? is Cygwin still running
\ - * break loop
* hose the mount table
* restore the old mount table (if there was one)
* unlock the CD drive

But that would mean:
1. developing a way to make sure Cygwin is either running, or it isn't.
   Cygwin itself knows how to do this, so we can just reap it from there. 
   I think the easiest way to do this is to use Cygwin's shared memory 
   region - see if it's there.
2. develop a way to save & restore Cygwin's mount table
   this basically boils down to calling mount
3. developing a way to lock the CD drive
   kindly posted in this thread by Sam Edge, but will need some work for 
   Windows 9x

We don't really have to care whether Cygwin is installed or not: if it 
isn't running, we're not going to use it (and if it is running, we can't 
do much of anything). That way, at least you know for sure that the tools 
you have on the CD are all available, and you even know which version of 
Cygwin you'll be running (i.e. the one on the CD).

rlc





--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019