This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: setup changes my mounts


On Tue, 23 Mar 2004, Dave Korn wrote:

> > -----Original Message-----
> > From: cygwin-owner On Behalf Of Larry Hall
> > Sent: 23 March 2004 04:51
>
> > this isn't "fixable".  PTC ;-)  FWIW, I found the code for this in
> > do_install_thread() in install.cc.  The code reads:
> >
> >
> >   create_mount ("/", get_root_dir (), istext, issystem);
> >   create_mount ("/usr/bin", cygpath ("/bin"), istext, issystem);
> >   create_mount ("/usr/lib", cygpath ("/lib"), istext, issystem);
> >   set_cygdrive_flags (istext, issystem);
> >
> > The parameters for setting the mount type and the scope come
> > from settings in setup itself, not from any previous registry entries.
>
>   I disagree.  The setting for istext comes just a few lines above the part
> you quoted:
>
>   int istext = (root_text == IDC_ROOT_TEXT) ? 1 : 0;
>
> Now root_text is used in root.cc to set/get the state of the radio button on
> the "Select Root Install Directory" page.  grep suggests that root_text is
> initialised in mount.cc/read_mounts():
>
> void
> read_mounts ()
> {
> [...snip...]
>   /* Loop through subkeys */
> [...snip...]
>   for (int issystem = 0; issystem <= 1; issystem++)
>     {
>       snprintf (buf, sizeof(buf), "Software\\%s\\%s\\%s",
>                CYGWIN_INFO_CYGNUS_REGISTRY_NAME,
>                CYGWIN_INFO_CYGWIN_REGISTRY_NAME,
>                CYGWIN_INFO_CYGWIN_MOUNT_REGISTRY_NAME);
>
>       HKEY key = issystem ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
>       if (RegCreateKeyEx (key, buf, 0, (char *)"Cygwin", 0, KEY_ALL_ACCESS,
>                           0, &key, &disposition) != ERROR_SUCCESS)
>         break;
> [...snip...]
>           res = RegEnumKeyEx (key, i, aBuffer, &posix_path_size, NULL,
>                               NULL, NULL, NULL);
> [...snip...]
>               if (m->posix == "/")
>                 {
>                   root_here = m;
>                   if (m->istext)
>                     root_text = IDC_ROOT_TEXT;
>                   else
>                     root_text = IDC_ROOT_BINARY;
> [...snip...]
>
> and the code above quite clearly appears to be looking through the registry
> for the current mount state.
>
>   So it is actually the case that the settings DO come from the registry;
> the problem is that the setting for the root directory is indiscriminately
> applied to the root directory, the /usr/bin and /usr/lib mountpoints, and
> the cygdrive path.
>
>   I'm sure it makes sense to keep /usr/bin and /usr/lib in the same mode as
> the root dir, but I can't see any intrinsic reason why cygdrive should be
> forced to the same mode.  I dunno whether it would make more sense to offer
> separate radio buttons for the root dir mode and the cygdrive mode, or
> whether it should just preserve the existing cygdrive mode and only
> set/reset the /, /usr/bin and /usr/lib modes.
>     cheers,
>       DaveK

The latter, IMO.  I'll see if I can whip up a patch...  Won't be right
away, though...
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]