SHA256
1
0
forked from pool/openafs
openafs/kernel-source.build-modules.sh
David Sterba a7c8d16e59 Accepting request 586757 from home:hauky
Hello,

this package should replace the package openafs18.
The reason for this request is that I would like to
get this software into Factory, but it violaites the nameing
convention. Thus, I decided to have one package "openafs"
with the up-to-date version of the software.
The package "openafs16" should still stay in filesystems.
Once this is accepted, I will create a deletion request
for filesystems/openafs18

Many thanks.

OBS-URL: https://build.opensuse.org/request/show/586757
OBS-URL: https://build.opensuse.org/package/show/filesystems/openafs?expand=0&rev=1
2018-03-14 17:57:49 +00:00

56 lines
1.7 KiB
Bash

#!/bin/sh
if [ $# != 1 ]; then
echo building a openafs-kernel module for the running kernel
echo Need one of: build build_debug install
exit 1
fi
LOGFILE=libafs_tree/build.log
kernel_flavour=`uname -r | awk -F- '{print $NF}'`
kernel_version=`uname -r | sed "s/-$kernel_flavour//"`
arch=`uname -m`
suse_flavour=`cat /etc/SuSE-release | head -1 | awk '{print $1}' `
suse_version=`cat /etc/SuSE-release | grep VERSION | awk '{print $NF}' `
echo This SuSE is version \"$suse_version\" of flavour \"$suse_flavour\"
echo you are running the kernel \"$kernel_version\" of flavour \"$kernel_flavour\" on \"$arch\"
echo all output is saved into $LOGFILE
if [ $1 == "build_debug" ]; then
DEBUG_OPT="--enable-debug-kernel"
fi
if [ $1 == "build" -o $1 == "build_debug" ]; then
cd libafs_tree
echo calling configure...
./configure --with-linux-kernel-headers=/usr/src/linux/ --with-linux-kernel-build=/usr/src/linux-obj/$arch/$kernel_flavour $DEBUG_OPT > build.log 2>&1
if [ $? != 0 ]; then
echo configure failed! See $LOGFILE for details
exit $?
fi
echo calling make
make >> build.log 2>&1
if [ $? != 0 ]; then
echo make failed! See $LOGFILE for details
exit $?
fi
echo
echo build sucessfull!
echo Now run $0 install to install the kernel-modules
exit 0
fi
if [ $1 == "install" ]; then
module_files="afspag.ko libafs.ko"
build_dir=libafs_tree/src/libafs/MODLOAD-$kernel_version-$kernel_flavour-MP/
install_dir=/lib/modules/$kernel_version-$kernel_flavour
echo installing kernel-modules into
for mod in $module_files; do
cp -v $build_dir/$mod $install_dir/$mod
done
/sbin/depmod -a
fi