Files
pc-usbip-runner/Makefile
Robin Krahl ea45e12638 Replace FIDO example with a dummy app
Maintaining a working setup for the FIDO and admin app is a lot of work
and is redundant to the usbip runner provided as part of the Nitrokey 3
firmware.  Therefore, this patch replaces the fido example with a much
simpler example that just sets up a dummy client responding to a vendor
command that requests random data.

This is sufficient for basic testing and getting started.  For more
advanced use cases, the Nitrokey 3 runner should be used.

Fixes: https://github.com/trussed-dev/pc-usbip-runner/issues/31
2024-06-06 15:04:20 +02:00

56 lines
1.2 KiB
Makefile

EXAMPLE_NAME := dummy
all: | start-sim attach finish-message
.PHONY: finish-message
finish-message:
@echo "###################################################"
@echo "Done. Device should be visible in your system now. Run 'make stop' to disconnect it."
.PHONY: start-sim
start-sim: build
-$(MAKE) stop
env RUST_LOG=debug cargo run --example $(EXAMPLE_NAME) &
sleep 1
.PHONY: attach
attach:
lsmod | grep vhci-hcd || sudo modprobe vhci-hcd
sudo usbip list -r "localhost"
sudo usbip attach -r "localhost" -b "1-1"
sudo usbip attach -r "localhost" -b "1-1"
sleep 5
.PHONY: ci
ci:
timeout 10 -k 5 $(MAKE)
.PHONY: build
build:
cargo build --example $(EXAMPLE_NAME)
.PHONY: build-clean
build-clean: | clean build
.PHONY: stop
stop:
-sudo usbip detach -p "00"
killall $(EXAMPLE_NAME)
.PHONY: setup-fedora
setup-fedora:
sudo dnf install usbip clang-libs-13.0.0
sudo ln -s /usr/lib64/libclang.so.13 /usr/lib64/libclang.so
.PHONY: clean
clean:
cargo clean
rm -r cargo-cache
.PHONY: build-docker
CMD=make -C /app/ build
build-docker:
docker build -t usbip .
mkdir -p cargo-cache
docker run -it --rm -v $(PWD)/cargo-cache:/root/.cargo -v $(PWD):/app usbip $(CMD)