Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 38017

Summary: first stab at a ndiswrapper ebuild
Product: Gentoo Linux Reporter: jbooth
Component: New packagesAssignee: Mobile Herd (OBSOLETE) <mobile+disabled>
Status: RESOLVED FIXED    
Severity: enhancement CC: lars, mtaylor, scootersmk, stevenwagner, x86-kernel
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: ebuild for ndiswrapper
Another ebuild
fixes
should work for 2.6
version that works with 2.6
sandbox fix

Description jbooth 2004-01-12 17:11:57 UTC
Works fine, except doesn't play nice with sandbox. Nobody wanted to talk to me to give me any hints how to work around it, so I guess someone else gets to fix it, then maybe I can learn from what they did.

No other ebuilds that did kernel installs were enlightening unfortunatly.

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 jbooth 2004-01-12 17:12:57 UTC
Created attachment 23709 [details]
ebuild for ndiswrapper
Comment 2 scootersmk 2004-01-17 18:50:08 UTC
Just finished making an install doc for this in the forums.

Link:http://forums.gentoo.org/viewtopic.php?p=786853#786853

I was getting ready to make an ebuild myself before i came apon this one.  I'll test out the ebuild in a minute.  

Is there anyway we could incorperate some more of the install process into the ebuild.  I do not know if that would be possible with all the different card dependent drivers.  Or maybe we could just put an einfo line in the ebuild with the forum link to the doc?  Just some suggestions.

Also, could someone please post on here if this gets into portage so I can update my doc.
Comment 3 Matthew Taylor 2004-01-20 10:53:20 UTC
Created attachment 24140 [details]
Another ebuild

Dose a bit more setup. Have tested it only on 2.4 so far.
Comment 4 scootersmk 2004-01-20 19:12:45 UTC
Towards the end of your ebuild you started typing ndiswapper instead of ndiswrapper.  So needless to say it failed.  I will fix it if I get a chance tonight.
Comment 5 scootersmk 2004-01-20 19:36:43 UTC
OK I think I see the reason you did this, because there is already a ndiswrapper module.  Hows about we call it ndiswrap.

And another thing, from everyting i read in ndiswrapper's docs all you needed to do was 
make install (in ndiswrapper directory)

and 

make (in ndiswrapper/utils)

Im not sure why you are doing it differently, I was just going by the doc.
Comment 6 Matthew Taylor 2004-01-20 20:12:34 UTC
make install would probably not work with ebuild's sandbox.  The 'ndiswapper' is just a typo. Should still work though
Comment 7 Matthew Taylor 2004-01-20 20:33:05 UTC
Created attachment 24155 [details]
fixes

delete /etc/modules.d/ndiswapper if it exists
Comment 8 scootersmk 2004-01-20 21:10:13 UTC
There is still a problem that I cannot seem to figure out.  For some reason make (in the drivers directory) is failing because it is detecting the wrong ${ARCH}.  If you change the command to make || die you will see the error.

I also am not sure if your recent change is going to work because there is already   a "ndiswrapper" module.  That is the reason for in the INSTALL and in my doc, on the forums, there was a module called "wlan0" created.

Are you testing these ebuilds? I am trying to figure out where the problem is because i can install it by hand with no problem, but it fails in the ebuild.

I'll keep hacking...
Comment 9 scootersmk 2004-01-20 21:13:27 UTC
One more thing, it might be a 2.6 kernel problem, because I just noticed you have tested only on 2.4.  Can anyone else test this on 2.6?
Comment 10 Matthew Taylor 2004-01-20 21:59:26 UTC
I don't have a problem compiling which is probably because I am using 2.4. Try changing it to    

ARCH="i386" make || die

the ebuild dose the setup for 2.4 but gentoo's modules-update should hopefully automatically convert the modules.conf to modprobe.conf for 2.6.   


Where dose the other ndiswrapper module come from is it another ebuild. Feel free to change it dose.  
Comment 11 Matthew Taylor 2004-01-21 15:02:48 UTC
Created attachment 24201 [details]
should work for 2.6
Comment 12 Matthew Taylor 2004-01-21 15:33:24 UTC
Created attachment 24202 [details]
version that works with 2.6

changed eth1 to wlan0
Comment 13 Matthew Taylor 2004-01-25 10:36:53 UTC
Created attachment 24399 [details]
sandbox fix
Comment 14 Steven Wagner 2004-02-21 02:40:32 UTC
What is the status of this?  I noticed development has come to a stop.  Can we get this commited to portage now?  Masked for now seems to make sense.
Comment 15 Peter Johanson (RETIRED) gentoo-dev 2004-02-21 03:16:08 UTC
Hey,

i finally got this bug on my list a little while ago. I'm away at a con this weekend, but i'll get this in next week. I've had to clean up the ebuild, a few things:

1) perl to do what "sed" was written for == no no. ebuilds are basically bash on speed, so you should try to stick to basic utilities and not bother loading perl if you don't need it.

2) Ebuilds should be "location agnostic." i.e. they should not rely on being on the machine that the ebuild is aimed at. I'll be moving the hardware detection to a config() function and adding some einfo in pkg_postinst so people can run that if they want to.

