Skip to content

Commit

Permalink
fix make restore
Browse files Browse the repository at this point in the history
  • Loading branch information
sgotand committed Jul 2, 2018
1 parent 78ac714 commit 35e20d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ check:
@echo " default: $(TARGET_DEFAULT_DRIVER)"

load:
ifneq ($(shell lspci -v -s $(TARGET_PCI_BUS_ID) | grep $(TARGET_DEFAULT_DRIVER)),)
ifneq ($(shell lspci -v -s $(TARGET_PCI_BUS_ID) | grep "in use" | grep $(TARGET_DEFAULT_DRIVER)),)
sudo modprobe uio_pci_generic
sudo sh -c "echo '$(TARGET_PCI_VID) $(TARGET_PCI_DID)' > /sys/bus/pci/drivers/uio_pci_generic/new_id"
sudo sh -c "echo -n $(TARGET_PCI_BUS_ID) > /sys/bus/pci/drivers/$(TARGET_CURRENT_DRIVER)/unbind"
sudo sh -c "echo -n $(TARGET_PCI_BUS_ID) > /sys/bus/pci/drivers/uio_pci_generic/bind"
endif

restore:
ifeq ($(shell lspci -v -s $(TARGET_PCI_BUS_ID) | grep $(TARGET_DEFAULT_DRIVER)),)
ifeq ($(shell lspci -v -s $(TARGET_PCI_BUS_ID) | grep "in use" | grep $(TARGET_DEFAULT_DRIVER)),)
sudo modprobe $(TARGET_DEFAULT_DRIVER)
sudo sh -c "echo -n $(TARGET_PCI_BUS_ID) > /sys/bus/pci/drivers/$(TARGET_CURRENT_DRIVER)/unbind"
sudo sh -c "echo -n $(TARGET_PCI_BUS_ID) > /sys/bus/pci/drivers/$(TARGET_DEFAULT_DRIVER)/bind"
Expand Down

0 comments on commit 35e20d0

Please sign in to comment.