linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* regarding lspci
@ 2006-07-11  9:29 rahul
  2006-07-11  9:42 ` Mark Zhan
  2006-07-11  9:47 ` Claus Gindhart
  0 siblings, 2 replies; 7+ messages in thread
From: rahul @ 2006-07-11  9:29 UTC (permalink / raw)
  To: linuxppc-embedded list, ilugc

Hi All

My target system is  powerpc , linux-2.6.11.
when i give the lspci in my target system , it says "can't find the 
command".
I have seen in the ramdisk directory, i could not see the lspci utility 
or pci utilities. Even in the busybox i could not find the utility.
In linux i have enabled the pci support.

How to get the utility to busybox. I have searched in the net but could 
not succeed.
Can anyone please help me in this regard. plz correct me if i am missing 
some basic configuration .

Thanks & Regards
Rahul

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: regarding lspci
  2006-07-11  9:29 regarding lspci rahul
@ 2006-07-11  9:42 ` Mark Zhan
  2006-07-11  9:47 ` Claus Gindhart
  1 sibling, 0 replies; 7+ messages in thread
From: Mark Zhan @ 2006-07-11  9:42 UTC (permalink / raw)
  To: rahul; +Cc: ilugc, linuxppc-embedded list

It seems that busybox doesn't support lspci command.

rahul 写道:
> Hi All
> 
> My target system is  powerpc , linux-2.6.11.
> when i give the lspci in my target system , it says "can't find the 
> command".
> I have seen in the ramdisk directory, i could not see the lspci utility 
> or pci utilities. Even in the busybox i could not find the utility.
> In linux i have enabled the pci support.
> 
> How to get the utility to busybox. I have searched in the net but could 
> not succeed.
> Can anyone please help me in this regard. plz correct me if i am missing 
> some basic configuration .
> 
> Thanks & Regards
> Rahul
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: regarding lspci
  2006-07-11  9:29 regarding lspci rahul
  2006-07-11  9:42 ` Mark Zhan
@ 2006-07-11  9:47 ` Claus Gindhart
  2006-07-11 10:47   ` rahul
  1 sibling, 1 reply; 7+ messages in thread
From: Claus Gindhart @ 2006-07-11  9:47 UTC (permalink / raw)
  To: linuxppc-embedded; +Cc: ilugc

Rahul,

you need to download the pciutils (e.g. 2.1.11) tarball, and cross compile it 
for PPC.

However, i had to patch the configure script to make it cross-compilable. Here 
is the patch

---------------------------8-<-----------------------------------------------
diff -Nurd pciutils-2.1.11.ori/lib/configure pciutils-2.1.11/lib/configure
--- pciutils-2.1.11.ori/lib/configure   2003-01-04 13:29:23.000000000 +0100
+++ pciutils-2.1.11/lib/configure       2006-05-29 11:08:00.000000000 +0200
@@ -12,17 +12,20 @@
 echo_n "Configuring libpci for your system..."
 sharedir=${1:-/usr/share}
 version=${2:-0.0}
-sys=`uname -s`
-rel=`uname -r`
-if [ "$sys" = "AIX" -a -x /usr/bin/oslevel -a -x /usr/sbin/lsattr ]
-then
-       rel=`/usr/bin/oslevel`
-       proc=`/usr/sbin/lsdev -C -c processor -S available -F name | head -1`
-       cpu=`/usr/sbin/lsattr -F value -l $proc -a type | sed 's/_.*//'`
-else
-       cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/'`
-fi
-echo " $sys/$cpu $rel"
+sys=Linux
+rel=2.6.13
+cpu=ppc
+#sys=`uname -s`
+#rel=`uname -r`
+#if [ "$sys" = "AIX" -a -x /usr/bin/oslevel -a -x /usr/sbin/lsattr ]
+#then
+#      rel=`/usr/bin/oslevel`
+#      proc=`/usr/sbin/lsdev -C -c processor -S available -F name | head -1`
+#      cpu=`/usr/sbin/lsattr -F value -l $proc -a type | sed 's/_.*//'`
+#else
+#      cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/'`
+#fi
+#echo " $sys/$cpu $rel"
 
 c=config.h
 echo >$c "#define ARCH_`echo $cpu | tr 'a-z' 'A-Z'`"
