public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Quinn Harris <quinn@nmt.edu>
To: gentoo-dev@gentoo.org
Subject: Re: [gentoo-dev] glibc-2.3 and prelinking
Date: 05 Oct 2002 16:16:01 -0600	[thread overview]
Message-ID: <1033856161.6167.13.camel@quinn.rcn.nmt.edu> (raw)
In-Reply-To: <1033798935.27154.112.camel@quinn.rcn.nmt.edu>

I have a crappy but functional solution to this problem.  I changed the
portage.py code to use the prelink --verify option to get the input for
the MD5 checksum.  This probably incurres a substantial performance
hit.  In addition prelink is used to help calculate all MD5 checksums
which is pointless.  On the other hand, I essentally deleted 5 lines and
changed 1 to get it to work.  Heres the patch.

--- /usr/lib/python2.2/site-packages/portage.py 2002-09-25 20:17:44.000000000 -0600
+++ /mnt/gentoo/usr/lib/python2.2/site-packages/portage.py  2002-10-05 16:05:22.000000000 -0600
@@ -47,33 +47,28 @@
        if mtime != cached_mtime:
                list = os.listdir(path)
                dircache[path] = mtime, list
        return list

-try:
-       import fchksum
-       def perform_checksum(filename):
-               return fchksum.fmd5t(filename)
-except ImportError:
-       import md5
-       def md5_to_hex(md5sum):
-               hexform = ""
-               for ix in xrange(len(md5sum)):
-                       hexform = hexform + "%02x" % ord(md5sum[ix])
-               return(string.lower(hexform))
-
-       def perform_checksum(filename):
-               f = open(filename, 'rb')
-               blocksize=32768
+import md5
+def md5_to_hex(md5sum):
+       hexform = ""
+       for ix in xrange(len(md5sum)):
+               hexform = hexform + "%02x" % ord(md5sum[ix])
+       return(string.lower(hexform))
+
+def perform_checksum(filename):
+       f = os.popen3("/usr/sbin/prelink --verify " + filename, 'r')[1]
+       blocksize=32768
+       data = f.read(blocksize)
+       size = 0L
+       sum = md5.new()
+       while data:
+               sum.update(data)
+               size = size + len(data)
                data = f.read(blocksize)
-               size = 0L
-               sum = md5.new()
-               while data:
-                       sum.update(data)
-                       size = size + len(data)
-                       data = f.read(blocksize)
-               return (md5_to_hex(sum.digest()),size)
+       return (md5_to_hex(sum.digest()),size)

 starttime=int(time.time())

 features=[]



On Sat, 2002-10-05 at 00:22, Quinn Harris wrote:
> I have started to build a system with glibc-2.3 primarily to use
> prelinking.  But I just realized that prelinking and portage aren't
> going to get along.
> 
> The prelink tool will change binaries and shared libraries on the system
> and therefor the modify time and the MD5 checksum.  I expect portage
> will no longer properly unmerge these changed files.
> 
> The prelink tool can be changed to update the portage db probably by
> using a wrapper script.  Or, portage could be modified to utilize
> prelink to determine if the file was modified by prelink.  This is
> explained in 
> http://sources.redhat.com/ml/libc-alpha/2002-10/msg00089.html
> 
> What would be the best solution?
> 
> 
> Some info about prelinking
> http://dforce.sh.cvut.cz/~seli/en/linking2/
> 
> 
> On a side note.  gcc-3.2 won't compile right with glibc-2.3.  It looks
> like the gcc-3.2-branch cvs has the problem fixed. 
> http://gcc.gnu.org/ml/gcc/2002-10/msg00333.html
> 
> _______________________________________________
> gentoo-dev mailing list
> gentoo-dev@gentoo.org
> http://lists.gentoo.org/mailman/listinfo/gentoo-dev
> 




      reply	other threads:[~2002-10-05 22:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-05  6:22 [gentoo-dev] glibc-2.3 and prelinking Quinn Harris
2002-10-05 22:16 ` Quinn Harris [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1033856161.6167.13.camel@quinn.rcn.nmt.edu \
    --to=quinn@nmt.edu \
    --cc=gentoo-dev@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox