diff --git a/build.sh b/build.sh index 829bdf9..6d5be47 100755 --- a/build.sh +++ b/build.sh @@ -37,7 +37,7 @@ else echo "Build succeeded." fi -echo "Installing..." +echo "Installing OpenSuperClone to $CMAKE_INSTALL_PREFIX..." make install if [ $? -ne 0 ]; then diff --git a/install.sh b/install.sh index 76e01dc..43b2069 100755 --- a/install.sh +++ b/install.sh @@ -2,8 +2,18 @@ [ ! -d build ] && mkdir build -echo "Configuring..." -cmake -S . -B ./build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/ $@ +CMAKE_OPTIONS="" +CMAKE_BUILD_TYPE=Release +CMAKE_INSTALL_PREFIX=/usr + +if [ "$1" = "debug" ]; then + CMAKE_OPTIONS="-DDEBUG=ON" + CMAKE_BUILD_TYPE=Debug + CMAKE_INSTALL_PREFIX=./Debug +fi + +echo "Configuring for $CMAKE_BUILD_TYPE..." +cmake -S . -B ./build -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$CMAKE_INSTALL_PREFIX $CMAKE_OPTIONS if [ $? -ne 0 ]; then echo "CMake failed. Aborting." @@ -27,7 +37,7 @@ else echo "Build succeeded." fi -echo "Installing OpenSuperClone to /usr/..." +echo "Installing OpenSuperClone to $CMAKE_INSTALL_PREFIX..." sudo make install if [ $? -ne 0 ]; then diff --git a/src/oscdriver/dkms.conf.in b/src/oscdriver/dkms.conf.in index feb740a..19d9100 100644 --- a/src/oscdriver/dkms.conf.in +++ b/src/oscdriver/dkms.conf.in @@ -5,5 +5,4 @@ INSTALL="make install" CLEAN="make clean" BUILT_MODULE_NAME="$PACKAGE_NAME" DEST_MODULE_LOCATION="/kernel/drivers/misc" -REMAKE_INITRD="no" AUTOINSTALL="yes" \ No newline at end of file diff --git a/uninstall.sh b/uninstall.sh index ef539a3..e08f775 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -41,7 +41,9 @@ echo "Done uninstalling OpenSuperClone from /usr/..." echo "Uninstalling OSCDriver..." -sudo rmmod oscdriver +if lsmod | grep -q oscdriver; then + sudo rmmod oscdriver +fi VERSION=$(grep -oP '(?<=set\(OSC_DRIVER_VERSION ).*(?=\))' CMakeLists.txt) VERSION=$(echo $VERSION | cut -d' ' -f1)