Skip to content

Commit

Permalink
Merge pull request #47 from random-archer/dev-util-usb-hci
Browse files Browse the repository at this point in the history
support usb hcd
  • Loading branch information
Andrei-Pozolotin authored Mar 29, 2020
2 parents eaed9a0 + eebc307 commit d2bb26c
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ PREFIX ?= /usr/local
SYSTEMD_SYSTEM_PATH ?= /usr/lib

install:
install -vDm 644 src/*.conf -t $(DESTDIR)/etc/mkinitcpio-systemd-tool/config
install -vDm 644 src/fstab -t $(DESTDIR)/etc/mkinitcpio-systemd-tool/config
install -vDm 644 src/crypttab -t $(DESTDIR)/etc/mkinitcpio-systemd-tool/config
install -vDm 644 src/initrd-network.network -t $(DESTDIR)/etc/mkinitcpio-systemd-tool/network/
Expand Down
15 changes: 15 additions & 0 deletions src/initrd-util-usb-hcd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file is part of https://github.com/random-archer/mkinitcpio-systemd-tool

# Provide enhanced configuration for usb keyboard inside initramfs.

# file location in initramfs:
# /etc/modprobe.d/initrd-util-usb-hcd.conf

# file location in real-root:
# /etc/mkinitcpio-systemd-tool/config/initrd-util-usb-hcd.conf

# required module load order: xhci-hcd ehci-hcd uhci-hcd ohci-hcd

softdep ehci-hcd pre: xhci-hcd
softdep uhci-hcd pre: ehci-hcd
softdep ohci-hcd pre: uhci-hcd
50 changes: 50 additions & 0 deletions src/initrd-util-usb-hcd.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This file is part of https://github.com/random-archer/mkinitcpio-systemd-tool

# Provide enhanced configuration for usb keyboard inside initramfs.

# note:
# * sometimes usb drives are not properly detected/loaded for initrd
# * try to enable this service to see if that resolves the issue

[Unit]
Description=Initrd/Util USB-HCD Service
ConditionPathExists=/etc/initrd-release
DefaultDependencies=no

[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/true

[Install]
WantedBy=sysinit.target

[X-SystemdTool]

# driver terminology:
# xhci = eXtensible Host Controller Interface, USB 3.0
# ehci = Enhanced Host Controller Interface, USB 2.0
# *hcd = host controller driver
# *pci = pci bus glue

#
# provision usb modules
#

# http://cateee.net/lkddb/web-lkddb/USB_XHCI_HCD.html
InitrdCall=add_module xhci_hcd
InitrdCall=add_module xhci_pci

# http://cateee.net/lkddb/web-lkddb/USB_EHCI_HCD.html
InitrdCall=add_module ehci_hcd
InitrdCall=add_module ehci_pci

# http://cateee.net/lkddb/web-lkddb/HID_GENERIC.html
InitrdCall=add_module hid_generic

#
# provision module config
#

# enforce module load order
InitrdPath=/etc/modprobe.d/initrd-util-usb-hcd.conf source=/etc/mkinitcpio-systemd-tool/config/initrd-util-usb-hcd.conf
5 changes: 5 additions & 0 deletions tool/image/test/unitada/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@

machine.service_enable_list([
"root-entry.mount",
"initrd-util-usb-hcd.service",
])

machine.produce_boot_result()

path_list = [

"/etc/systemd/system/root-entry.mount",

"/etc/modprobe.d/initrd-util-usb-hcd.conf",

]

Expand All @@ -37,6 +40,8 @@
"/etc/systemd/system/custom-tester.target.wants/root-entry.mount",
"/etc/systemd/system/super-duper.mount.requires/root-entry.mount",

"/etc/systemd/system/sysinit.target.wants/initrd-util-usb-hcd.service",

]

text_list = [
Expand Down

0 comments on commit d2bb26c

Please sign in to comment.