-
Notifications
You must be signed in to change notification settings - Fork 55
/
debuginfodeps
executable file
·49 lines (39 loc) · 1.06 KB
/
debuginfodeps
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#! /usr/bin/perl
# Usage
#
# 1. debuginfodeps <image_name>
#
# Reads build ids from tmp/<image_name>.debugids and writes debuginfo
# requires to images/instsys/usr/share/debuginfodeps/<image_name>.
#
$image = shift;
$dst = "$ENV{DESTDIR}/usr/share/debuginfodeps";
die "$image: no package list" unless -f "tmp/$image.rpmlog";
die "$dst: no debuginfodeps directory\n" unless -d $dst;
open $f, "tmp/$image.debugids";
my %ids;
while ( <$f> ){
chomp;
next unless (m/^(.*) (.*)/);
my $id = $1;
my $file = $2;
# black list strange binaries
next if ($file =~ m,/usr/bin/syslinux,);
next if ($file =~ m,/usr/bin/syslinux-mtools,);
next if ($file =~ m,/sbin/lilo,);
next if ($file =~ m,/usr/lib/getconf/,);
# non-stripped
next if ($file =~ m,/usr/lib/pt_chown,);
# faked ELF binary with just data
next if ($file =~ m,/libicudata.so.,);
# too large to be useful
next if ($file =~ m,/usr/lib.*/dri/,);
$ids{$id} = $file;
}
close $f;
open $d, ">", "$dst/$image";
for (sort keys %ids) {
print $d "# $ids{$_}\n";
print $d "debuginfo(build-id) = $_\n";
}
close($d);