]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
kernel: add prepare_config
authorIlya Dryomov <idryomov@gmail.com>
Fri, 11 Nov 2016 15:17:21 +0000 (16:17 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 14 Nov 2016 13:50:06 +0000 (14:50 +0100)
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
kernel/build/build_deb
kernel/build/build_rpm
kernel/build/prepare_config [new file with mode: 0644]
kernel/config/definitions/kernel.yml

index bbf1cccf96ab1329e245ad0b72d8388f12763371..30a7744c3504af8ac45dd69f0a68d826ad95c355 100644 (file)
@@ -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
 
index 98751ea7c15b7c865a129c00bf97ebcd2d817081..a8e89173d6a54a03bae170efbd9f923eac5558d3 100644 (file)
@@ -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 (file)
index 0000000..d9ad7e2
--- /dev/null
@@ -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
index fc7af84455a4ab40d9eb7625dddf051e23606c77..98c2f63a8b9cb49f701ce547b57e473bce6446d1 100644 (file)
@@ -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: