summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2007-12-13 16:02:41 +0000
committerOlivier Blin <oblin@mandriva.com>2007-12-13 16:02:41 +0000
commit5bc7f9525bc3fefc1cd7b7ae9abfd0bcff296127 (patch)
tree873e1824ff9874054fb7e076515348b1bc5b9c41
parent307f95f7526d84cbb99257bc0d59fc127606b889 (diff)
downloaddraklive-5bc7f9525bc3fefc1cd7b7ae9abfd0bcff296127.tar
draklive-5bc7f9525bc3fefc1cd7b7ae9abfd0bcff296127.tar.gz
draklive-5bc7f9525bc3fefc1cd7b7ae9abfd0bcff296127.tar.bz2
draklive-5bc7f9525bc3fefc1cd7b7ae9abfd0bcff296127.tar.xz
draklive-5bc7f9525bc3fefc1cd7b7ae9abfd0bcff296127.zip
add inst_initrd_bin helper to copy binaries and their library dependencies
-rwxr-xr-xdraklive16
1 files changed, 12 insertions, 4 deletions
diff --git a/draklive b/draklive
index 47a9e88..0c9fee7 100755
--- a/draklive
+++ b/draklive
@@ -386,6 +386,16 @@ sub create_initrd {
cp_f(get_builddir($live) . $live->{prefix}{build}{boot} . get_initrd_path($live->{media}),
$live->{copy_initrd}) if $live->{copy_initrd};
}
+sub inst_initrd_bin {
+ my ($root, $initrd_tree, $bin) = @_;
+ cp_f($root . $bin, $initrd_tree . '/bin/');
+ foreach my $file (`chroot $root ldd $bin | awk '/\\// {if(\$2 == "=>") {print \$3} else {print \$1}}'`) {
+ my ($lib_prefix, $filename) = chomp_($file) =~ m|/(lib[^/]*).*/([^/]+)$| or next;
+ my $dest = $initrd_tree . '/' . $lib_prefix . '/' . $filename;
+ mkdir_p($initrd_tree . '/' . $lib_prefix);
+ cp_f($root . $file, $dest) if !-f $dest;
+ }
+}
sub create_initrd_for_media {
my ($live, $media) = @_;
@@ -445,10 +455,8 @@ sub create_initrd_for_media {
}
}
- if (exists $storage_fs{$fs}{files}) {
- cp_f(get_system_root($live) . $_, $initrd_tree . '/bin/')
- foreach @{$storage_fs{$fs}{files} || []};
- }
+ inst_initrd_bin(get_system_root($live), $initrd_tree, $_) foreach
+ @{$storage_fs{$fs} && $storage_fs{$fs}{files} || []};
if ($live->{debug}) {
$need_libs = 1;