delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/03/23/06:46:16

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
From: "Dave Korn" <dk AT artimi DOT com>
To: "'Cygwin List'" <cygwin AT cygwin DOT com>
Subject: RE: setup changes my mounts
Date: Tue, 23 Mar 2004 11:44:42 -0000
MIME-Version: 1.0
In-Reply-To: <6.0.1.1.0.20040322234109.03c16580@127.0.0.1>
Message-ID: <NUTMEGIKzYp4HKEUe6c000001f4@NUTMEG.CAM.ARTIMI.COM>
X-OriginalArrivalTime: 23 Mar 2004 11:44:42.0093 (UTC) FILETIME=[3AE8E1D0:01C410CC]

> -----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
-- 
Can't think of a witty .sigline today....



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