config=""
name=""
+builddir=""
homedir=$PWD
while [ "$1" ] ; do
case "$1" in
-config) config=$2 ; shift 2 ;;
-name) name=$2 ; shift 2 ;;
+ -dir) builddir=$2 ; shift 2 ;;
*)
echo
echo "usage:"
echo
echo "-config <kernel config file>"
echo "-name <kernel name>"
+ echo "-dir <build dir>"
echo
exit 1 ;;
esac
[ -z "$config" ] && config="./misc/arch/${hdw_arch}/linux.config"
[ -z "$name" ] && name="custom-$hdw_arch"
+[ -z "$builddir" ] && builddir="/tmp"
if [ ! -f $config ] ; then
echo "$config doesn't exist, aborting ..."
exit 1
fi
+if [ ! -d $builddir ] ; then
+ echo "$builddir doesn't exist, aborting ..."
+ exit 1
+fi
+
kerpkg="`grep '^#\ \[D\]' ./packages/base/linux/linux | awk '{ print $3 }'`"
kerver="`grep '^#\ \[V\]' ./packages/base/linux/linux | awk '{ print $3 }'`"
# build kernel & modules
kerarch=${hdw_arch//ia32/i386}
-cp $config /tmp/linux.config
-rm -rf /tmp/linux-$kerver
-tar xfj ./download/base/linux/$kerpkg -C /tmp
-cd /tmp/linux-$kerver
+cp $config $builddir/linux.config
+rm -rf $builddir/linux-$kerver
+tar xfj ./download/base/linux/$kerpkg -C $builddir
+cd $builddir/linux-$kerver
mv ../linux.config .config
cd include && ln -sf asm-${kerarch} asm && cd ..
yes "" | make oldconfig