Commit 71b74214 authored by Vitaly Lipatov's avatar Vitaly Lipatov

drop dkms checking hell

parent 1ea96f55
......@@ -76,6 +76,7 @@ EOF
%__subst "s|@INITDIR@|%_initdir|g" etercifs.service
install -D -m644 buildmodule.sh %buildroot%_datadir/%name/buildmodule.sh
install -D -m644 checkmodule.sh %buildroot%_datadir/%name/checkmodule.sh
install -D -m644 functions.sh %buildroot%_datadir/%name/functions.sh
install -D -m755 %name-build %buildroot%_sbindir/%name-build
......
#!/bin/sh
# 2007-2010 (c) Etersoft http://etersoft.ru
# 2007-2010, 2017 (c) Etersoft http://etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru>
# modified: Konstantin Baev <kipruss@etersoft.ru>
# GNU Public License
......@@ -10,47 +10,15 @@
. ./functions.sh
if [ $TESTBUILD -ne 1 ] ; then
if [ $DKMSBUILD -eq 1 ] ; then
detect_host_kernel
detect_host_kernel
if [ -r $SRC_DIR/dkms.conf ] && [ `which dkms 2>/dev/null` ] ; then
echo
echo "Building $MODULENAME $MODULEVERSION for $KERNELVERSION Linux kernel with dkms"
dkms_build_module
else
detect_host_kernel
echo
echo "Building $MODULENAME $MODULEVERSION for $KERNELVERSION Linux kernel (headers in $KERNSRC)"
compile_module
install_module
fi
else
echo
echo "====================================================================="
echo "Check build etercifs module for all found kernels"
BUILTLIST=
for LM in `ls /lib/modules` ; do
KERNSRC=`readlink /lib/modules/$LM/build`
if [ $KERNSRC ] ; then
[ -L $KERNSRC ] && continue
[ -f $KERNSRC/.config ] || continue
echo "---------------------------------------------------------------------"
detect_kernel
if [ -z "$KERNELVERSION" ] ; then
echo "Can't detect kernel version in $KERNSRC"
else
echo "Build for $KERNSRC (detected as $KERNELVERSION)"
BUILTLIST="$BUILTLIST $KERNELVERSION"
compile_module
check_build_module
fi
fi
done
echo "====================================================================="
echo "CIFS Linux kernel module $MODULENAME $MODULEVERSION built for follow kernels (marked as ---DONE or ---FAILURE):"
echo "---------------------------------------------------------------------"
for i in $BUILTLIST ; do echo " $i" ; done
echo "====================================================================="
fi
exit 0
#!/bin/sh
# 2007-2010, 2017 (c) Etersoft http://etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru>
# modified: Konstantin Baev <kipruss@etersoft.ru>
# GNU Public License
. ./functions.sh
echo
echo "====================================================================="
echo "Check build etercifs module for all found kernels"
BUILTLIST=
for LM in `ls /lib/modules` ; do
KERNSRC=`readlink /lib/modules/$LM/build`
if [ $KERNSRC ] ; then
[ -L $KERNSRC ] && continue
[ -f $KERNSRC/.config ] || continue
echo "---------------------------------------------------------------------"
detect_kernel
if [ -z "$KERNELVERSION" ] ; then
echo "Can't detect kernel version in $KERNSRC"
else
echo "Build for $KERNSRC (detected as $KERNELVERSION)"
BUILTLIST="$BUILTLIST $KERNELVERSION"
compile_module
check_build_module
fi
fi
done
echo "====================================================================="
echo "CIFS Linux kernel module $MODULENAME $MODULEVERSION built for follow kernels (marked as ---DONE or ---FAILURE):"
echo "---------------------------------------------------------------------"
for i in $BUILTLIST ; do echo " $i" ; done
echo "====================================================================="
exit 0
......@@ -41,8 +41,7 @@ else
fatal "Not found configuration file $CONFIGFILE"
fi
[ -n "$BUILT" ] || BUILT=0
[ -n "$DKMS" ] || DKMS=1
BUILT=0
ORIGMODULENAME=cifs
......@@ -216,7 +215,6 @@ load_module()
echo -n "trying to compile it..."
if [ $BUILT -ne 1 ] ; then
build_module
BUILT=1
start
fi
}
......@@ -290,19 +288,15 @@ status()
build_module()
{
if [ -r $SRC_DIR/dkms.conf ] && [ `which dkms 2>/dev/null` ] && [ $DKMS -eq 1 ] ; then
cd $DATADIR
DKMSBUILD=1 sh buildmodule.sh
else
cd $DATADIR
sh buildmodule.sh
fi
cd @DATADIR@
sh buildmodule.sh || return
BUILT=1
}
test_build_module()
{
cd $DATADIR
TESTBUILD=1 sh buildmodule.sh
cd @DATADIR@
sh checkmodule.sh
}
case "$1" in
......@@ -324,7 +318,8 @@ case "$1" in
build)
build_module
;;
testbuild)
testbuild|checkbuild)
# See https://bugs.etersoft.ru/show_bug.cgi?id=2782
test_build_module
;;
status)
......
......@@ -4,18 +4,5 @@
# Pavel Shilovsky <piastry@etersoft.ru>
# 2006, 2007, 2008, 2009, 2010, 2013 Public domain
PACKAGEINFO=@DATADIR@/package.conf
if [ -f "$PACKAGEINFO" ] ; then
. $PACKAGEINFO
else
"Not found package information file $PACKAGEINFO"
fi
if [ -r $SRC_DIR/dkms.conf ] && [ `which dkms 2>/dev/null` ]; then
cd $DATADIR
DKMSBUILD=1 sh buildmodule.sh
else
cd $DATADIR
sh buildmodule.sh
fi
cd @DATADIR@
sh buildmodule.sh
......@@ -21,8 +21,6 @@ else
fatal "Not found configuration file $CONFIGFILE"
fi
[ -n "$TESTBUILD" ] || TESTBUILD=0
[ -n "$DKMSBUILD" ] || DKMSBUILD=0
fatal()
{
......@@ -337,9 +335,7 @@ set_gcc()
{
if [ -f $KERNSRC/gcc_version.inc ] ; then
. $KERNSRC/gcc_version.inc
if [ $TESTBUILD -ne 1 ] ; then
echo "Use GCC $GCC_VERSION"
fi
echo "Use GCC $GCC_VERSION"
export GCCNAME=gcc-$GCC_VERSION
export USEGCC="CC=$GCCNAME"
else
......
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