]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
UBUNTU: [Packaging] buildinfo -- add buildinfo support to getabis
authorAndy Whitcroft <apw@canonical.com>
Fri, 10 Aug 2018 09:10:24 +0000 (10:10 +0100)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Thu, 6 Dec 2018 13:43:21 +0000 (14:43 +0100)
BugLink: http://bugs.launchpad.net/bugs/1806380
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
debian/scripts/misc/getabis

index 89b14af3feb8051abb2e65aefffec0d2ba4bdc5b..42690b0311e2863ec2207ee65d976fdd9b796b89 100755 (executable)
@@ -67,39 +67,54 @@ getall() {
                        do
                                dpkg-deb --extract $filename tmp
                        done
-                       find tmp -name "*.ko" | while read f; do
-                               modinfo $f | grep ^firmware >> $fwinfo
-                       done
-                       if [ -f tmp/boot/abi-* ]; then
-                               mv tmp/boot/abi-* $abidir/$arch/$sub
-                       else
-                               echo -n "NO ABI FILE..."
-                       fi
-                       if [ -f tmp/boot/retpoline-* ]; then
-                               mv tmp/boot/retpoline-* $abidir/$arch/$sub.retpoline
+                       # FORM 1: linux-image et al extracted here.
+                       if [ -d tmp/boot ]; then
+                               echo -n "images..."
+                               find tmp -name "*.ko" | while read f; do
+                                       modinfo $f | grep ^firmware >> $fwinfo
+                               done
+                               if [ -f tmp/boot/abi-* ]; then
+                                       mv tmp/boot/abi-* $abidir/$arch/$sub
+                               else
+                                       echo -n "NO ABI FILE..."
+                               fi
+                               if [ -f tmp/boot/retpoline-* ]; then
+                                       mv tmp/boot/retpoline-* $abidir/$arch/$sub.retpoline
+                               else
+                                       echo -n "NO RETPOLINE FILE..."
+                               fi
+                               (cd tmp; find lib/modules/$verabi-$sub/kernel -name '*.ko') | \
+                                       sed -e 's/.*\/\([^\/]*\)\.ko/\1/' | sort > \
+                                       $abidir/$arch/$sub.modules
+                               (
+                                       cd tmp;
+                                       # Prevent exposing some errors when called by python scripts. SIGPIPE seems to get
+                                       # exposed when using the `find ...` form of the command.
+                                       ko=$(find lib/modules/$verabi-$sub/kernel \
+                                               -name '*.ko' | head -1)
+                                       readelf -p .comment "$ko" | gawk '
+                                               ($1 == "[") {
+                                                       printf("%s", $3);
+                                                       for (n=4; n<=NF; n++) {
+                                                               printf(" %s", $n);
+                                                       }
+                                                       print ""
+                                               }' | sort -u >$abidir/$arch/$sub.compiler
+                                       version=`cat $abidir/$arch/$sub.compiler`
+                                       echo -n "$version..."
+                               )
+                       # FORM 2: moduleinfo packages
+                       # cranky-fix -- modinfo supported
                        else
-                               echo -n "NO RETPOLINE FILE..."
+                               echo -n "buildinfo..."
+                               base="tmp/usr/lib/linux/${verabi}-${sub}"
+                               mv "$base/abi" "$abidir/$arch/$sub"
+                               for comp in 'modules' 'retpoline' 'compiler'
+                               do
+                                       mv "$base/$comp" "$abidir/$arch/$sub.$comp"
+                               done
+                               cat "$base/fwinfo" >>"$fwinfo"
                        fi
-                       (cd tmp; find lib/modules/$verabi-$sub/kernel -name '*.ko') | \
-                               sed -e 's/.*\/\([^\/]*\)\.ko/\1/' | sort > \
-                               $abidir/$arch/$sub.modules
-                       (
-                               cd tmp;
-                               # Prevent exposing some errors when called by python scripts. SIGPIPE seems to get
-                               # exposed when using the `find ...` form of the command.
-                               ko=$(find lib/modules/$verabi-$sub/kernel \
-                                       -name '*.ko' | head -1)
-                               readelf -p .comment "$ko" | gawk '
-                                       ($1 == "[") {
-                                               printf("%s", $3);
-                                               for (n=4; n<=NF; n++) {
-                                                       printf(" %s", $n);
-                                               }
-                                               print ""
-                                       }' | sort -u >$abidir/$arch/$sub.compiler
-                               version=`cat $abidir/$arch/$sub.compiler`
-                               echo -n "$version..."
-                       )
                        rm -rf tmp $filenames
                        echo "done."
                else