Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
PWD := $(shell pwd)

BUILDSYSTEM_DIR ?= /lib/modules/$(shell uname -r)/build
CXL_DIR ?= cxl_6.10

CXL_DIR ?= cxl_$(shell uname -r | cut -d '-' -f1 | cut -d '.' -f1,2)
INSTALL_MOD_PATH ?=
INSTALL_MOD_PATH_ARG := $(if $(strip $(INSTALL_MOD_PATH)),INSTALL_MOD_PATH="$(INSTALL_MOD_PATH)",)

Expand All @@ -12,10 +11,9 @@ ifneq ($(KERNELRELEASE),)
obj-m += $(CXL_DIR)/
else
all:
@echo INSTALL_MOD_PATH=$(INSTALL_MOD_PATH)
$(MAKE) -C $(BUILDSYSTEM_DIR) M=$(PWD) modules
install: all
$(MAKE) -C $(BUILDSYSTEM_DIR) M=$(PWD) modules_install $(INSTALL_MOD_PATH_ARG) DEPMOD=/bin/true
$(MAKE) -C $(BUILDSYSTEM_DIR) M=$(PWD) modules_install $(INSTALL_MOD_PATH_ARG) INSTALL_MOD_DIR=updates DEPMOD=/bin/true
clean:
$(MAKE) -C $(BUILDSYSTEM_DIR) M=$(PWD) clean
@/bin/rm -f *.ko modules.order *.mod.c *.o *.o.ur-safe .*.o.cmd
Expand Down
15 changes: 0 additions & 15 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,3 @@
make clean
make install -j$(nproc)
depmod -a

kernel_version=$(uname -r)
mx_dma_path=$(find /lib/modules/${kernel_version}/ -type f -name "mx_dma.ko" 2>/dev/null)

if [ -n "$mx_dma_path" ]; then
mx_dma_dir=$(dirname "$mx_dma_path")
echo "Found mx_dma.ko at directory: $mx_dma_dir"
else
echo "mx_dma.ko not found."
exit
fi

sed -i '/cxl_/d' /etc/modules
sed -i '/mx_dma/d' /etc/modules
find "$mx_dma_dir" -type f -name "*.ko" >>/etc/modules
13 changes: 13 additions & 0 deletions uninstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

UPDATE_PATH=/lib/modules/$(uname -r)/updates

for dir in "$UPDATE_PATH"/cxl_*; do
if [[ -d "$dir" ]]; then
rm -rf "$dir"
fi
done

rm -f "$UPDATE_PATH"/mx_dma.ko

depmod -a