. $config
. kernel/kernel-version
askyes "build-kernel" "Rebuild kernel $VERSION-$REV (make-kpkg - takes time!)"

cd kernel
# if it is not already there, try to make symlink to src tree:
[ -d linux-$VERSION -o -L linux-$VERSION ] || ln -s $archive/linux-$VERSION .

# copy our .config and ASK if it is already there
echo "Copying .config-$VERSION to linux-$VERSION/.config ..."
cp -i .config-$VERSION linux-$VERSION/.config

cd linux-$VERSION
export VERSION_H_OK=1
make-kpkg --append-to-version=$REV clean
make-kpkg --append-to-version=$REV kernel_image
make-kpkg --append-to-version=$REV modules_image
