Commit 1a50df1c authored by Konstantin Baev's avatar Konstantin Baev

3.0-alt1

- Up version to 2.0 - changed flag in /fs/cifs/file.c - changed package name and service name to etercifs - added Conflicts
parent 2abb42ac
tar.bz2: cifs name=kernel-source-etercifs-legacy-1.50c
tar.bz2: linux-cifs
tar.bz2: etercifs
linux-cifs/test.sh
etercifs/test.sh
......@@ -113,7 +113,7 @@ static inline int cifs_get_share_flags(unsigned int flags)
{
if (!etersoft_flag)
return FILE_SHARE_ALL;
return ((~(flags>>29))&7);
return ((~(flags>>21))&7);
}
/* all arguments to this function must be checked for validity in caller */
......
......@@ -14,8 +14,8 @@
%define src_package_name kernel-source-etercifs-legacy
%define src_package_version 1.50c
Name: linux-cifs
Version: 2.0
Name: etercifs
Version: 3.0
Release: alt1
Summary: Advanced Common Internet File System for Linux with Etersoft extension
......@@ -34,7 +34,6 @@ BuildArch: noarch
Source: %name-%version.tar.bz2
Source1: %src_package_name-%src_package_version.tar.bz2
#BuildRequires: rpm-build-compat >= 0.97
Requires: rpm-build-compat >= 0.97
# Spec part for ALT Linux
......@@ -61,10 +60,10 @@ Requires: kernel-source-etercifs-2.6.23
Requires: kernel-source-etercifs-2.6.24
Requires: kernel-source-etercifs-2.6.25
%define module_dir /lib/modules/%name
ExclusiveOS: Linux
Conflicts: linux-cifs
%description
The CIFS VFS is a virtual file system for Linux to allow access to
servers and storage appliances compliant with the SNIA CIFS Specification
......@@ -88,14 +87,12 @@ though.
This package has Etersoft's patches for WINE@Etersoft sharing access support.
#cifs-bld-tmp/fs/cifs
%define intdir new-cifs-backport
%package -n %src_package_name
Version: %src_package_version
Summary: Advanced Common Internet File System for Linux with Etersoft extension - module sources
Group: Development/Kernel
BuildArch: noarch
Conflicts: kernel-source-linux-cifs-legacy
%description -n %src_package_name
The CIFS VFS is a virtual file system for Linux to allow access to
......@@ -156,6 +153,12 @@ install -m755 %name.outformat %buildroot%_initdir/%name.outformat
%kernel_src/kernel-source-etercifs-2.6.??-%src_package_version.tar.bz2
%changelog
* Wed Oct 01 2008 Konstantin Baev <kipruss@altlinux.org> 3.0-alt1
- Up version to 2.0
- changed flag in /fs/cifs/file.c
- changed package name and service name to etercifs
- added Conflicts
* Thu Sep 25 2008 Konstantin Baev <kipruss@altlinux.org> 2.0-alt1
- Up version to 2.0
......
#!/bin/sh
# 2007 (c) Etersoft http://etersoft.ru
# 2007-2008 (c) Etersoft http://etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru>
# GNU Public License
......@@ -40,45 +40,44 @@ BUILDDIR=$tmpdir/${FILENAME%.tar.bz2}
# source and destination directories can be inherited from the environment
if [ -z "$KERNSRC" ]; then
KERNSRC=/lib/modules/$KERNELVERSION/build
KERNSRC=/lib/modules/$KERNELVERSION/build
fi
if [ -z "$INSTALL_MOD_PATH" ]; then
INSTALL_MOD_PATH=/lib/modules/$KERNELVERSION/kernel/fs/cifs
#INSTALL_MOD_PATH=/lib/modules/linux-cifs
INSTALL_MOD_PATH=/lib/modules/$KERNELVERSION/kernel/fs/cifs
fi
echo
echo "Build for $KERNELVERSION Linux kernel (headers in $KERNSRC)"
if [ ! -f $KERNSRC/include/linux/version.h ]; then
cat >&2 <<EOF
cat >&2 <<EOF
Error: no kernel headers found at $KERNSRC
Please install package
kernel-headers-modules-XXXX for ALT Linux
kernel-XXXX-devel for FCx / ASP Linux
dkms-linux-cifs for Mandriva 2008
linux-headers-XXXX for Debian / Ubuntu
kernel-source-XXXX for SuSe
kernel-source-XXXX for Slackware / MOPSLinux
kernel-headers-modules-XXXX for ALT Linux
kernel-XXXX-devel for FCx / ASP Linux
dkms-linux-cifs for Mandriva 2008
linux-headers-XXXX for Debian / Ubuntu
kernel-source-XXXX for SuSe
kernel-source-XXXX for Slackware / MOPSLinux
or use KERNSRC variable to set correct location
Exiting...
EOF
exit 1
exit 1
fi
# set GCC version if needed
if [ -f $KERNSRC/gcc_version.inc ] ; then
. $KERNSRC/gcc_version.inc
echo "We in ALT Linux, use GCC $GCC_VERSION"
export GCCNAME=gcc-$GCC_VERSION
export USEGCC="CC=$GCCNAME"
. $KERNSRC/gcc_version.inc
echo "We in $($DISTR_VENDOR -e), use GCC $GCC_VERSION"
export GCCNAME=gcc-$GCC_VERSION
export USEGCC="CC=$GCCNAME"
else
export GCCNAME=gcc
export GCCNAME=gcc
fi
if ! which $GCCNAME ; then
echo "GCC compiler have not found. Please install gcc package."
exit 1
echo "GCC compiler have not found. Please install gcc package."
exit 1
fi
# Clean, build and check
......@@ -96,3 +95,4 @@ install -m 644 -o root -g root $BUILDDIR/$MODULEFILENAME $INSTALL_MOD_PATH/ || e
depmod -ae || exit 1
#echo "$MODULENAME build correctly"
exit 0
#!/bin/sh
#
# linux-cifs CIFS support for Linux kernel
# etercifs CIFS support for Linux kernel
#
# Author: Vitaly Lipatov <lav@etersoft.ru>
#
......@@ -23,103 +23,103 @@ MODULENAME=etercifs
#MODULEPATH=`echo /lib/modules/$(uname -r)/kernel/fs/cifs/$MODULENAME.*`
OUTFORMAT=/etc/init.d/outformat
[ -x $OUTFORMAT ] || OUTFORMAT=/etc/init.d/linux-cifs.outformat
[ -x $OUTFORMAT ] || OUTFORMAT=/etc/init.d/etercifs.outformat
if which tput >/dev/null && test -x $OUTFORMAT ; then
. $OUTFORMAT
. $OUTFORMAT
else
MOVE_TO_COL(){ :; }
SETCOLOR_SUCCESS(){ :; }
SETCOLOR_FAILURE(){ :; }
SETCOLOR_WARNING(){ :; }
SETCOLOR_NORMAL(){ :; }
MOVE_TO_COL(){ :; }
SETCOLOR_SUCCESS(){ :; }
SETCOLOR_FAILURE(){ :; }
SETCOLOR_WARNING(){ :; }
SETCOLOR_NORMAL(){ :; }
fi
# TODO: use printf?
success()
{
MOVE_TO_COL
echo -n '[ '
SETCOLOR_SUCCESS
echo -n 'DONE'
SETCOLOR_NORMAL
echo ' ]'
MOVE_TO_COL
echo -n '[ '
SETCOLOR_SUCCESS
echo -n 'DONE'
SETCOLOR_NORMAL
echo ' ]'
}
failure()
{
MOVE_TO_COL
echo -n '['
SETCOLOR_FAILURE
echo -n 'FAILED'
SETCOLOR_NORMAL
echo ']'
MOVE_TO_COL
echo -n '['
SETCOLOR_FAILURE
echo -n 'FAILED'
SETCOLOR_NORMAL
echo ']'
}
passed()
{
MOVE_TO_COL
echo -n '['
SETCOLOR_WARNING
echo -n 'PASSED'
SETCOLOR_NORMAL
echo ']'
MOVE_TO_COL
echo -n '['
SETCOLOR_WARNING
echo -n 'PASSED'
SETCOLOR_NORMAL
echo ']'
}
get_pid()
{
# TODO: use pgrep
PIDOF=/bin/pidof
if [ -x $PIDOF ] ; then
dpid=`$PIDOF $1`
else
dpid="$(ps axh | grep $1 | grep -v grep | sed -e 's/ *\(.*\)/\1/' -e 's/ \+/ /g' | grep -v " /bin/sh " | grep -v "^$$ " | cut -f1 -d\ | head -1)"
fi
return $dpid
# TODO: use pgrep
PIDOF=/bin/pidof
if [ -x $PIDOF ] ; then
dpid=`$PIDOF $1`
else
dpid="$(ps axh | grep $1 | grep -v grep | sed -e 's/ *\(.*\)/\1/' -e 's/ \+/ /g' | grep -v " /bin/sh " | grep -v "^$$ " | cut -f1 -d\ | head -1)"
fi
return $dpid
}
is_loaded()
{
get_pid $1
test -n "$dpid"
get_pid $1
test -n "$dpid"
}
is_moduled()
{
lsmod | grep "^$MODULENAME" > /dev/null
lsmod | grep "^$MODULENAME" > /dev/null
}
is_origmoduled()
{
lsmod | grep "^$ORIGMODULENAME" > /dev/null
lsmod | grep "^$ORIGMODULENAME" > /dev/null
}
umount_cifs()
{
WASCIFS=
if mount | grep cifs 2>/dev/null ; then
WASCIFS=1
fi
echo -n "Unmounting CIFS resources... "
umount -t cifs -a || { failure ; return 1; }
success
WASCIFS=
if mount | grep cifs 2>/dev/null ; then
WASCIFS=1
fi
echo -n "Unmounting CIFS resources... "
umount -t cifs -a || { failure ; return 1; }
success
}
mount_cifs()
{
echo -n "Mounting CIFS resources... "
mount -t cifs -a || { failure ; return 1; }
success
echo -n "Mounting CIFS resources... "
mount -t cifs -a || { failure ; return 1; }
success
}
load_module()
{
local i
if is_origmoduled ; then
#test -r /proc/fs/cifs/Etersoft && { passed ; return ; }
umount_cifs
echo -n "Removing CIFS kernel module... "
$RMMOD $ORIGMODULENAME || { failure ; return ; }
#test -r /proc/fs/cifs/Etersoft && { passed ; return ; }
umount_cifs
echo -n "Removing CIFS kernel module... "
$RMMOD $ORIGMODULENAME || { failure ; return ; }
fi
# Preload module dependencies
......@@ -133,7 +133,7 @@ load_module()
# echo -n "Incorrect module. Your system: " ; uname -a ; dmesg | tail -n2
#fi
echo -n "$MODULENAME from Etersoft is not found,"
echo -n "you can try compile it with 'service linux-cifs build' command."
echo -n "you can try compile it with 'service etercifs build' command."
failure
}
......@@ -146,7 +146,7 @@ start()
echo 1 > /proc/fs/cifs/Etersoft && success || failure
echo -n "Disable Linux extensions for CIFS..."
echo 0 > /proc/fs/cifs/LinuxExtensionsEnabled && success || failure
test -n "$WASCIFS" && mount_cifs || :
test -n "$WASCIFS" && mount_cifs || :
else
failure
fi
......@@ -164,41 +164,41 @@ stop()
status()
{
local PRECOMP
echo "CIFS module status:"
# FIXME
#if [ "$DEFMODULEPATH" = "$MANMODULEPATH" ] ; then
# PRECOMP="manually built"
#else
# PRECOMP="precompiled"
#fi
if is_origmoduled ; then
echo " origin kernel module $ORIGMODULENAME loaded, Etersoft extensions missed"
fi
if is_moduled ; then
#echo " kernel module $MODULENAME is loaded ($PRECOMP)"
test -d /proc/fs/cifs/ 2>/dev/null || { echo -n "Can't locale /proc/fs/cifs... " ; failure ; }
echo " kernel module $MODULENAME is loaded"
echo -n "Etersoft extensions for CIFS enabled..."
test "`cat /proc/fs/cifs/Etersoft 2>/dev/null`" = "1" && success || failure
echo -n "Unix extensions for CIFS disabled..."
test "`cat /proc/fs/cifs/LinuxExtensionsEnabled 2>/dev/null`" = "1" && failure || success
else
echo " kernel module $MODULENAME is not loaded"
fi
local PRECOMP
echo "CIFS module status:"
# FIXME
#if [ "$DEFMODULEPATH" = "$MANMODULEPATH" ] ; then
#PRECOMP="manually built"
#else
#PRECOMP="precompiled"
#fi
if is_origmoduled ; then
echo " origin kernel module $ORIGMODULENAME loaded, Etersoft extensions missed"
fi
if is_moduled ; then
#echo " kernel module $MODULENAME is loaded ($PRECOMP)"
test -d /proc/fs/cifs/ 2>/dev/null || { echo -n "Can't locale /proc/fs/cifs... " ; failure ; }
echo " kernel module $MODULENAME is loaded"
echo -n "Etersoft extensions for CIFS enabled..."
test "`cat /proc/fs/cifs/Etersoft 2>/dev/null`" = "1" && success || failure
echo -n "Unix extensions for CIFS disabled..."
test "`cat /proc/fs/cifs/LinuxExtensionsEnabled 2>/dev/null`" = "1" && failure || success
else
echo " kernel module $MODULENAME is not loaded"
fi
}
build_module()
{
#DKMS=/sbin/dkms
# && [ -x $DKMS ]
# Need name-version for it
if [ -r @SRC_DIR/dkms.conf ] ; then
echo "TODO: use dkms build/install for build"
else
cd @DATADIR@
sh buildmodule.sh
fi
#DKMS=/sbin/dkms
# && [ -x $DKMS ]
# Need name-version for it
if [ -r @SRC_DIR/dkms.conf ] ; then
echo "TODO: use dkms build/install for build"
else
cd @DATADIR@
sh buildmodule.sh
fi
}
case "$1" in
......@@ -213,7 +213,7 @@ case "$1" in
start
;;
build)
build_module
build_module
;;
status)
status
......@@ -229,6 +229,6 @@ case "$1" in
fi
;;
*)
echo "Usage: linux-cifs {start|stop|restart|build|condrestart|condstop|status}"
echo "Usage: etercifs {start|stop|restart|build|condrestart|condstop|status}"
esac
#!/bin/sh
# Output formatting functions.
# $Id: linux-cifs.outformat,v 1.3 2007/07/27 11:55:53 lav Exp $
# $Id: etercifs.outformat,v 1.3 2007/07/27 11:55:53 lav Exp $
#
# Copyright (C) 2002 Ivan Zakharyaschev <imz@altlinux.ru>.
# Copyright (C) 2002 Dmitry V. Levin <ldv@altlinux.org>.
......@@ -46,53 +46,54 @@ MOVE_TO_COL()
# Set 'success' color (currently: green)
SETCOLOR_SUCCESS()
{
{
echo bold
echo setaf $GREEN
} |tput -S
{
echo bold
echo setaf $GREEN
} |tput -S
}
# Set 'failure' color (currently: red)
SETCOLOR_FAILURE()
{
{
echo bold
echo setaf $RED
} |tput -S
{
echo bold
echo setaf $RED
} |tput -S
}
# Set 'warning' color (currently: yellow)
SETCOLOR_WARNING()
{
{
echo bold
echo setaf $YELLOW
} |tput -S
{
echo bold
echo setaf $YELLOW
} |tput -S
}
# Set 'info' color (currently: cyan)
SETCOLOR_INFO()
{
{
echo bold
echo setaf $CYAN
} |tput -S
{
echo bold
echo setaf $CYAN
} |tput -S
}
# Set 'banner' color (currently: blue on yellow)
SETCOLOR_BANNER()
{
{
echo setaf $BLUE
echo setab $YELLOW
} |tput -S
{
echo setaf $BLUE
echo setab $YELLOW
} |tput -S
}
# Terminal sequence to reset to the default color.
SETCOLOR_NORMAL()
{
{
echo op; # set Original color Pair.
echo sgr0; # turn off all special graphics mode (bold in our case).
} |tput -S
{
{
echo op; # set Original color Pair.
echo sgr0; # turn off all special graphics mode (bold in our case).
} |tput -S
}
......@@ -7,8 +7,8 @@
fatal()
{
echo $@
exit 1
echo $@
exit 1
}
DISTR_VENDOR=/usr/bin/distr_vendor
......@@ -17,33 +17,29 @@ test -x $DISTR_VENDOR || fatal "Can't find distr_vendor"
get_sd()
{
#
BASE_KERNEL_SOURCES_DIR=
BASE_KERNEL_SOURCES_DIR=`grep -i $1 kernel_src.list | head -n1 | cut -d" " -f 2 2>/dev/null`
# etercifs
ETERCIFS_SOURCES_LIST=
ETERCIFS_SOURCES_LIST=`grep -i $1 etercifs_src.list | head -n1 | cut -d" " -f 2 2>/dev/null`
BASE_KERNEL_SOURCES_DIR=
BASE_KERNEL_SOURCES_DIR=`grep -i $1 kernel_src.list | head -n1 | cut -d" " -f 2 2>/dev/null`
ETERCIFS_SOURCES_LIST=
ETERCIFS_SOURCES_LIST=`grep -i $1 etercifs_src.list | head -n1 | cut -d" " -f 2 2>/dev/null`
}
get_src_dir()
{
# :
get_sd `$DISTR_VENDOR -e`
[ -z "$BASE_KERNEL_SOURCES_DIR" ] && get_sd `$DISTR_VENDOR -d`
[ -z "$BASE_KERNEL_SOURCES_DIR" ] && { echo "Unknown `$DISTR_VENDOR -d`, use Generic" ; get_sd Generic ; }
[ -z "$BASE_KERNEL_SOURCES_DIR" ] && return 1
return 0
get_sd `$DISTR_VENDOR -e`
[ -z "$BASE_KERNEL_SOURCES_DIR" ] && get_sd `$DISTR_VENDOR -d`
[ -z "$BASE_KERNEL_SOURCES_DIR" ] && { echo "Unknown `$DISTR_VENDOR -d`, use Generic" ; get_sd Generic ; }
[ -z "$BASE_KERNEL_SOURCES_DIR" ] && return 1
return 0
}
exit_handler()
{
local rc=$?
trap - EXIT
[ -z "$tmpdir" ] || rm -rf -- "$tmpdir"
exit $rc
local rc=$?
trap - EXIT
[ -z "$tmpdir" ] || rm -rf -- "$tmpdir"
exit $rc
}
# :
#/lib/modules/$(shell uname -r)/build
#fatal "Errror in func"
......
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