Hi all,

I'm going to report some details about the problems we had with Bernard
regarding prelink and binaries in initrd. To shortly resume prelink can
corrupt some BOEL binaries or libraries so that they cannot be executed
in initrd.

This problem involves both BOEL and UYOK. For the first one I made a
patch (already checked in the trunk) that tries to undo prelinking in
the binaries and libs before copying them into the initrd. Obviously it
doesn't resolve the problem when you create the initrd with UYOK, since
the initrd_template is in the golden client and my patch works only when
you build the initrd for BOEL. But this is not the main problem...
prelink seems to be very prone to erros and in some cases it can
strongly corrupt executables in unrecoverable ways.

Following an example with the frozen bittorrent-console binary:

# cd
/usr/share/systemimager/boot/i386/standard/initrd_template/lib/bittorrent

The file is not prelinked:

# ./bittorrent-console
Usage: bittorrent-console [OPTIONS] [TORRENTFILE]

arguments are -
--ip <arg>
...

Perfect, it works! Now if the file is prelinked this is what happens:

# ls -ltrh bittorrent-console
-rwxr-xr-x  1 root root 4.0M 2006-07-19 20:01 bittorrent-console

# prelink bittorrent-console
# ls -ltrh bittorrent-console
-rwxr-xr-x  1 root root 923K 2006-07-19 20:01 bittorrent-console
# ./bittorrent-console
zipimport.ZipImportError: not a Zip file:
'/usr/share/systemimager/boot/i386/standard/initrd_template/lib/bittorrent/bittorrent-console'
Fatal Python error: cannot get zipimporter instance
Aborted

This is the known error reported by Bernard. After this operation
there's no way to restore the old executable (look also at the file size!):

# prelink -u bittorrent-console

# ls -ltrh bittorrent-console
-rwxr-xr-x  1 root root 918K 2006-07-19 20:01 bittorrent-console
# ./bittorrent-console
zipimport.ZipImportError: not a Zip file:
'/usr/share/systemimager/boot/i386/standard/initrd_template/lib/bittorrent/bittorrent-console'
Fatal Python error: cannot get zipimporter instance
Aborted

To freeze the bittorrent-console script, cx_freeze seems to run it, get
the running image, zip it and store the zipped image in the target new
binary. So the new binary must unpack the attached zipped image (using
the zipimporter class http://python.zgp.org/lib/module-zipimport.html)
and execute it.

With this kind of executable it seems that prelink simply removes from
the file the attached zipped image! :-o

The only solution I see is:
1) to add /usr/share/systemimager to the prelink blacklist (in
/etc/prelink.conf) in the golden client (maybe it could be done
automatically, adding it in the config file with an RPM post script)
2) totally disable prelink in the machines used to build RPMs

Ideas?

Cheers,
-Andrea

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sisuite-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sisuite-devel

Reply via email to