* Pushing out Cygwin installations
@ 2001-01-11 9:01 Danko, Gary
2001-01-11 9:15 ` Christopher Faylor
2001-01-11 9:19 ` Pushing out Cygwin installations Larry Hall (RFK Partners, Inc)
0 siblings, 2 replies; 5+ messages in thread
From: Danko, Gary @ 2001-01-11 9:01 UTC (permalink / raw)
To: 'cygwin@cygwin.com'
I couldn't find this anywhere in the archives. I want to install Cygwin once
and push it out to about 150 indentical servers. I tried copying the
directory as well as the registry key to another server but that failed to
give me the desired results.
The NEW installation couldn't find "root" so that made me curious. Where
does Cygwin store the information about the location of root?
If I install Cygwin on one machine.. How could I copy that installation
reliably to another machine?
Thanks
Gary
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Pushing out Cygwin installations
2001-01-11 9:01 Pushing out Cygwin installations Danko, Gary
@ 2001-01-11 9:15 ` Christopher Faylor
2001-01-11 10:55 ` Rebuild mount table (was: Re: Pushing out Cygwin installations) Ehud Karni
2001-01-11 12:02 ` Rebuild mount table - minor fix Ehud Karni
2001-01-11 9:19 ` Pushing out Cygwin installations Larry Hall (RFK Partners, Inc)
1 sibling, 2 replies; 5+ messages in thread
From: Christopher Faylor @ 2001-01-11 9:15 UTC (permalink / raw)
To: 'cygwin@cygwin.com'; +Cc: gary.danko
On Thu, Jan 11, 2001 at 12:01:28PM -0500, Danko, Gary wrote:
>I couldn't find this anywhere in the archives. I want to install Cygwin once
>and push it out to about 150 indentical servers. I tried copying the
>directory as well as the registry key to another server but that failed to
>give me the desired results.
>
>The NEW installation couldn't find "root" so that made me curious. Where
>does Cygwin store the information about the location of root?
>
>If I install Cygwin on one machine.. How could I copy that installation
>reliably to another machine?
The mount table is stored in the registry. You must not have copied
it correctly.
However, you really should just use "mount" to duplicate the directory
structure on the other machines. Copying the registry keys bypasses
Cygwin and we make no guarantees that the registry keys will remain
the same between releases.
We do, of course, try to ensure that "mount" and "umount" continue
to work as expected.
cgf
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 5+ messages in thread
* Rebuild mount table (was: Re: Pushing out Cygwin installations)
2001-01-11 9:15 ` Christopher Faylor
@ 2001-01-11 10:55 ` Ehud Karni
2001-01-11 12:02 ` Rebuild mount table - minor fix Ehud Karni
1 sibling, 0 replies; 5+ messages in thread
From: Ehud Karni @ 2001-01-11 10:55 UTC (permalink / raw)
To: cygwin
On Thu, 11 Jan 2001 12:14:55 -0500, Christopher Faylor <cgf@redhat.com> wrote:
>
> On Thu, Jan 11, 2001 at 12:01:28PM -0500, Danko, Gary wrote:
> >
> >The NEW installation couldn't find "root" so that made me curious. Where
> >does Cygwin store the information about the location of root?
> >
> >If I install Cygwin on one machine.. How could I copy that installation
> >reliably to another machine?
>
> The mount table is stored in the registry. You must not have copied
> it correctly.
>
> However, you really should just use "mount" to duplicate the directory
> structure on the other machines. Copying the registry keys bypasses
> Cygwin and we make no guarantees that the registry keys will remain
> the same between releases.
Here is a bash script I wrote to save the mount table and rebuild it.
It has 2+ known drawbacks:
1) It can not handle paths with spaces (Windows or Cygwin).
2) It does not create missing mount points.
2+) The order of the mounts is the one of the current mount, so
internal mount may precede external one (e.g. /foo/bar may be
mounted before /foo). I think it will work on Cygwin (because
mount on non-existing directories is permitted).
I will value comments and suggestions for improvements.
Ehud.
------------------------- mount-export.sh --------------------------
#! /bin/sh -ex
# Export the current mount into a script to rebuild it
# the script is written into $1 (stdout if none/empty)
# ----------------------------------------------------
dcd_ln () # decode 1 mount line
{ # given as argument
WINP=`echo $1 | cut "-d " -f1` # prefix name
MNTP=`echo $1 | cut "-d " -f2` # prefix name
U_S=`echo $1 | cut "-d " -f3` # user / system
BTX=`echo $1 | cut "-d " -f4` # binmode / textmode , exec
FLAGS="-f"
case "$U_S" in
"user" ) U_S=u ;; # user mount
"system" ) U_S=s ;; # user mount
* ) echo "Error, type is $U_S, should be user/system !"
exit 1 ;; # grave error
esac
FLAGS="${FLAGS}u" # user mount
case "$BTX" in
*"exec" ) FLAGS="${FLAGS}x" ;; # mounted with exec[ute]
esac
case "$BTX" in
"bin"* ) BTX=b ;; # mounted in binary mode
"text"* ) BTX=t ;; # mounted in text mode
* ) echo "Error, flags are $BTX, should be binmode/textmode !"
exit 1 ;; # grave error
esac
FLAGS="$FLAGS$U_S$BTX" # flags for mount
}
# ----------------------------------------------------------------------
add_mounts () # work on current mounts
{ # (output of mount command)
read MLN # ignore 1st line
read MLN # next line
while [ "$MLN" != "" ] # stop on extra empty line
do
dcd_ln "$MLN" # break into components
echo "mount $FLAGS $WINP $MNTP" # write mount command
read MLN # next line
done
}
# ----------------------------------------------------------------------
if [ "$1" != "" ] ; then
exec 1>"$1" # change stdout to $1
fi
echo "#! /bin/sh -ex
# Rebuild the mount table, Original configuration from:"
HST=`hostname`
date -u "+# $HST at %Y-%m-%d %H:%M"
echo "# ----------------------------------------------------
# 1st remove all currently mount points & prefixes
umount --remove-all-mounts
umount --remove-cygdrive-prefix
# 2nd set Cygwin drive prefix" # end of echo !
PRFXLN=`mount --show-cygdrive-prefixes | tail -1`
dcd_ln "dummy $PRFXLN" # decode prefix
case "$BTX$U_S" in # special flags for prefix
"bs" ) FLAGS="-bs" ;; # -bs
"bu" ) FLAGS="-b" ;; # -b
"ts" ) FLAGS="-s" ;; # -s
* ) FLAGS="" ;; # none (tu)
esac
echo "mount $FLAGS --change-cygdrive-prefix $MNTP"
echo -e "\n# restore mounts, one by one\n"
( mount ; echo ) | add_mounts # write all mounts
echo "
############################## end of re-mount #############################"
############################## mount-export.sh ##############################
--
@@@@@@ @@@ @@@@@@ @ @ Ehud Karni Simon & Wiesel Insurance agency
@ @ @ @@ @ Tel: +972-3-6212-757 Fax: +972-3-6292-544
@ @ @ @ @ @@ (USA) Fax and voice mail: 1-815-5509341
@ @ @ @ @ @ Better Safe Than Sorry
http://www.simonwiesel.co.il mailto:ehud@unix.simonwiesel.co.il
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 5+ messages in thread
* Rebuild mount table - minor fix
2001-01-11 9:15 ` Christopher Faylor
2001-01-11 10:55 ` Rebuild mount table (was: Re: Pushing out Cygwin installations) Ehud Karni
@ 2001-01-11 12:02 ` Ehud Karni
1 sibling, 0 replies; 5+ messages in thread
From: Ehud Karni @ 2001-01-11 12:02 UTC (permalink / raw)
To: cygwin
I'm sorry, but there was an error in the script I just posted.
(a leftover line that add extra u to the mount flags).
Seeing an email by cgf I enhanced my script to quote the Paths.
The script takes some times, so I added echos to stderr.
So here is the new script:
------------------------- mount-export.sh -------------------------
#! /bin/sh -e
# Export the current mount into a script to rebuild it
# the script is written into $1 (stdout if none/empty)
# ----------------------------------------------------
quote () # quote stdin to stdout
{ # change \ to \\, " to \"
sed -e "s/\\\\/\\\\\\\\/g" \
-e "s/\\\"/\\\\\\\"/g" \
-e "s/\`/\\\\\\\`/g" # re-escape \, ", ' and `
}
# ----------------------------------------------------------------------
dcd_ln () # decode 1 mount line
{ # given as argument
WINP=`echo $1 | cut "-d " -f1 | quote` # Windows Path (unquoted)
MNTP=`echo $1 | cut "-d " -f2 | quote` # Cygwin mount point
U_S=`echo $1 | cut "-d " -f3` # user / system
BTX=`echo $1 | cut "-d " -f4` # binmode / textmode , exec
FLAGS="-f"
case "$U_S" in
"user" ) U_S=u ;; # user mount
"system" ) U_S=s ;; # user mount
* ) echo "Error, type is $U_S, should be user/system !"
exit 1 ;; # grave error
esac
case "$BTX" in
*"exec" ) FLAGS="${FLAGS}x" ;; # mounted with exec[ute]
esac
case "$BTX" in
"bin"* ) BTX=b ;; # mounted in binary mode
"text"* ) BTX=t ;; # mounted in text mode
* ) echo "Error, flags are $BTX, should be binmode/textmode !"
exit 1 ;; # grave error
esac
FLAGS="$FLAGS$U_S$BTX" # flags for mount
}
# ----------------------------------------------------------------------
add_mounts () # work on current mounts
{ # (output of mount command)
read MLN # ignore 1st line
read MLN # next line
while [ "$MLN" != "" ] # stop on extra empty line
do
dcd_ln "$MLN" # break into components
echo "mount $FLAGS \"$WINP\" \"$MNTP\""
# write mount quoted command
echo "Mount \"$WINP\" on \"$MNTP\" processed" >&2
read MLN # next line
done
}
# ----------------------------------------------------------------------
if [ "$1" != "" ] ; then
exec 1>"$1"
fi
echo "#! /bin/sh -ex
# Rebuild the mount table, Original configuration from:"
HST=`hostname`
date -u "+# $HST at %Y-%m-%d %H:%M"
echo "# ----------------------------------------------------
# 1st remove all currently mount points & prefixes
umount --remove-all-mounts
umount --remove-cygdrive-prefix
# 2nd set Cygwin drive prefix"
PRFXLN=`mount --show-cygdrive-prefixes | tail -1`
dcd_ln "dummy $PRFXLN" # decode prefix
case "$BTX$U_S" in # special flags for prefix
"bs" ) FLAGS="-bs" ;; # -bs
"bu" ) FLAGS="-b" ;; # -b
"ts" ) FLAGS="-s" ;; # -s
* ) FLAGS="" ;; # none (tu)
esac
echo "mount $FLAGS --change-cygdrive-prefix \"$MNTP\""
echo "Prefix is \"$MNTP\" defined" >&2
echo -e "\n# restore mounts, one by one\n"
( mount ; echo ) | add_mounts # write all mounts
echo "
############################## end of re-mount #############################"
############################## mount-export.sh ##############################
--
@@@@@@ @@@ @@@@@@ @ @ Ehud Karni Simon & Wiesel Insurance agency
@ @ @ @@ @ Tel: +972-3-6212-757 Fax: +972-3-6292-544
@ @ @ @ @ @@ (USA) Fax and voice mail: 1-815-5509341
@ @ @ @ @ @ Better Safe Than Sorry
http://www.simonwiesel.co.il mailto:ehud@unix.simonwiesel.co.il
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Pushing out Cygwin installations
2001-01-11 9:01 Pushing out Cygwin installations Danko, Gary
2001-01-11 9:15 ` Christopher Faylor
@ 2001-01-11 9:19 ` Larry Hall (RFK Partners, Inc)
1 sibling, 0 replies; 5+ messages in thread
From: Larry Hall (RFK Partners, Inc) @ 2001-01-11 9:19 UTC (permalink / raw)
To: Danko, Gary, 'cygwin@cygwin.com'
At 12:01 PM 1/11/2001, Danko, Gary wrote:
>I couldn't find this anywhere in the archives. I want to install Cygwin once
>and push it out to about 150 indentical servers. I tried copying the
>directory as well as the registry key to another server but that failed to
>give me the desired results.
>
>The NEW installation couldn't find "root" so that made me curious. Where
>does Cygwin store the information about the location of root?
>
>If I install Cygwin on one machine.. How could I copy that installation
>reliably to another machine?
>
>Thanks
>Gary
The output of "mount" will tell you where the machine that you moved stuff
to thinks the root is. If you've moved the registry keys correctly and if
they make sense for the new machine, there shouldn't be any problem
theoretically. Still, I haven't tried this myself so there may be other
issues in practice.
Larry Hall lhall@rfk.com
RFK Partners, Inc. http://www.rfk.com
118 Washington Street (508) 893-9779 - RFK Office
Holliston, MA 01746 (508) 893-9889 - FAX
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2001-01-11 12:02 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-11 9:01 Pushing out Cygwin installations Danko, Gary
2001-01-11 9:15 ` Christopher Faylor
2001-01-11 10:55 ` Rebuild mount table (was: Re: Pushing out Cygwin installations) Ehud Karni
2001-01-11 12:02 ` Rebuild mount table - minor fix Ehud Karni
2001-01-11 9:19 ` Pushing out Cygwin installations Larry Hall (RFK Partners, Inc)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).