aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Samuelsson <ulf.samuelsson@atmel.com>2009-01-03 16:59:04 +0000
committerUlf Samuelsson <ulf.samuelsson@atmel.com>2009-01-03 16:59:04 +0000
commit3b60cec51bc6e4d138db274eed316cb34319d0f2 (patch)
treec8681a3f59a91f8ed46aa458bc1226b576e93d3b
parent3ed07ff64b0941ffb15c75c8948143068cbf5022 (diff)
downloadbuildroot-novena-3b60cec51bc6e4d138db274eed316cb34319d0f2.tar.gz
buildroot-novena-3b60cec51bc6e4d138db274eed316cb34319d0f2.zip
Do not copy linux config with higher minor version than current kernel
-rwxr-xr-xscripts/get_linux_config.sh31
1 files changed, 25 insertions, 6 deletions
diff --git a/scripts/get_linux_config.sh b/scripts/get_linux_config.sh
index 0b986ae13..1950e9d2e 100755
--- a/scripts/get_linux_config.sh
+++ b/scripts/get_linux_config.sh
@@ -11,38 +11,57 @@
#######################################################################
TOPDIR=`pwd`
-
+DEBUG=0
# parameter #1 BOARD_PATH
# parameter #2 LINUX26_DIR
-CONFIGS=`ls -X $1/*linux*.*.config | sed s/[.]config// - | sort`
+CONFIGS=`ls -X $1/*linux-2.6.*.config | sed s/[.]config// - | sort`
LINUX26_DIR=`basename $2`
LINUX26_CONFIG=${2}/.config
LINUX_MAJOR_VERSION=${LINUX26_DIR:10:2}
LINUX_MINOR_VERSION=${LINUX26_DIR:13}
+function DBG_PRINT
+{
+ if [ ${DEBUG} == 1 ] ; then
+ echo $1
+ fi
+}
+
function linux_version()
{
local KCONFIG
KCONFIG=`basename $1`
- KERNEL=`echo ${KCONFIG} | sed s/.*-linux-/linux-/g -`
+ KERNEL=`echo ${KCONFIG} | sed s/.*linux-2.6./linux-2.6./g -`
THIS_MAJOR=${KERNEL:10:2}
THIS_MINOR=${KERNEL:13}
-
}
# Try to be careful...
+DBG_PRINT MAJOR=\"${LINUX_MAJOR_VERSION}\"
+DBG_PRINT MINOR=\"${LINUX_MINOR_VERSION}\"
for i in ${CONFIGS} ; do
+ DBG_PRINT FILE=$i
linux_version $i
- if [ ${THIS_MAJOR} -le ${LINUX_MAJOR_VERSION} ] ; then
+ DBG_PRINT KERNEL=${KERNEL}
+ if [ ${THIS_MAJOR} -lt ${LINUX_MAJOR_VERSION} ] ; then
echo Copying `basename $i`.config ...
cp $i.config ${LINUX26_CONFIG}
elif [ ${THIS_MAJOR} -eq ${LINUX_MAJOR_VERSION} ] ; then
- if [ ${THIS_MINOR} -le ${LINUX_MINOR_VERSION} ] ; then
+ if [ "${LINUX_MINOR_VERSION}X" == "X" ] ; then
+ if [ "${THIS_MINOR}X" == "X" ] ; then
+ echo Copying `basename $i`.config ...
+ cp $i.config ${LINUX26_CONFIG}
+ else
+ return
+ fi
+ elif [ ${THIS_MINOR} -le ${LINUX_MINOR_VERSION} ] ; then
echo Copying `basename $i`.config ...
cp $i.config ${LINUX26_CONFIG}
fi
+ else
+ return
fi
done