mirror of
https://github.com/morrownr/8821cu-20210916.git
synced 2024-12-21 22:06:32 +00:00
tweaks to low mem fix
This commit is contained in:
parent
25a173f403
commit
de16766d03
12
dkms-make.sh
12
dkms-make.sh
@ -1,21 +1,21 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
# SMEM needs to be set here if dkms build is not initiated by install-driver.sh
|
||||
SMEM=$(LANG=C free | awk '/Mem:/ { print $2 }')
|
||||
|
||||
# SPROC needs to be set here if dkms build is not initiated by install-driver.sh
|
||||
SPROC=$(nproc)
|
||||
# sproc needs to be set here if dkms build is not initiated by install-driver.sh
|
||||
sproc=$(nproc)
|
||||
|
||||
# Avoid Out of Memory condition in low-RAM systems by limiting core usage.
|
||||
if [ "$SPROC" -gt 1 ]
|
||||
if [ "$sproc" -gt 1 ]
|
||||
then
|
||||
if [ "$SMEM" -lt 1400000 ]
|
||||
then
|
||||
SPROC=2
|
||||
sproc=2
|
||||
fi
|
||||
fi
|
||||
|
||||
kernelver=${kernelver:-$(uname -r)}
|
||||
make "-j$SPROC" "KVER=$kernelver" "KSRC=/lib/modules/$kernelver/build"
|
||||
make "-j$sproc" "KVER=$kernelver" "KSRC=/lib/modules/$kernelver/build"
|
||||
|
||||
exit 0
|
||||
|
@ -16,7 +16,7 @@
|
||||
# GNU General Public License for more details.
|
||||
|
||||
SCRIPT_NAME="install-driver.sh"
|
||||
SCRIPT_VERSION="20230114"
|
||||
SCRIPT_VERSION="20230116"
|
||||
MODULE_NAME="8821cu"
|
||||
DRV_VERSION="5.12.0.4"
|
||||
|
||||
@ -29,7 +29,7 @@ DRV_DIR="$(pwd)"
|
||||
OPTIONS_FILE="${MODULE_NAME}.conf"
|
||||
|
||||
SMEM=$(LANG=C free | awk '/Mem:/ { print $2 }')
|
||||
SPROC=$(nproc)
|
||||
sproc=$(nproc)
|
||||
|
||||
# check to ensure sudo was used
|
||||
if [[ $EUID -ne 0 ]]
|
||||
@ -116,6 +116,8 @@ do
|
||||
shift
|
||||
done
|
||||
|
||||
echo ": ---------------------------"
|
||||
|
||||
# displays script name and version
|
||||
echo ": ${SCRIPT_NAME} v${SCRIPT_VERSION}"
|
||||
|
||||
@ -128,15 +130,15 @@ echo ": ${KARCH} (ARCH)"
|
||||
echo ": ${SMEM} (SMEM)"
|
||||
|
||||
# Avoid Out of Memory condition in low-RAM systems by limiting core usage.
|
||||
if [ "$SPROC" -gt 1 ]
|
||||
if [ "$sproc" -gt 1 ]
|
||||
then
|
||||
if [ "$SMEM" -lt 1400000 ]
|
||||
then
|
||||
SPROC=2
|
||||
sproc=2
|
||||
fi
|
||||
fi
|
||||
# display total number of cpu cores / in use
|
||||
echo ": ${SPROC}/$(nproc) (SPROC/NPROC)"
|
||||
echo ": ${sproc}/$(nproc) (sproc/nproc)"
|
||||
|
||||
# display kernel version
|
||||
echo ": ${KVER} (KVER)"
|
||||
@ -159,6 +161,8 @@ then
|
||||
echo ": "${sb_state}
|
||||
fi
|
||||
|
||||
echo ": ---------------------------"
|
||||
|
||||
# display ISO 3166-1 alpha-2 Country Code
|
||||
#a2_country_code=$(iw reg get | grep -i country)
|
||||
#echo "Country: "${a2_country_code}
|
||||
|
@ -16,7 +16,7 @@
|
||||
# GNU General Public License for more details.
|
||||
|
||||
SCRIPT_NAME="remove-driver.sh"
|
||||
SCRIPT_VERSION="20230114"
|
||||
SCRIPT_VERSION="20230116"
|
||||
MODULE_NAME="8821cu"
|
||||
DRV_VERSION="5.12.0.4"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user