From 881ab6f2320a89fbd17c6dd50a3f11e9cd932677 Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Fri, 11 Nov 2016 16:17:21 +0100 Subject: [PATCH] kernel: add prepare_config Signed-off-by: Ilya Dryomov --- kernel/build/build_deb | 6 +----- kernel/build/build_rpm | 4 ---- kernel/build/prepare_config | 18 ++++++++++++++++++ kernel/config/definitions/kernel.yml | 2 ++ 4 files changed, 21 insertions(+), 9 deletions(-) create mode 100644 kernel/build/prepare_config diff --git a/kernel/build/build_deb b/kernel/build/build_deb index bbf1cccf..30a7744c 100644 --- a/kernel/build/build_deb +++ b/kernel/build/build_deb @@ -88,14 +88,10 @@ echo "*****" # 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 diff --git a/kernel/build/build_rpm b/kernel/build/build_rpm index 98751ea7..a8e89173 100644 --- a/kernel/build/build_rpm +++ b/kernel/build/build_rpm @@ -73,10 +73,6 @@ echo "*****" 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/ diff --git a/kernel/build/prepare_config b/kernel/build/prepare_config new file mode 100644 index 00000000..d9ad7e22 --- /dev/null +++ b/kernel/build/prepare_config @@ -0,0 +1,18 @@ +#!/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 diff --git a/kernel/config/definitions/kernel.yml b/kernel/config/definitions/kernel.yml index fc7af844..98c2f63a 100644 --- a/kernel/config/definitions/kernel.yml +++ b/kernel/config/definitions/kernel.yml @@ -101,6 +101,7 @@ If this is checked, then the binaries will be built and pushed to chacra even if - ../../../scripts/build_utils.sh - ../../build/setup - ../../build/kernel-config-deb.sh + - ../../build/prepare_config - ../../build/build_deb # rpm build scripts - shell: @@ -109,6 +110,7 @@ If this is checked, then the binaries will be built and pushed to chacra even if - ../../../scripts/build_utils.sh - ../../build/setup - ../../build/kernel-config-rpm.sh + - ../../build/prepare_config - ../../build/build_rpm wrappers: -- 2.39.5