Bug 256382

Summary: yast2-network seems to require ethtool
Product: [openSUSE] openSUSE 10.3 Reporter: Lukas Ocilka <locilka>
Component: YaST2Assignee: Katarina Machalkova <kmachalkova>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P5 - None    
Version: Alpha 2   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: YaST logs

Description Lukas Ocilka 2007-03-21 13:51:54 UTC
Some part of the second stage installation (network proposal) calls `ethtool` command. This tool, or package is not required by yast2-network RPM and if you don't want to have it required, you should handle it somehow in the code:

Such as:
* disable the functionality provided by ethtool
* install in runtime
* ...?
* or just require the package in RPM dependencies
Comment 1 Lukas Ocilka 2007-03-21 14:06:08 UTC
[bash] ShellCommand.cc(shellcommand):78 sh: ethtool: command not found
Comment 2 Lukas Ocilka 2007-03-21 14:06:30 UTC
Created attachment 125726 [details]
YaST logs
Comment 3 Katarina Machalkova 2007-04-27 11:55:02 UTC
ethtool is called before the internet test, in order to find the best device for internet connection, i.e. the one that has link up.
I'd like to replace ethtool call with something more handy because ethtool does not work e.g. on virtual network adapters on s390
Comment 4 Katarina Machalkova 2007-04-27 12:05:49 UTC
hwinfo has 'Link:' key which (probably) provides the same functionality as ethtool and then grep for 'Link detected'

But - seems that this information is not available everywhere. I have 1 machine with old Realtek RT8139 cards that happily provide 'Link' information and the other, with nVidia's Giga-byte GA-K8N onboard card (forcedeth driver), where hwinfo returns empty Link key.

Steffen, how does all this work? Why certain cards provide hwinfo with link status information and the others do not? Can I rely upon hwinfo when I want to find out whether the device is connected to the cable/access point?
Comment 5 Steffen Winterfeldt 2007-04-27 12:49:03 UTC
Unfortunately, not all cards provide link information and even worse,
if they do, it is not always correct. At least that was my experience when
I tried to use it in linuxrc.

Was some time ago, though. Maybe worth a re-check.

Anyway, the link info seems to be in sysfs now. So using ethtool
should no longer be necessary.
Comment 6 Steffen Winterfeldt 2007-04-27 12:54:33 UTC
To clarify: libhd uses the ethtool ioctls, it does not run the _command_.
Comment 7 Katarina Machalkova 2007-04-27 14:01:00 UTC
'cat /sys/class/net/eth0/device/eth0/carrier' is the right command. Works even for s390 virtual devices ;-)



Comment 8 Michal Zugec 2007-04-27 14:33:36 UTC
Steffen, 
I think also hwinfo could read and provide that information from sysfs. 
For yast-network module of course that's not problem - not too much work, but it would be nice to have this information from tool which was made for this purpose.

man hwinfo:
...
hwinfo  is used to probe for the hardware present in the system
...

So I think hardware status should be part of this information, agree?
Comment 9 Katarina Machalkova 2007-05-02 11:40:45 UTC
I've added IsConnected() function to NetworkDevices that returns link status for given device (reading sysfs)

Let's make this hwinfo thingy (comment #8) a separate bug report (enhancement request respectively)
Comment 10 Katarina Machalkova 2007-05-02 11:41:27 UTC
.
Comment 11 Steffen Winterfeldt 2007-05-02 14:48:56 UTC
Ok, changed hwinfo to try sysfs and ethtool to get the link state.
Comment 12 Katarina Machalkova 2007-05-02 15:10:36 UTC
Can we get some hwinfo STABLE pack (mbuild job etc.) for testing?
Comment 13 Katarina Machalkova 2007-05-17 15:33:28 UTC
Link state of network devices is no longer obtained from ethtool. Fixed in yast2 2.15.33.