Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/test_usb_kernel_modules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
#------------------------------------------------------------------------------
# QEMU OpenTitan CI
#
# Copyright (c) 2023-2025 Rivos, Inc.
# SPDX-License-Identifier: Apache License 2.0
#------------------------------------------------------------------------------

name: Test kernel modules
on:
- pull_request
- workflow_dispatch
jobs:
test-usb:
runs-on: ubuntu-24.04
steps:
- name: Print kernel config
run: |
cat /boot/config-`uname -r`
- name: Install deps
run: |
sudo sed -i 's/^Types: deb$/Types: deb deb-src/' /etc/apt/sources.list.d/ubuntu.sources
sudo apt-get update
sudo apt-get install -y linux-headers-generic
mkdir linux
cd linux
apt-get source linux-image-unsigned-$(uname -r)
- name: Build and load dummy_hcd module
run: |
cd linux
cp $(ls | grep linux- | head -n1)/drivers/usb/gadget/udc/dummy_hcd.c dummy_hcd.c
cat >Makefile <<'EOF'
obj-m := dummy_hcd.o
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)

default:
$(MAKE) -C $(KDIR) M=$(PWD) SUBDIRS=$(PWD) modules

clean:
$(MAKE) -C $(KDIR) M=$(PWD) SUBDIRS=$(PWD) clean
EOF
cat Makefile
make
sudo modprobe udc_core
sudo insmod dummy_hcd.ko

Loading