---------------------------8-<-----------------------------------------------

For the build, i called
export CROSS=$(CROSS_COMPILE)
make HOST=$(ARCH)

However, depending on your environment, it might by slightly different in your 
case.


On Tuesday 11 July 2006 11:29, rahul wrote:
> Hi All
> 
> My target system is  powerpc , linux-2.6.11.
> when i give the lspci in my target system , it says "can't find the 
> command".
> I have seen in the ramdisk directory, i could not see the lspci utility 
> or pci utilities. Even in the busybox i could not find the utility.
> In linux i have enabled the pci support.
> 
> How to get the utility to busybox. I have searched in the net but could 
> not succeed.
> Can anyone please help me in this regard. plz correct me if i am missing 
> some basic configuration .
> 
> Thanks & Regards
> Rahul
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> 

-- 
Mit freundlichen Gruessen / Best regards

Claus Gindhart
SW R&D
Kontron Modular Computers
phone :++49 (0)8341-803-374
ailto:claus.gindhart@kontron-modular.com
http://www.kontron.com

-----BEGIN GEEK CODE BLOCK-----
  Version: 3.1
  GU d- s++:>++:+ a+ C++$ !U !P L++>$ E-- W+(-) N- o?
  K? w !O !M V !PS PE- Y+ PGP+ t 5? X R* tv- b+ DI+++
  D-- G e++> h--- !r x+++
------END GEEK CODE BLOCK------

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: regarding lspci
  2006-07-11  9:47 ` Claus Gindhart
@ 2006-07-11 10:47   ` rahul
  2006-07-11 11:59     ` Sergei Shtylyov
  2006-07-11 12:04     ` Claus Gindhart
  0 siblings, 2 replies; 7+ messages in thread
From: rahul @ 2006-07-11 10:47 UTC (permalink / raw)
  To: Claus Gindhart; +Cc: ilugc, linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 3253 bytes --]

Hi Claus.Gindhart

I am facing some problem in applying the patch.

I have copied the pacth to a file "patch-pciutils"

[root@localhost pciutils-2.1.11]# file patch-pciutils
patch-pciutils: 'diff' output text
[root@localhost pciutils-2.1.11]#
when i gave the command :
[root@localhost pciutils-2.1.11]# patch -p1 patch-pciutils
.
.
Nothing happens even after 3/4 minutes...so i am stopping it by ctrl+c.
None of the files are edited.

In the patch u sent , let me know wether it is complete one or configure 
file is left as it is after the lines
c=config.h
echo >$c "#define ARCH_`echo $cpu | tr 'a-z' 'A-Z'`"

Thanks & Regards
Rahul

 




Claus Gindhart wrote:

