source: trunk/debathena/third/openafs/build-openafs @ 22702

Revision 22702, 2.3 KB checked in by ghudson, 17 years ago (diff)
Snapshot the scripts used to build OpenAFS kernel modules, from /mit/debathena/packages/third/openafs.
  • Property svn:executable set to *
Line 
1#!/bin/sh
2set -x
3
4tmpdir=$(mktemp -d -t "build-openafs.$$.XXXXXXXXXX") || exit $?
5trap 'rm -rf "$tmpdir"' EXIT
6
7while read dist kernels; do
8    for kernel in $kernels; do
9        kversion=$(echo "$kernel" | sed 's/^.*-headers-//')
10        echo "Building for kernel $kversion..."
11        mkdir -p "$tmpdir/$dist/$kversion"
12        schroot -c "$dist-sbuild" -u root -- sh -xec "
13            #echo 'deb http://localhost:9999/ubuntu edgy-backports main restricted universe multiverse' >> /etc/apt/sources.list
14            #echo 'deb-src http://localhost:9999/ubuntu edgy-backports main restricted universe multiverse' >> /etc/apt/sources.list
15            apt-get -y update
16            apt-get -y install module-assistant '$kernel'
17            module-assistant -i -t -l '$kversion' get openafs
18            module-assistant -i -t -l '$kversion' unpack openafs
19            touch \"/usr/src/openafs-modules-${kversion}_\$(dpkg-query --showformat='\${Version}' --show openafs-modules-source)+\$(dpkg-query --showformat='\${Version}' --show '$kernel')_$(echo "$dist" | sed 's/.*-//').changes.pt\"
20            trap \"mv /var/cache/modass/*buildlog* '$tmpdir/$dist/$kversion'\" EXIT
21            eval \"\$(dpkg-architecture)\"
22            if [ \"\$DEB_HOST_ARCH\" != amd64 ] && fgrep -x CONFIG_X86_64=y '/lib/modules/${kversion}/build/.config'; then
23                apt-get -y install binutils-multiarch util-linux
24                type linux64 >/dev/null || apt-get -y install linux32
25                export KPKG_ARCH=amd64
26                export PERSONALITY=linux64
27                export PATH=/afs/sipb.mit.edu/project/debathena/packages/third/openafs/hacked-arch:\$PATH
28            fi
29            if ! [ -e /usr/src/modules/openafs/debian/genchanges* ]; then
30                install -m a=rx,u+w /afs/sipb.mit.edu/project/debathena/packages/third/openafs/genchanges.sh /usr/src/modules/openafs/debian/           
31            fi
32            if [ \"$dist\" = \"lenny-i386\" || \"$dist\" = \"lenny-amd64\" ]; then
33                install -m a=rx,u+w /afs/sipb.mit.edu/project/debathena/packages/third/openafs/genchanges.sh /usr/src/modules/openafs/debian/genchanges
34            fi
35            $PERSONALITY SIGNCHANGES=1 module-assistant -i -t -l '$kversion' auto-build openafs
36            mv /usr/src/openafs-modules* '$tmpdir/$dist/$kversion'" \
37            </dev/null
38        if [ $? -ne 0 ]; then
39            echo "$dist $kernel" >> /mit/debathena/packages/third/openafs/failed.log
40        fi
41        mkdir -p "$dist"
42        mv "$tmpdir/$dist/$kversion"/* "$dist"/
43        rm "$tmpdir/$dist/$kversion" -rf
44    done
45done
Note: See TracBrowser for help on using the repository browser.