sorry for the delay. (:
Comment 16 Peter Johanson (RETIRED) gentoo-dev 2004-02-28 20:24:19 UTC
Okay, so an initial version of this has been added to the ebuild. Most of the vendor and device ID detection code was moved to a pkg_config() function which people can run after installing the driver. For now, the 2.6 sandbox issue is unfixed, pending the major 2.6 module work being done in bug #32737

Thanks for the initial ebuild! Leaving marked NEW til a final version with better 2.6 support is done.
Comment 17 Serge Canizares 2004-03-06 14:48:02 UTC
Hi.

I tried emerging this ebuild, but the compile failed. I'm using the gentoo-sources 2.4.22-r7 kernel. Here's the output:

arachne root # ACCEPT_KEYWORDS="~x86" emerge net-wireless/ndiswrapper
Calculating dependencies ...done!
>>> emerge (1 of 1) net-wireless/ndiswrapper-0.4 to /
>>> md5 src_uri ;-) ndiswrapper-0.4.tar.gz
>>> Unpacking source...
 * /usr/src/linux is a symbolic link
 * Determining the real directory of the Linux kernel source code
 * Building for Linux 2.4.22-gentoo-r7 found in /usr/src/linux
>>> Unpacking ndiswrapper-0.4.tar.gz to /var/tmp/portage/ndiswrapper-0.4/work
>>> Source unpacked.
make -C driver
make[1]: Entering directory `/var/tmp/portage/ndiswrapper-0.4/work/ndiswrapper/driver'
make[1]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
gcc -march=pentium3 -O3 -pipe -DTEST_PM -DEXPORT_SYMTAB -DMODVERSIONS -include //usr/src/linux/include/linux/modversions.h -DLINUX -D__KERNEL__ -DMODULE -I//usr/src/linux/include -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strict-aliasing -pipe -mpreferred-stack-boundary=2 -O2   -c -o wrapper.o wrapper.c
wrapper.c:1126: error: variable `ndis_ethtool_ops' has initializer but incomplete type
wrapper.c:1127: error: unknown field `get_link' specified in initializer
wrapper.c:1127: warning: excess elements in struct initializer
wrapper.c:1127: warning: (near initialization for `ndis_ethtool_ops')
wrapper.c: In function `setup_dev':
wrapper.c:1613: error: structure has no member named `ethtool_ops'
wrapper.c: At top level:
wrapper.c:1126: error: storage size of `ndis_ethtool_ops' isn't known
make[1]: *** [wrapper.o] Error 1
make[1]: Leaving directory `/var/tmp/portage/ndiswrapper-0.4/work/ndiswrapper/driver'
make: *** [all] Error 2
 
!!! ERROR: net-wireless/ndiswrapper-0.4 failed.
!!! Function src_compile, Line 32, Exitcode 2
!!! (no error message)
Comment 18 Peter Johanson (RETIRED) gentoo-dev 2004-03-06 15:12:35 UTC
It seems the v0.4 ov ndiswrapper requires a linux kernel of at least 2.4.23. I'll try to get a v0.3 ebuild in to portage, as apparently this works with slightly older kernels. You can either test with a newer kernel, and report back, or wait til 0.3 is available and try that.
Comment 19 Peter Johanson (RETIRED) gentoo-dev 2004-03-06 15:45:06 UTC
Okay, i've just added version 0.3 to portage. Please test that if you've not upgraded your kernel.
Comment 20 Serge Canizares 2004-03-06 18:37:40 UTC
I should have read the INSTALL file in the portage working dir and noticed the >=2.4.23 requirement!

I migrated to the gs-sources kernel 2.4.25, and now the ebuild compiled nicely and I'm successfully using the min-pci 54g wireless nic in my Dell Inspiron 8500.
That's pretty darn exciting.

Could I suggest that you mod the ebuild to print out a message pointing that out? Might help others figure out what to do.
Comment 21 Tim Yamin (RETIRED) gentoo-dev 2004-03-07 01:10:53 UTC
OK, a few suggestions:

1) ``uname'' should not be used anywhere, use the provided-by-Portage check_kv
   function which uses /usr/src/linux. You can then implement check_KV to
   check for > 2.4.23 kernels - see "get_KV_info()" in nvidia-kernel and
   use ${KV} to install the modules should go.
   
2) The ``lspci'' code won't handle multiple cards. Implent a ``while read''
   instead; so you can then parse each entry. Also; use ``cut'' instead of
   that Perl script. For multiple cards it would be nice to add the manufacturer
   name to the config file as well. Do this by simply ``while read'''ing each
   matching line; storing the whole line in one variable; then filtering it
   separately. Then use ``lspci -s $Bus:$Slot:$Function.$SubFunc'' using
   the original variable to get the device name; use ``cut'' here as well.

3) Might be better to use a ``cat <<EOF > ${D}/etc/modules.d/ndiswrapper''
   for the static configuration areas so you're invoking less echo's.

4) SLOT should be "${KV}"; also please fix up the "DESCRIPTION".

Thanks.
Comment 22 Jake Meier 2004-03-07 08:35:19 UTC
Not a huge deal, but if lspci is going to be used in pkg_config, shouldn't pciutils be listed as a dependency?
Comment 23 Christoph Brill (egore) (RESIGNED) 2004-03-08 03:45:01 UTC
Version 0.5 (released today) seems to work on 2.6 kernels without any patching. I didn't use an ebuild, i just got the source, typed "make" and "make install" and could modprobe it.
Comment 24 scootersmk 2004-03-27 19:07:55 UTC
FYI there is a new bug report for a new ndiswrapper-0.6 ebuild (bug 45331)
url-> http://bugs.gentoo.org/show_bug.cgi?id=45331
Comment 25 teedog 2004-05-31 18:39:45 UTC
Uploaded a new ebuild for NdisWrapper 0.8-rc1 here:
http://bugs.gentoo.org/show_bug.cgi?id=49479
Comment 26 Doug Goldstein (RETIRED) gentoo-dev 2004-08-17 23:06:37 UTC
Marking this as fixed because it's been fixed in later bug reports and newer versions and newer ebuilds.