>Rahul,
>
>you need to download the pciutils (e.g. 2.1.11) tarball, and cross compile it 
>for PPC.
>
>However, i had to patch the configure script to make it cross-compilable. Here 
>is the patch
>
>---------------------------8-<-----------------------------------------------
>diff -Nurd pciutils-2.1.11.ori/lib/configure pciutils-2.1.11/lib/configure
>--- pciutils-2.1.11.ori/lib/configure   2003-01-04 13:29:23.000000000 +0100
>+++ pciutils-2.1.11/lib/configure       2006-05-29 11:08:00.000000000 +0200
>@@ -12,17 +12,20 @@
> echo_n "Configuring libpci for your system..."
> sharedir=${1:-/usr/share}
> version=${2:-0.0}
>-sys=`uname -s`
>-rel=`uname -r`
>-if [ "$sys" = "AIX" -a -x /usr/bin/oslevel -a -x /usr/sbin/lsattr ]
>-then
>-       rel=`/usr/bin/oslevel`
>-       proc=`/usr/sbin/lsdev -C -c processor -S available -F name | head -1`
>-       cpu=`/usr/sbin/lsattr -F value -l $proc -a type | sed 's/_.*//'`
>-else
>-       cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/'`
>-fi
>-echo " $sys/$cpu $rel"
>+sys=Linux
>+rel=2.6.13
>+cpu=ppc
>+#sys=`uname -s`
>+#rel=`uname -r`
>+#if [ "$sys" = "AIX" -a -x /usr/bin/oslevel -a -x /usr/sbin/lsattr ]
>+#then
>+#      rel=`/usr/bin/oslevel`
>+#      proc=`/usr/sbin/lsdev -C -c processor -S available -F name | head -1`
>+#      cpu=`/usr/sbin/lsattr -F value -l $proc -a type | sed 's/_.*//'`
>+#else
>+#      cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/'`
>+#fi
>+#echo " $sys/$cpu $rel"
> 
> c=config.h
> echo >$c "#define ARCH_`echo $cpu | tr 'a-z' 'A-Z'`"
>---------------------------8-<-----------------------------------------------
>
>For the build, i called
>export CROSS=$(CROSS_COMPILE)
>make HOST=$(ARCH)
>
>However, depending on your environment, it might by slightly different in your 
>case.
>
>
>On Tuesday 11 July 2006 11:29, rahul wrote:
>  
>
>>Hi All
>>
>>My target system is  powerpc , linux-2.6.11.
>>when i give the lspci in my target system , it says "can't find the 
>>command".
>>I have seen in the ramdisk directory, i could not see the lspci utility 
>>or pci utilities. Even in the busybox i could not find the utility.
>>In linux i have enabled the pci support.
>>
>>How to get the utility to busybox. I have searched in the net but could 
>>not succeed.
>>Can anyone please help me in this regard. plz correct me if i am missing 
>>some basic configuration .
>>
>>Thanks & Regards
>>Rahul
>>_______________________________________________
>>Linuxppc-embedded mailing list
>>Linuxppc-embedded@ozlabs.org
>>https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>>
>>    
>>
>
>  
>


