From 7e1e8ae3668b803156ae1eeb2e51ff7bdb656878 Mon Sep 17 00:00:00 2001 From: Wang Quanxian Date: Tue, 14 Aug 2012 15:35:39 +0800 Subject: [PATCH] Add kernel version for emgd kernel driver intel-emgd-kmod package must be consistent with the kernel version Signed-Off-By Quanxian Wang --- packaging/intel-emgd-kmod.init | 27 ++++++++++----------------- packaging/intel-emgd-kmod.spec | 10 +++++----- 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/packaging/intel-emgd-kmod.init b/packaging/intel-emgd-kmod.init index 1a77b32..9746a80 100755 --- a/packaging/intel-emgd-kmod.init +++ b/packaging/intel-emgd-kmod.init @@ -68,24 +68,17 @@ find_board_type() { platform="unknown" set_config() { boardname=`find_board_type $platform` - echo "Boardname is $boardname" configid=3 - case $boardname in - Russellville) - configid=1 - ;; - CrownBay) - configid=2 - ;; - NextCom) - configid=3 - ;; - CrossvilleOKI) - configid=1 - ;; - esac - echo "Configid is $configid" - modprobe emgd configid=$configid + if [ $boardname == 'CrownBay' ] + then + configid=2 + elif [ $boardname == 'Russellville' ] || [ $boardname == 'CrossvilleOKI' ] + then + configid=1 + fi + + echo "Boardname is $boardname, configid=$configid" + /sbin/modprobe emgd configid=$configid } set_config exit $? diff --git a/packaging/intel-emgd-kmod.spec b/packaging/intel-emgd-kmod.spec index e14483d..3adefe4 100644 --- a/packaging/intel-emgd-kmod.spec +++ b/packaging/intel-emgd-kmod.spec @@ -20,8 +20,8 @@ # THE SOFTWARE. #---------------------------------------------------------------------------- -%define debug_package %{nil} -%define modpath %(ls -d /lib/modules/*/kernel)/drivers/gpu/drm/emgd +%define kernel_version %(ls -d /lib/modules/*automotive|sed "s:/lib/modules/::") +%define modpath /lib/modules/%{kernel_version}/kernel/drivers/gpu/drm/emgd Name: intel-emgd-kmod Summary: Intel EMGD kernel module @@ -35,7 +35,7 @@ Source0: %{name}-%{version}.tar.gz Source1: intel-emgd-kmod.service Source2: intel-emgd-kmod.init BuildRequires: kernel-adaptation-intel-automotive-devel, kmod - +Requires: pciutils, kmod %description Intel EMGD kernel module for kernel @@ -60,7 +60,7 @@ rm -Rf $RPM_BUILD_ROOT %post ## create the dependency of kernel modules -/sbin/depmod -a >/dev/null 2>&1 +/sbin/depmod -av %{kernel_version} >/dev/null 2>&1 mkdir -p /usr/lib/systemd/system/basic.target.wants/ pushd /usr/lib/systemd/system/basic.target.wants/ @@ -73,7 +73,7 @@ if [ -x /bin/systemctl ]; then fi %postun -/sbin/depmod -a >/dev/null 2>&1 +/sbin/depmod -av %{kernel_version} >/dev/null 2>&1 rm -f /usr/lib/systemd/system/basic.target.wants/intel-emgd-kmod.service if [ -x /bin/systemctl ]; then systemctl daemon-reload >/dev/null 2>&1 || : -- 2.7.4