~ubuntu-branches/ubuntu/karmic/linux-mvl-dove/karmic-proposed

« back to all changes in this revision

Viewing changes to debian.master/scripts/misc/getabis

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Bader
  • Date: 2010-03-10 22:24:12 UTC
  • mto: (15.1.2 karmic-security)
  • mto: This revision was merged to the branch mainline in revision 18.
  • Revision ID: james.westby@ubuntu.com-20100310222412-k86m3r53jw0je7x1
Tags: upstream-2.6.31
ImportĀ upstreamĀ versionĀ 2.6.31

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/bash
2
 
 
3
 
if [ "$#" != "2" ]; then
4
 
        echo "Usage: $0 <release> <revision>" 1>&2
5
 
        exit 1
6
 
fi
7
 
 
8
 
ver=$1
9
 
revision=$2
10
 
abi=$(echo $revision | awk -F. '{print $1}')
11
 
 
12
 
verabi=$ver-$abi
13
 
verfull=$ver-$revision
14
 
 
15
 
repo="http://archive.ubuntu.com/ubuntu/pool/main/l"
16
 
repo_ports="http://ports.ubuntu.com/ubuntu-ports/pool/main/l"
17
 
repo_uni="http://archive.ubuntu.com/ubuntu/pool/universe/l"
18
 
repo_ports_uni="http://ports.ubuntu.com/ubuntu-ports/pool/universe/l"
19
 
 
20
 
WGET="wget --quiet -c"
21
 
 
22
 
abidir="`pwd`/debian/abi/$verfull"
23
 
tmpdir="`pwd`/abi-tmp-$verfull"
24
 
origdir="`pwd`"
25
 
 
26
 
test -d $tmpdir || mkdir $tmpdir
27
 
 
28
 
getall() {
29
 
        arch=$1
30
 
        shift
31
 
 
32
 
        mkdir -p $abidir/$arch
33
 
 
34
 
        for sub in $@; do
35
 
                if [ -f $abidir/$arch/$sub ]; then
36
 
                        echo "Exists: $sub"
37
 
                        continue
38
 
                fi
39
 
                echo -n "Fetching $sub..."
40
 
                filename=linux-image-${verabi}-${sub}_${verfull}_${arch}.deb
41
 
                cd $tmpdir
42
 
                for r in $repo $repo_ports $repo_uni $repo_ports_uni
43
 
                do
44
 
                        if ! [ -f $filename ]; then
45
 
                                $WGET $r/linux/$filename
46
 
                        fi
47
 
                done
48
 
                if [ "$?" = "0" ]; then
49
 
                        echo -n "extracting..."
50
 
                        dpkg-deb --extract $filename tmp
51
 
                        if [ -f tmp/boot/abi-* ]; then
52
 
                                mv tmp/boot/abi-* $abidir/$arch/$sub
53
 
                        else
54
 
                                echo -n "NO ABI FILE..."
55
 
                        fi
56
 
                        (cd tmp; find lib/modules/$verabi-$sub/kernel -name '*.ko') | \
57
 
                                sed -e 's/.*\/\([^\/]*\)\.ko/\1/' | sort > \
58
 
                                $abidir/$arch/$sub.modules
59
 
                        rm -rf tmp $filename
60
 
                        echo "done."
61
 
                else
62
 
                        echo "FAILED."
63
 
                fi
64
 
                cd $origdir
65
 
        done
66
 
}
67
 
 
68
 
# MAIN
69
 
 
70
 
# Setup abi directory
71
 
mkdir -p $abidir
72
 
echo $abi > $abidir/abiname
73
 
 
74
 
# NOTE: The flavours are hardcoded, because they may have changed from the
75
 
# current build.
76
 
 
77
 
getall lpia lpia
78
 
getall amd64 generic server
79
 
getall i386 generic generic-pae 386
80
 
 
81
 
# Ports arches and flavours.
82
 
getall powerpc powerpc powerpc-smp powerpc64-smp
83
 
getall ia64 ia64
84
 
getall sparc sparc64 sparc64-smp
85
 
 
86
 
rmdir $tmpdir