Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add USB .hci_pci modules for broader hardware support #1244

Merged
merged 1 commit into from
Mar 16, 2017

Conversation

ProBackup-nl
Copy link
Contributor

mkrescue on a source computer with both USB 2.0 and 3.0 port might run with the xhci module only.
When the (USB) boot device is used to start a USB 2.0 computer that requires the ehci module, both the ehci_hcd and ehci_pci modules, to boot with USB keyboard and mouse support. Tested with Arch Linux 4.9.11-1 on an Intel DE3815TYKHE (USB2+3 where lsmod only show the xhci module), then ReaR will not have keyboard support when booted on a machine with USB 2.0 only. After adding the 4 (u|e|x|o)hci_pci modules, the USB keyboard and mouse do function again with the USB 2.0 only mainboard. Also see #519 (comment)

mkrescue on a source computer with both USB 2.0 and 3.0 port might run with the xhci module only.
When the (USB) boot device is used to start a USB 2.0 computer that requires the ehci module, both the ehci_hcd and ehci_pci modules, to boot with keyboard support. Tested with Arch Linux 4.9.11-1 on an Intel DE3815TYKHE (USB2+3 where lsmod only show the xhci module), then ReaR will not have keyboard support when booted on a machine with USB 2.0 only. After adding the 4 (u|e|x|o)hci_pci modules, the USB keyboard and mouse do function again with the USB 2.0 only mainboard.
@jsmeix jsmeix requested review from jsmeix, gdha and gozora March 15, 2017 09:30
@jsmeix jsmeix self-assigned this Mar 15, 2017
@jsmeix jsmeix added the enhancement Adaptions and new features label Mar 15, 2017
@jsmeix jsmeix added this to the ReaR v2.1 milestone Mar 15, 2017
@jsmeix
Copy link
Member

jsmeix commented Mar 15, 2017

@ProBackup-nl
many thanks for your continuous work!
Almost with each of your issues you find a new spot
where ReaR could need general enhancement.
This helps a lot to make ReaR more stable in general.

Regarding this particular issue:
On my SUSE systems the kernel modules are named different
and not all of them exist on each system:

On SLE11 SP3

# find /lib/modules/ | grep xhci
/lib/modules/3.0.101-0.47.71-pae/kernel/drivers/usb/host/xhci-hcd.ko

On SLE12 SP2

# find /lib/modules/ | grep xhci
/lib/modules/4.4.21-69-default/kernel/drivers/usb/host/xhci-hcd.ko
/lib/modules/4.4.21-69-default/kernel/drivers/usb/host/xhci-pci.ko

On openSUSE Leap 42.1

# find /lib/modules/ | grep xhci    
/lib/modules/4.1.15-8-default/kernel/drivers/usb/host/xhci-hcd.ko
/lib/modules/4.1.15-8-default/kernel/drivers/usb/host/xhci-pci.ko
/lib/modules/4.1.13-5-default/kernel/drivers/usb/host/xhci-hcd.ko
/lib/modules/4.1.13-5-default/kernel/drivers/usb/host/xhci-pci.ko

On openSUSE Tumbleweed 20170304

# find /lib/modules/ | grep xhci
/lib/modules/4.10.1-1-default/kernel/drivers/usb/host/xhci-hcd.ko
/lib/modules/4.10.1-1-default/kernel/drivers/usb/host/xhci-pci.ko

I think the ResolveModules function in lib/linux-functions.sh
needs to be enhanced to find modules independent of
minor spelling issues like 'foo-bar' versus 'foo_bar'.

Copy link
Member

@jsmeix jsmeix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On my SUSE systems the naming is different 'foo-bar' instead of 'foo_bar'.

@jsmeix
Copy link
Member

jsmeix commented Mar 15, 2017

Only as a reference:
In general regarding what kernel modules get included
in the recovery system see also the related issue
#1202

@ProBackup-nl
Copy link
Contributor Author

ProBackup-nl commented Mar 15, 2017

@jsmeix Your system does list the modules with a minus (-) sign on the filesystem. But how are the modules listed by lsmod?

On Arch the file system also lists with a minus sign:

/usr/lib/modules/4.9.11-1-ARCH/kernel/drivers/usb/host/xhci-pci.ko.gz

On the other hand lsmod does:

lsmod | grep hci
ahci                   36864  0
libahci                28672  1 ahci
xhci_pci               16384  0
xhci_hcd              172032  1 xhci_pci

And even by specifying the underscore (_) form at usr/share/rear/conf/GNU/Linux.conf, will make the module name with the minus (-) copied to rootfs. At least that is what happens on Arch Linux.

Side note: not adding USB2.0 module to init on USB3.0 systems is also/still an issue for the mkinitcpio utility that is build-in to Arch Linux itself.

@jsmeix
Copy link
Member

jsmeix commented Mar 15, 2017

@ProBackup-nl
you are absolutely right.

Now I think I better understand how the ResolveModules
function works and even why it is implemented as it is.

I even found why '-' versus '_' does not matter
because "man modprobe" reads:

there is no difference between _ and - in module names

which seems to also apply for "modinfo".

I think there is a small issue in ResolveModules because
there is a difference between _ and - in module names
in EXCLUDE_MODULES versus MODULES and MODULES_LOAD
i.e. module names in EXCLUDE_MODULES must exactly
match module names in MODULES and MODULES_LOAD.

FYI my results:

On SLE11 SP3

# lsmod | grep hci
firewire_ohci          35267  0 
firewire_core          60704  1 firewire_ohci
uhci_hcd               31410  0 
ehci_hcd               55542  0 
usbcore               199862  4 usb_storage,uhci_hcd,ehci_hcd

On SLE12 SP2

# lsmod | grep hci
ahci                   36864  0 
libahci                36864  1 ahci
libata                270336  4 ahci,libahci,ata_generic,ata_piix
ehci_pci               16384  0 
uhci_hcd               49152  0 
ehci_hcd               81920  1 ehci_pci
usbcore               258048  3 uhci_hcd,ehci_hcd,ehci_pci

On openSUSE Leap 42.1

# lsmod | grep hci
xhci_pci               16384  0 
ehci_pci               16384  0 
xhci_hcd              184320  1 xhci_pci
ehci_hcd               81920  1 ehci_pci
usbcore               262144  6 usblp,ehci_hcd,ehci_pci,usbhid,xhci_hcd,xhci_pci

On openSUSE Tumbleweed 20170304

# lsmod | grep hci
ehci_pci               16384  0
uhci_hcd               49152  0
ehci_hcd               86016  1 ehci_pci
usbcore               266240  3 ehci_hcd,uhci_hcd,ehci_pci

@jsmeix
Copy link
Member

jsmeix commented Mar 15, 2017

I think USB keyboard function on any replacement hardware
is a must nowadays so that I think ReaR should by default
include all needed USB modules in its recovery system.
I.e. I think this pull request should be merged.

@ProBackup-nl
Copy link
Contributor Author

@jsmeix
xhci_pci # USB 3.1, 3.0, 2.0, 1.1
ehci_pci # USB 2.0
ohci_pci # USB 1.1 non Intel or VIA chipset, like NEC
uhci_pci # USB 1.x Intel or VIA chipset

Regarding your USB modules loaded results, do they all run on identical hardware?

@jsmeix
Copy link
Member

jsmeix commented Mar 21, 2017

I did all on "indentical hardware" which is actually
"identical virtual machines" i.e. virtual machines
which I set up in the same way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adaptions and new features fixed / solved / done
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants