# Install build dependencies
sudo apt-get install -y bc
-# Prep the config
-echo "Updating the default debian kernel config"
-yes "" | make oldconfig # Update with defaults for new options
-
# Clean the upper level debs
rm -f ../*.deb
-# Build the rpms
+# Build the debs
echo "Building DEBs"
make deb-pkg
env
echo "*****"
-# Prep the config
-echo "Updating the default kernel config for rpm-based distros"
-yes "" | make oldconfig # Update with defaults for new options
-
# Clean rpmbuild structure
rm -rf ~/rpmbuild/
--- /dev/null
+#!/bin/bash
+set -ex
+
+# Prep the config
+echo "Updating the kernel config"
+make olddefconfig
+
+# This way we get the commit hash embedded into the package metadata
+# and 'uname -r' in all cases - whether it's some random commit or an
+# annotated tag. Example package names:
+# uname -r: 4.9.0-rc4-ceph-g156db39ecfbd
+# deb: linux-image-4.9.0-rc4-ceph-g156db39ecfbd_4.9.0-rc4-ceph-g156db39ecfbd-1_amd64.deb
+# rpm: kernel-4.9.0_rc4_ceph_g156db39ecfbd-2.x86_64.rpm
+if ! grep -q "^CONFIG_LOCALVERSION_AUTO=y" .config; then
+ echo "CONFIG_LOCALVERSION_AUTO is not set, check kernel-config-*.sh"
+ exit 1
+fi
+printf -- '-ceph-g%s' ${GIT_COMMIT:0:12} > .scmversion
- ../../../scripts/build_utils.sh
- ../../build/setup
- ../../build/kernel-config-deb.sh
+ - ../../build/prepare_config
- ../../build/build_deb
# rpm build scripts
- shell:
- ../../../scripts/build_utils.sh
- ../../build/setup
- ../../build/kernel-config-rpm.sh
+ - ../../build/prepare_config
- ../../build/build_rpm
wrappers: