From c2362050ff4d92705e50a79906d5e62a7954e2df Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Mon, 8 Jul 2013 14:37:38 +0200 Subject: [kernel] remember last built version and if new kernel is detected, ask what to do. WARNING: KVERSION file will be missing, write the old (uname -r) under remote/modules/ksrc/KVERSION to be safe :) --- remote/modules/kernel/kernel.build | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'remote/modules/kernel') diff --git a/remote/modules/kernel/kernel.build b/remote/modules/kernel/kernel.build index 59bc8e99..a1a1fcd1 100644 --- a/remote/modules/kernel/kernel.build +++ b/remote/modules/kernel/kernel.build @@ -3,7 +3,7 @@ fetch_source() { if [ "x$PACKET_MANAGER" == "xapt" ]; then pdebug "apt-ing kernel source" apt-get install -y dpkg-dev || perror "Installing dpkg-dev failed." - apt-get source linux-image-${KERNEL_VERSION} || perror "Fetching kernel source failed." + apt-get source linux-image-${KERNEL_CURRENT_VERSION} || perror "Fetching kernel source failed." [ -z "$(ls -d linux-*/)" ] && perror "Source directory not found." [ ! -e ksrc ] && ln -s "$(ls -d linux-*/)" "ksrc" elif [ "x$PACKET_MANAGER" == "xzypper" ]; then @@ -29,6 +29,10 @@ fetch_source() { # fix pc speaker ./patch-speaker + + # remember the current kernel version + echo "${KERNEL_CURRENT_VERSION}" > ksrc/KVERSION + } build() { @@ -116,8 +120,8 @@ patch_aufs() { git clone "git://aufs.git.sourceforge.net/gitroot/aufs/aufs3-standalone.git" || perror "Cloning aufs3 failed." fi # get the needed version - [ ! -z ${KERNEL_VERSION} ] && local NEEDED_BRANCH=$(echo $KERNEL_VERSION | awk -F "." '{print $1"."$2}') \ - || perror "KERNEL_VERSION not set, this should not happen!" + [ ! -z ${KERNEL_CURRENT_VERSION} ] && local NEEDED_BRANCH=$(echo $KERNEL_CURRENT_VERSION | awk -F "." '{print $1"."$2}') \ + || perror "KERNEL_CURRENT_VERSION not set, this should not happen!" pinfo "Getting branch origin/$NEEDED_BRANCH" cd "$MODULE_DIR/aufs3-standalone" || perror "Could not CD to aufs3-standalone" git checkout "origin/aufs$NEEDED_BRANCH" -- cgit v1.2.3-55-g7522