Pavan Chandrashekar - Sun Microsystems wrote: > James C. McPherson wrote: > >> Pavan Chandrashekar - Sun Microsystems wrote: >> >>> Garrett D'Amore wrote: >>> >>>> "what" is the preferred approach. Looking with strings or for modinfo >>>> string data is probably not ideal, and won't work for most ON drivers. >>>> >> ... >> >>> This only provides the version information in the .comment section. >>> >> Correct. Which is how we do things from build 97 onwards where there >> are no version strings due to the gate being managed by Mercurial. >> >> >>> But I think the question is about the driver version information. >>> >> It is, and that's what "what" provides. >> > > Yep. Missed Mercurial. I was referring only to the ident strings that we > have used so far. I stand corrected. >
The .comment strings have been valid since long before Mercurial. They haven't been the %I% versions, but they have had build numbers (or patch numbers, or for unpatched versions, the FCS version) in them. -- Garrett > Pavan > > >>> I don't know of any command which gives the version information straight >>> away, but i cooked up a script which gives you what you want with some >>> muck which you might need to sift. Here is what I wrote along with the >>> results it gave on some of the ON drivers: >>> >>> # cat /tmp/test >>> strings -N .data -N .rodata -N .rodata1 /kernel/drv/$1 | grep >>> "[0-9][0-9]*\.[0-9][0-9]*" >>> # >>> # chmod +x /tmp/test >>> # /tmp/test e1000g >>> Driver Ver. 5.2.9 >>> Intel PRO/1000 Ethernet 5.2.9 >>> # /tmp/test bge >>> Broadcom Gb Ethernet v0.62 >>> # /tmp/test sd >>> SCSI Disk Driver 1.581 >>> *SUN1.0G* >>> # /tmp/test cmdk >>> Common Direct Access Disk 1.80 >>> >> We have "what" and that's what we use. End of story. >> >> On a Solaris 10 system with patches installed, you'll see >> output such as this >> >> >> $ /usr/ccs/bin/what /kernel/drv/sparcv9/mpt >> /kernel/drv/sparcv9/mpt: >> SunOS 5.10 Generic 137137-08 Aug 2008 >> >> >> Tells you all that you need to know. >> >> James C. McPherson >> -- >> Senior Kernel Software Engineer, Solaris >> Sun Microsystems >> http://blogs.sun.com/jmcp http://www.jmcp.homeunix.com/blog >> _______________________________________________ >> driver-discuss mailing list >> driver-discuss@opensolaris.org >> http://mail.opensolaris.org/mailman/listinfo/driver-discuss >> > > _______________________________________________ > driver-discuss mailing list > driver-discuss@opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/driver-discuss > _______________________________________________ driver-discuss mailing list driver-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/driver-discuss