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

drop dkms checking hell

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