[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: uname



Tom Deblauwe wrote:
>> fix whatever you are compiling to not rely on uname -r, but use KVERS or
>> similar (which can be set by the user).
> 
> I would rather not do this if possible.

well, if the driver is sane, it does this already correctly through the
kbuild stuff and you should not be needing to change anything. however..

> I'm compiling a latest version of the r8169 driver, you can find it
> here:
> http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&PNid=4&PFid=4&Level=5&Conn=4&DownTypeID=3&GetDown=false&Downloads=true
> <http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&PNid=4&PFid=4&Level=5&Conn=4&DownTypeID=3&GetDown=false&Downloads=true>

just for making sure you're not potentially wasting time: that driver is
included in linux mainline. if you are building a lenny image and
requiring a newer kernel in order to get a newer version of the driver
for your hardware, but you're not depending on bleeding edge, you can
use the 2.6.30 kernel backports for lenny from here:

http://backports.undebian.org/repositories/backports-kernel/

>> ultima ratio would be to temporary divert uname as long as the hook is
>> running, and have faked one that reports whatever the software is
>> expecting.
>>   
> maybe this will be best, but the an interesting point is: how do I know
> the version automatically, without updating it each time I use a new
> kernel version? Or should I just check with "dpkg --list|grep
> linux-image" what is installed? Or should I check the /lib/modules
> directory and use the most recent name of the directory starting with
> 2.6....?

well, we havent seen the hook of yours, but i would just loop over the
whole thing, something like (pseudo code):

---snip---
for VERSION in $(ls /lib/modules)
do
	mv /bin/uname /bin/uname.orig

cat > /bin/uname << EOF
#!/bin/sh

echo ${VERSION}
EOF

	chmod 755 /bin/uname

	<whatever commands you have to use to unpack and prepare the
         module sources>

        <whatever commands you have to use to build the module binary>

        <whatever commands you have to use to install your module
         binary into /lib/modules/${VERSION}/updates>

        <whatever commands you have to use to remove the module source
         tree>

        mv /bin/uname.orig /bin/uname
done
---snap---

Hope that helps.

Regards,
Daniel

-- 
Address:        Daniel Baumann, Burgunderstrasse 3, CH-4562 Biberist
Email:          daniel.baumann@panthera-systems.net
Internet:       http://people.panthera-systems.net/~daniel-baumann/


Reply to: