Do not copy linux config with higher minor version than current kernel
This commit is contained in:
parent
3ed07ff64b
commit
3b60cec51b
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user