export PB_SUITE=$4
fi
+cat > /etc/kernel-pkg.conf << EOF
+maintainer := Profitbricks GmbH
+email := support@profitbricks.com
+priority := Low
+EOF
+
TMPFILE=$(mktemp)
echo "Building $OOT_MODULE for kernel profitbricks-$PB_FLAVOUR for $DIST and $PB_SUITE using script in $TMPFILE which has this content:"
set -e
apt-get update
apt-get -y upgrade
- apt-get -y install openssh-client linux-source-profitbricks-$PB_FLAVOUR $OOT_MODULE-source linux-image-profitbricks-$PB_FLAVOUR
- m-a unpack $OOT_MODULE
+ apt-get -y install openssh-client linux-source-profitbricks-$PB_FLAVOUR $OOT_MODULE-source linux-image-profitbricks-$PB_FLAVOUR dctrl-tools
cd /usr/src/
- sed -i -s "s#_KVERS_#_KVERS_-profitbricks-$PB_FLAVOUR#g" modules/$OOT_MODULE/debian/control.modules.in
- sed -i -s "s#^Provides: $OOT_MODULE-modules#Provides: $OOT_MODULE-modules, $OOT_MODULE-modules-profitbrick-$PB_FLAVOUR#g" modules/$OOT_MODULE/debian/control.modules.in
tar xjf linux-source-*-$PB_FLAVOUR.tar.bz2
- KDIR=\$(find /usr/src -name "*profitbricks-$PB_FLAVOUR*" -type d)
- KVERS=\$(echo \$KDIR |cut -d "-" -f3-)
+ export KDIR=\$(find /usr/src -maxdepth 1 -name "linux-source-*profitbricks-$PB_FLAVOUR*" -type d)
+ export KVERS=\$(echo \$KDIR |cut -d "-" -f3-)
+
+ cd /usr/share/doc/linux-image-*profitbricks-$PB_FLAVOUR
+ zcat changelog.Debian.gz > changelog
+ our_version=\$(dpkg-parsechangelog -l./changelog|grep-dctrl -n -s Version ''|cut -d "-" -f4)
+ echo "debian = \\\$(version)-\$our_version" >> /etc/kernel-pkg.conf
+
+ cd /usr/src/
+ tar xjvf $OOT_MODULE.tar.bz2
+ # the next line is only useful if its also applied to jenkins_build_script.git/kernel_inpbuilder.py:install_extra_modules()
+ # sed -i -s "s#^Provides: $OOT_MODULE-modules#Provides: $OOT_MODULE-modules, $OOT_MODULE-modules-profitbrick-$PB_FLAVOUR#g" modules/$OOT_MODULE/debian/control.modules.in
+
cd \$KDIR
cp /boot/config-*-$PB_FLAVOUR .config
make prepare
make modules_prepare
- m-a -k \$KDIR build -l\$KVERS --not-unpack $OOT_MODULE
+ /usr/bin/make-kpkg -j 25 --arch amd64 --rootcmd fakeroot --append-to-version -profitbricks-gw --initrd --arch_in_name modules
+
cd /usr/src/
ls *deb
# FIXME: this is soooo just wrong...