-#if test -e include/config/auto.conf; then
-# . include/config/auto.conf
-#else
-# echo "Error: kernelrelease not valid - run 'make prepare' to update it"
-# exit 1
-#fi
-CONFIG_LOCALVERSION=
-CONFIG_LOCALVERSION_AUTO=y
+if test -e include/config/auto.conf; then
+ # We are interested only in CONFIG_LOCALVERSION and
+ # CONFIG_LOCALVERSION_AUTO, so extract these in a safe
+ # way (i.e. w/o sourcing auto.conf)
+ CONFIG_LOCALVERSION=`cat include/config/auto.conf | awk -F '=' '/^CONFIG_LOCALVERSION=/ {print $2}'`
+ CONFIG_LOCALVERSION_AUTO=`cat include/config/auto.conf | awk -F '=' '/^CONFIG_LOCALVERSION_AUTO=/ {print $2}'`
+else
+ echo "Error: kernelrelease not valid - run 'make prepare' to update it"
+ exit 1
+fi