-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathmk.sh
More file actions
executable file
·36 lines (35 loc) · 772 Bytes
/
Copy pathmk.sh
File metadata and controls
executable file
·36 lines (35 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh -e
# SPDX-License-Identifier: GPL-2.0
case "$1" in
build)
echo Making ...
make -C /lib/modules/$(uname -r)/build M=$(pwd) modules
echo Completed.
;;
clean)
echo Cleaning ...
make -C /lib/modules/$(uname -r)/build M=$(pwd) clean
echo Completed.
;;
install)
echo "Installing sblkdev"
SBLKDEV_PATH=/lib/modules/$(uname -r)/kernel/drivers/block
mkdir -p ${SBLKDEV_PATH}
cp sblkdev.ko ${SBLKDEV_PATH}/
depmod
echo Completed.
;;
uninstall)
echo "Uninstalling sblkdev"
SBLKDEV_PATH=/lib/modules/$(uname -r)/kernel/drivers/block
rm -f ${SBLKDEV_PATH}/sblkdev.ko
depmod
;;
*)
echo "Usage "
echo "Compile project: "
echo " $0 {build | clean} "
echo "Install module : "
echo " $0 {install | uninstall}"
exit 1
esac