[dpdk-dev,v2] Modify tools/setup.sh to be compatible with fedora 21

Message ID 1412851718-13728-1-git-send-email-danielx.t.mrzyglod@intel.com (mailing list archive)
State Superseded, archived
Headers

Commit Message

Daniel Mrzyglod Oct. 9, 2014, 10:48 a.m. UTC
  script was expecting /lib/modules/$(uname -r)/kernel/drivers/uio/uio.ko but in fedora 21
there are Compressed kernel modules - xz (LZMA)

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
---
 tools/setup.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Stephen Hemminger Oct. 9, 2014, 3:16 p.m. UTC | #1
On Thu,  9 Oct 2014 11:48:38 +0100
Daniel Mrzyglod <danielx.t.mrzyglod@intel.com> wrote:

> script was expecting /lib/modules/$(uname -r)/kernel/drivers/uio/uio.ko but in fedora 21
> there are Compressed kernel modules - xz (LZMA)
> 
> Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
> ---
>  tools/setup.sh | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/setup.sh b/tools/setup.sh
> index 369e09e..14e319c 100755
> --- a/tools/setup.sh
> +++ b/tools/setup.sh
> @@ -169,7 +169,8 @@ load_igb_uio_module()
>  
>  	/sbin/lsmod | grep -s uio > /dev/null
>  	if [ $? -ne 0 ] ; then
> -		if [ -f /lib/modules/$(uname -r)/kernel/drivers/uio/uio.ko ] ; then
> +		sudo modinfo uio > /dev/null
> +		if [ $? -eq 0 ]; then
>  			echo "Loading uio module"
>  			sudo /sbin/modprobe uio
>  		fi

You don't need sudo to run modinfo
  
Neil Horman Oct. 9, 2014, 4:39 p.m. UTC | #2
On Thu, Oct 09, 2014 at 08:16:04AM -0700, Stephen Hemminger wrote:
> On Thu,  9 Oct 2014 11:48:38 +0100
> Daniel Mrzyglod <danielx.t.mrzyglod@intel.com> wrote:
> 
> > script was expecting /lib/modules/$(uname -r)/kernel/drivers/uio/uio.ko but in fedora 21
> > there are Compressed kernel modules - xz (LZMA)
> > 
> > Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
> > ---
> >  tools/setup.sh | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tools/setup.sh b/tools/setup.sh
> > index 369e09e..14e319c 100755
> > --- a/tools/setup.sh
> > +++ b/tools/setup.sh
> > @@ -169,7 +169,8 @@ load_igb_uio_module()
> >  
> >  	/sbin/lsmod | grep -s uio > /dev/null
> >  	if [ $? -ne 0 ] ; then
> > -		if [ -f /lib/modules/$(uname -r)/kernel/drivers/uio/uio.ko ] ; then
> > +		sudo modinfo uio > /dev/null
> > +		if [ $? -eq 0 ]; then
> >  			echo "Loading uio module"
> >  			sudo /sbin/modprobe uio
> >  		fi
> 
> You don't need sudo to run modinfo
> 

Right.  Other than that though, looks good.
Neil
  

Patch

diff --git a/tools/setup.sh b/tools/setup.sh
index 369e09e..14e319c 100755
--- a/tools/setup.sh
+++ b/tools/setup.sh
@@ -169,7 +169,8 @@  load_igb_uio_module()
 
 	/sbin/lsmod | grep -s uio > /dev/null
 	if [ $? -ne 0 ] ; then
-		if [ -f /lib/modules/$(uname -r)/kernel/drivers/uio/uio.ko ] ; then
+		sudo modinfo uio > /dev/null
+		if [ $? -eq 0 ]; then
 			echo "Loading uio module"
 			sudo /sbin/modprobe uio
 		fi