[DO NOT MERGE] Test for kernel drivers #10
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | ||
| #------------------------------------------------------------------------------ | ||
| # 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: 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: Print kernel config | ||
| cat /boot/config-`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 | ||