public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
* Rebase Status
@ 2002-01-26  4:08 Jason Tishler
  0 siblings, 0 replies; only message in thread
From: Jason Tishler @ 2002-01-26  4:08 UTC (permalink / raw)
  To: Cygwin-Apps

[-- Attachment #1: Type: text/plain, Size: 2107 bytes --]

Since I'm around half way done, I decided to post a status report to let
people know that I'm still working on this...

I have implemented the following:

    main ()
    {
      for dll in dlls
        rebase (dll)
    }
  
    rebase (dll)
    {
      sz = image_size (dll)
      find slot of size sz in free_list and remove slot from free_list
      add slot to used_list
      rebase_image (dll)
    }

The free and used lists are persisted in a file called rebase.conf which will
be ultimately stored in /etc/setup.  Attached is a sample.

I will be implementing the un-rebase and re-rebase functionality next:

    unrebase (dll)
    {
      find dll in used_list and remove from used_list
      add slot to free_list
    }

    rerebase (dll)
    {
      find dll in used_list
      if (old image size == new image size)
        rebase_image (dll)
      else
        unrebase (dll)
        rebase (dll)
    }

Note that I have skipped executables (even though suggested by Rob),
because AFAICT that are *not* rebase-able.  I have also skipped DLL
dependency checking too.  You have to crawl, before you can walk, before
you can run...

I have decided to develop using a stand-alone Mingw (i.e., -mno-cygwin) app
instead of integrating directly into setup.exe for the following reasons:

    o speed development
    o prevent whacking my Cygwin installation
    ? possibly this stand-alone rebase could be used as a one-shot to
      rebase existing Cygwin installations
    ? possibly this stand-alone rebase should be the "real" rebase tool that
      is part of the standard Cygwin distribution (as opposed to my previous
      versions)
    ? possibly setup.exe should call rebase.exe to minimize impact on size
      (although the current stripped size is ~31K)

Any comments on the items above marked by "?" would be appreciated.

BTW, the attached (untried) "patch" demonstrates how one could integrate
this new rebase functionality into setup.exe.

I can post the source if anyone is interested in checking it out.
Otherwise, I will post it when full functionality is achieved.

Thanks,
Jason

[-- Attachment #2: rebase.conf --]
[-- Type: text/plain, Size: 294 bytes --]

[Free List]
0x78000000	0x7fee0000
0x5f000000	0x70000000
0x00400000	0x50000000

[Used List]
C:\home\jtishler\src\setup-rebase\cygcrypto.dll	0x7ff50000	0x000b0000
C:\home\jtishler\src\setup-rebase\cygssl.dll	0x7ff10000	0x00040000
C:\home\jtishler\src\setup-rebase\cygz.dll	0x7fee0000	0x00030000


[-- Attachment #3: rebase.diff --]
[-- Type: text/plain, Size: 1058 bytes --]

Index: install.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/install.cc,v
retrieving revision 2.37
diff -u -p -r2.37 install.cc
--- install.cc	2002/01/22 11:35:10	2.37
+++ install.cc	2002/01/24 17:32:12
@@ -291,6 +291,7 @@ install_one_source (packagemeta & pkgm, 
 		    }
 		}
 	    }
+	  rebaser::get_instance ()->rebase (concat (prefixPath, fn));
 
 	  progress (tmp->tell ());
 	  num_installs++;
Index: package_meta.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/package_meta.cc,v
retrieving revision 2.15
diff -u -p -r2.15 package_meta.cc
--- package_meta.cc	2002/01/22 09:03:55	2.15
+++ package_meta.cc	2002/01/24 17:32:12
@@ -168,6 +168,7 @@ packagemeta::uninstall ()
 	      SetFileAttributes (d, dw & ~FILE_ATTRIBUTE_READONLY);
 	      DeleteFile (d);
 	    }
+	  rebaser::get_instance ()->unrebase (d);
 	  /* Check for Windows shortcut of same name. */
 	  d = concat (d, ".lnk", NULL);
 	  dw = GetFileAttributes (d);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-01-24 17:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-26  4:08 Rebase Status Jason Tishler

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