Hi Holger:

[Forwarding this back to the mailing-list]

The mklibs.bef mentioned in your email is only available in trunk and
is not included in the 4.2.x branch that I am working on.  This is the
commit in question:

http://trac.systemimager.org/browser/trunk/initrd_source/mklibs.bef?rev=4495

Perhaps Brian could comment more specifically on your concerns.

Cheers,

Bernard

---------- Forwarded message ----------
From: Dr. Holger Obermaier <holger.oberma...@kit.edu>
Date: Tue, Mar 29, 2011 at 1:30 AM
Subject: Re: [sisuite-users] Help test latest snapshot of SystemImager
To: Bernard Li <bern...@vanhpc.org>


Am 26.03.2011 00:24, schrieb Bernard Li:
> Hi all:
>
> It has been a while since we've made a release (3 years, in fact!) so
> I'm happy to let you guys know that we are working on releasing 4.2.0
> (stable) to the world soon.
>
Hello Berard,

I had a closer look at your script mklibs.bef which replaces the binary
program from Debian/Ubuntu. I think I found some problems with the
script, which I want to share with you:
 * You are using perls build in function copy to copy the destination.
But copy does not keep the permissions but instead uses the umask. So
for example libc has execution permissions at the source but no
execution permissions at the target.
 * You use a two step method to find the necessary libraries. In the
first step you search for the libraries in the second you replace them
by the preferred libraries. But if you do not find a library in the
first step because the build system does not have this library, there is
nothing to replace. This happened for me with libparted, which is not
installed in the build system but gets generated with parted. So I think
the ldd used to find the libraries should use an LD_LIBRARY_PATH which
includes the user provided library directories. Then there is also no
need for step two any more.
 * The perl method make_path is very new and not available on Scintific
Linux 5.5 and SuSE Enterprise Server 10 SP1 so mkpath may be more portable.

I attached my changes to this mail. Maybe they will be helpful for you.

An other problem I had no solution until now is, that libraries themself
can depend on libraries which is not recognized by the script...

Greetings Holger

--
/*
   Karlsruher Institut für Technologie (KIT)
   Steinbuch Centre for Computing (SCC)
   Abteilung Scientific Computing Services (SCS)
   Dr. Holger Obermaier
   Zirkel 2, Gebäude 20.10, Raum 208
   D-76131 Karlsruhe
   Germany

   phone: +49 (721) 608 - 44862
   web: http://www.scc.kit.edu
   e-mail: holger.oberma...@kit.edu

   KIT - Universität des Landes Baden-Württemberg und nationales
Großforschungszentrum in der Helmholtz-Gemeinschaft
*/
#!/usr/bin/perl -w

# $Id: mklibs.bef 1871 2011-03-28 17:39:36Z rz119 $
# $Date: 2011-03-28 19:39:36 +0200 (Mo, 28. Mär 2011) $
# $Author: rz119 $
# $Revision: 1871 $
# $URL: 
svn+ssh://rz...@icdev-team.rz.uni-karlsruhe.de/srv/svn/OpenOb/scripts/usr/src/packages/SOURCES/systemimager/tools/mklibs.bef
 $

#
# Copyright (C) 2010 Brian Elliott Finley
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#


#   2011.03.23  Brian Elliott Finley
#   * Handle preferred library selection when multiple versions are
#     available.

use strict;
use Getopt::Long;
use File::Path qw(mkpath);
use File::Basename;

$ENV{PATH} = "/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin";


my $L;
my $v;
my $d;
my $help_info = "
Usage: mklibs.bef -L LIBRARY_PATH -d DEST_LIB_DIR BINARY [BINARY...]
        (library path is searched in order specified with -L)
";

GetOptions(
    "L=s"   => \$L,
    "v"     => \$v,
    "d=s"   => \$d,
) || die "$help_info";

unless( (defined $L) and (defined $d) ) {
    print "$help_info\n";
    exit 1;
}

my @binaries = @ARGV;
my @paths = split(/:/, $L);

if(defined $v) {
    print "mklibs.bef:\n";
    print 
"------------------------------------------------------------------------\n";
    print "> library path (-L):\n";
    foreach(@paths) {
        print ">  $_\n";
    }
    print ">\n> verbose (-v) /* 1=yes, 0=no */:\n>  $v\n";
    print ">\n> destination (-d):\n>  $d\n";
    print ">\n> binaries:\n";
}

my %finders;
mkpath("$d");
foreach $b (@binaries) {
    print ">  $b\n" if(defined $v);
    # Search libraries in the libs direcoties provieded by the user
    my $cmd = "LD_LIBRARY_PATH=\"$L\" ldd $b";
    open(INPUT,"$cmd|") or die;
    while(<INPUT>) {
        if(m# => /#) {
            my($junk_a, $lib, $junk_c, $lib_target_name) = split(/\s+/, $_);
            $finders{$lib} = $lib_target_name;
        }
    }
    close(INPUT);
}

print ">\n" if(defined $v);

print "> Copy libs to their destination:\n" if(defined $v);
foreach my $target_lib (sort keys %finders) {
    my $source_lib = $finders{$target_lib};

    my $target_dir = "$d";
    # Remove duplicate slashes for prettiness. -BEF-
    $target_dir =~ s|/+|/|g;
    mkpath("$target_dir");

    print ">  copy $source_lib $target_dir\n" if(defined $v);
    # use unix cp to preserve file permissions
    my  @args = ("cp", "$source_lib", "$target_dir");
    system(@args) == 0 or die "system @args failed: $?";
}
print ">\n" if(defined $v);

exit 0;
------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
sisuite-users mailing list
sisuite-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sisuite-users

Reply via email to