PDA

View Full Version : Workaround for ''cable disconnected' bug and start a command at boot time.



kunzlata
8th March 2016, 11:14 AM
I installed Fedora in a laptop that has a

$ lspci|grep -i ethernet
02:00.5 Ethernet controller: JMicron Technology Corp. JMC250 PCI Express Gigabit Ethernet Controller (rev 03)
It has a bug that Gigabit Ethernet doesn't work when modem has EEE feature. See https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1310798/comments/19. It always says 'Cable disconnected' in the network settings.

To work around that we have to start a command at boot time to set the ethernet speed to 100Mbps. I don't know how complete and correct is the systemd service I created but it seems ok.

Create /etc/systemd/system/jme-ethernet-workaround.service ('jme' is the jmicron kernel driver) like this:


[Unit]
Description=Limit jmicron Ethernet port to 100Mbps
After=network.target

[Service]
Type=oneshot
ExecStart=/usr/sbin/ethtool -s enp2s0f5 speed 100 duplex full

[Install]
WantedBy=multi-user.target

So it is a run once command ('oneshot'), starts after network.target and is part of multi-user.target.
'enp2s0f5' is my ethernet connection.

It doesn't have to be executable:

# chmod 644 /etc/systemd/system/jme-ethernet-workaround.service

Test it with:

# systemctl start jme-ethernet-workaround.service

If it works, enable it with:

# systemctl enable jme-ethernet-workaround.service

Acropolis
13th March 2016, 07:56 PM
nice solution !

thank you for he tip . i will have it in my mind as it seems a clean solution for this problem :)