Commit 3b8029ea authored by Konstantin Baev's avatar Konstantin Baev

CIFS_VERSION in module replaced by version of etercifs package

parent a690556c
......@@ -169,8 +169,18 @@ status()
local PRECOMP
echo "CIFS module status:"
if is_moduled ; then
echo " kernel module $MODULENAME version $MODULEVERSION is loaded"
# `modinfo etercifs | grep ^version:`
MODVER=`modinfo etercifs | grep ^version:`
MODVER=`echo $MODVER | sed 's|version:||g'`
MODVER=`echo $MODVER | sed 's| ||g'`
echo " package $MODULENAME version $MODULEVERSION is installed"
if [ $MODVER ] ; then
echo " kernel module $MODULENAME version $MODVER is loaded"
else
echo " kernel module $MODULENAME is loaded"
fi
if [ "$MODULEVERSION" != "$MODVER" ] ; then
[ $MODVER ] && echo " WARNING!!! Versions of package etercifs and module etercifs DON'T MATCH!!!"
fi
else
if is_origmoduled ; then
echo " origin kernel module $ORIGMODULENAME loaded"
......
......@@ -146,6 +146,21 @@ dkms_build_module()
dkms install -m $MODULENAME -v $MODULEVERSION --rpm_safe_upgrade
}
change_cifsversion()
{
if [ -f $BUILDDIR/cifsfs.h ] ; then
CIFSVERSION=`cat $BUILDDIR/cifsfs.h | grep CIFS_VERSION`
CIFSVERSION=`echo $CIFSVERSION | sed 's|#define CIFS_VERSION||g'`
CIFSVERSION=`echo $CIFSVERSION | sed 's|"||g'`
CIFSVERSION=`echo $CIFSVERSION | sed 's| ||g'`
cp $BUILDDIR/cifsfs.h $BUILDDIR/cifsfs.h.orig
sed -e "s/$CIFSVERSION/$MODULEVERSION/g" $BUILDDIR/cifsfs.h.orig > $BUILDDIR/cifsfs.h
echo "Setting etercifs version: OK"
else
echo "Setting etercifs version: FAIL"
fi
}
compile_module()
{
detect_etercifs_sources
......@@ -175,6 +190,7 @@ compile_module()
echo "WARNING: the .config file in kernel source directory does not exist!"
fi
change_cifsversion
make $USEGCC -C $KERNSRC here=$BUILDDIR SUBDIRS=$BUILDDIR clean
make $USEGCC -C $KERNSRC here=$BUILDDIR SUBDIRS=$BUILDDIR modules $MAKESMP
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment