==================PKGBUILD====================
# $Id: PKGBUILD 2013-06-26 GunsNRose $
# Maintainer: GunsNRose <zlbgps AT gmail.com>
# Contributor: GunsNRose <zlbgps AT gmail.com>
pkgname=exfat-nofuse-git
_pkgname=${pkgname/-git}
pkgver=20140201
pkgrel=1
pkgdesc="Free exFAT file system implementation kernel module"
arch=('i686' 'x86_64')
url="https://github.com/rxrz/exfat-nofuse"
license=('GPL3')
depends=('linux>=3.13' 'linux<3.14')
makedepends=('git' 'linux-headers>=3.13' 'linux-headers<3.14')
install="${_pkgname}.install"
optdepends=('exfat-utils: utilities for exFAT file system'
'util-linux: to mount exFAT volumes automatically')
_gitroot="https://github.com/rxrz/${_pkgname}.git"
_gitname="$_pkgname"
build() {
echo "_pkgname = ${_pkgname}"
real_build_dir=$srcdir/${_gitname}_build
echo "real_build_dir =$real_build_dir"
cd $srcdir
if [ -d $_gitname ]; then
cd $_gitname && git pull origin || return 1
else
git clone $_gitroot || return 1
fi
if [ -d ${real_build_dir} ] ; then
rm -rf ${real_build_dir}
fi
cp -a $srcdir/$_gitname ${real_build_dir}
cd ${real_build_dir}
export LC_ALL=C
export LANG=C
_kernver=${_kernver:-$(uname -r)}
_extramodules=$(readlink -f "/usr/lib/modules/${_kernver}/extramodules" || true)
_kernver=$(< "${_extramodules}/version")
echo "<<<<< _kernver = $_kernver >>>>>>"
sed -i -e 's/MODULE_LICENSE("Samsung Proprietary")/MODULE_LICENSE("GPL")/g' exfat_super.c
make || return 1
#make -f Makefile.module || return 1
}
package() {
real_build_dir=$srcdir/${_gitname}_build
echo "real_build_dir =$real_build_dir"
cd ${real_build_dir} || return 1
#cd "$srcdir/$_gitname" || return 1
_kernver=${_kernver:-$(uname -r)}
_extramodules=$(readlink -f "/usr/lib/modules/${_kernver}/extramodules" || true)
_kernver=$(< "${_extramodules}/version")
# replcae ${_pkgname}-${pkgver}" --> ${_pkgname}
make -C "${_extramodules%/*}/${_kernver}/build" \
INSTALL_MOD_PATH="${pkgdir}/${_extramodules%%/lib/*}" \
M="${real_build_dir}" modules_install
cd "${pkgdir}/${_extramodules%/*}"
mv "${_kernver}/extra" "${_extramodules##*/}"
rmdir "${_kernver}"
# compress kernel modules
find "${pkgdir}" -name "*.ko" -exec gzip -9 {} +
# load module on startup
#echo exfat-fs > "${srcdir}/${_pkgname}.conf"
echo exfat > "${srcdir}/${_pkgname}.conf"
install -Dm644 "${srcdir}/${_pkgname}.conf" "${pkgdir}/usr/lib/modules-load.d/${_pkgname}.conf"
# update kernel version in install file
sed -ri "s#^(extramodules=).*\$#\1${_extramodules}#" "${startdir}/${_pkgname}.install"
}
==================
exfat-nofuse.install 内容
extramodules=/usr/lib/modules/extramodules-3.10-ARCH
post_install() {
depmod -v $(< "$extramodules/version") &>/dev/null
}
post_upgrade() {
post_install
}
post_remove() {
post_install
}