[-- Attachment #2: Type: text/html, Size: 3918 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: regarding lspci
  2006-07-11 10:47   ` rahul
@ 2006-07-11 11:59     ` Sergei Shtylyov
  2006-07-11 12:04     ` Claus Gindhart
  1 sibling, 0 replies; 7+ messages in thread
From: Sergei Shtylyov @ 2006-07-11 11:59 UTC (permalink / raw)
  To: rahul; +Cc: linuxppc-embedded

Hello.

rahul wrote:

> I am facing some problem in applying the patch.

> I have copied the pacth to a file "patch-pciutils"

> [root@localhost pciutils-2.1.11]# file patch-pciutils
> patch-pciutils: 'diff' output text
> [root@localhost pciutils-2.1.11]#
> when i gave the command :
> [root@localhost pciutils-2.1.11]# patch -p1 patch-pciutils
> .
> .
> Nothing happens even after 3/4 minutes...so i am stopping it by ctrl+c.
> None of the files are edited.

    No wonder, patch(1) expects the patch to be fed thru stdin, so you should 
have typed:

patch -p1 < patch-pciutils

> Thanks & Regards
> Rahul

WBR, Sergei

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: regarding lspci
  2006-07-11 10:47   ` rahul
  2006-07-11 11:59     ` Sergei Shtylyov
@ 2006-07-11 12:04     ` Claus Gindhart
  2006-07-12  7:10       ` sudheer
  1 sibling, 1 reply; 7+ messages in thread
From: Claus Gindhart @ 2006-07-11 12:04 UTC (permalink / raw)
  To: rahul; +Cc: ilugc, linuxppc-embedded

Hi Rahul,

Maybe, its better, if you do the modification by hand. This has the advantage, 
that you know, what happens.

Just, search for the following lines
--------------8-<----------------------
sys=`uname -s`
rel=`uname -r`
if [ "$sys" = "AIX" -a -x /usr/bin/oslevel -a -x /usr/sbin/lsattr ]
then
      rel=`/usr/bin/oslevel`
      proc=`/usr/sbin/lsdev -C -c processor -S available -F name | head -1`
      cpu=`/usr/sbin/lsattr -F value -l $proc -a type | sed 's/_.*//'`
else
      cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/'`
fi
echo " $sys/$cpu $rel"
--------------8-<----------------------

Comment them out; they can not work, when cross compiling, because they try to 
detect Kernel version and architecture by using host tools

Then, add the following lines

--------------8-<----------------------
sys=Linux
rel=2.6.13 (or whatever Kernel version you have)
cpu=ppc
--------------8-<----------------------



-- 
Mit freundlichen Gruessen / Best regards

Claus Gindhart
SW R&D
Kontron Modular Computers
phone :++49 (0)8341-803-374
mailto:claus.gindhart@kontron-modular.com
http://www.kontron.com

-----BEGIN GEEK CODE BLOCK-----
  Version: 3.1
  GU d- s++:>++:+ a+ C++$ !U !P L++>$ E-- W+(-) N- o?
  K? w !O !M V !PS PE- Y+ PGP+ t 5? X R* tv- b+ DI+++
  D-- G e++> h--- !r x+++
------END GEEK CODE BLOCK------

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: regarding lspci
  2006-07-11 12:04     ` Claus Gindhart
@ 2006-07-12  7:10       ` sudheer
  0 siblings, 0 replies; 7+ messages in thread
From: sudheer @ 2006-07-12  7:10 UTC (permalink / raw)
  To: Claus Gindhart; +Cc: linuxppc-embedded, ilugc

Hi Claus.Gindhart

Thanks for patch.
I have tried the same and could do it.
I have modified the lib/configure file manually and gave the following 
command
#make  CC=powerpc-linux-gcc
I could get the lspci, setpci commands.
Need to test this with my target board. Let you know after testing.


But when i tried with applying patch directly.. i got the following error:
[root@localhost pciutils-2.1.11]# patch -p1 < patch-pciutils
patching file lib/configure
Hunk #1 FAILED at 12.
1 out of 1 hunk FAILED -- saving rejects to file lib/configure.rej
[root@localhost pciutils-2.1.11]#
I have just copy pasted the patch from my mail and tried.

Thanks & Regards
Sudheer


Claus Gindhart wrote:

>Hi Rahul,
>
>Maybe, its better, if you do the modification by hand. This has the advantage, 
>that you know, what happens.
>
>Just, search for the following lines
>--------------8-<----------------------
>sys=`uname -s`
>rel=`uname -r`
>if [ "$sys" = "AIX" -a -x /usr/bin/oslevel -a -x /usr/sbin/lsattr ]
>then
>      rel=`/usr/bin/oslevel`
>      proc=`/usr/sbin/lsdev -C -c processor -S available -F name | head -1`
>      cpu=`/usr/sbin/lsattr -F value -l $proc -a type | sed 's/_.*//'`
>else
>      cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/'`
>fi
>echo " $sys/$cpu $rel"
>--------------8-<----------------------
>
>Comment them out; they can not work, when cross compiling, because they try to 
>detect Kernel version and architecture by using host tools
>
>Then, add the following lines
>
>--------------8-<----------------------
>sys=Linux
>rel=2.6.13 (or whatever Kernel version you have)
>cpu=ppc
>--------------8-<----------------------
>
>
>
>  
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-07-12  7:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-11  9:29 regarding lspci rahul
2006-07-11  9:42 ` Mark Zhan
2006-07-11  9:47 ` Claus Gindhart
2006-07-11 10:47   ` rahul
2006-07-11 11:59     ` Sergei Shtylyov
2006-07-11 12:04     ` Claus Gindhart
2006-07-12  7:10       ` sudheer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).