mirror of
https://github.com/morrownr/8821cu-20210916.git
synced 2024-09-28 11:57:30 +00:00
fix low mem error
This commit is contained in:
parent
6e027bf541
commit
0314109203
25
dkms-make.sh
Executable file
25
dkms-make.sh
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# SMEM needs to be set here if dkms build is not initiated by install-driver.sh
|
||||||
|
if [[ ! -z ${SMEM} ]]
|
||||||
|
then
|
||||||
|
SMEM=$(LANG=C free | awk '/Mem:/ { print $2 }')
|
||||||
|
fi
|
||||||
|
|
||||||
|
# SMEM needs to be set here if dkms build is not initiated by install-driver.sh
|
||||||
|
if [[ ! -z ${SPROC} ]]
|
||||||
|
then
|
||||||
|
SPROC=$(nproc)
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Avoid Out of Memory condition in low-RAM systems by limiting core usage.
|
||||||
|
if [ "$SPROC" -gt 1 ]
|
||||||
|
then
|
||||||
|
if [ "$SMEM" -lt 1400000 ]
|
||||||
|
then
|
||||||
|
SPROC=2
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
kernelver=${kernelver:-$(uname -r)}
|
||||||
|
make "-j$SPROC" "KVER=$kernelver" "KSRC=/lib/modules/$kernelver/build"
|
@ -1,7 +1,7 @@
|
|||||||
PACKAGE_NAME="rtl8821cu"
|
PACKAGE_NAME="rtl8821cu"
|
||||||
PACKAGE_VERSION="5.12.0.4"
|
PACKAGE_VERSION="5.12.0.4"
|
||||||
BUILT_MODULE_NAME[0]="8821cu"
|
BUILT_MODULE_NAME[0]="8821cu"
|
||||||
MAKE="'make' -j${SPROC}"
|
MAKE="./dkms-make.sh"
|
||||||
CLEAN="'make' clean"
|
CLEAN="'make' clean"
|
||||||
DEST_MODULE_LOCATION[0]="/updates/dkms"
|
DEST_MODULE_LOCATION[0]="/updates/dkms"
|
||||||
AUTOINSTALL="YES"
|
AUTOINSTALL="YES"
|
||||||
|
@ -16,19 +16,20 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
SCRIPT_NAME="install-driver.sh"
|
SCRIPT_NAME="install-driver.sh"
|
||||||
SCRIPT_VERSION="20230111"
|
SCRIPT_VERSION="20230114"
|
||||||
MODULE_NAME="8821cu"
|
MODULE_NAME="8821cu"
|
||||||
DRV_VERSION="5.12.0.4"
|
DRV_VERSION="5.12.0.4"
|
||||||
|
|
||||||
KVER="$(uname -r)"
|
KVER="$(uname -r)"
|
||||||
KARCH="$(uname -m)"
|
KARCH="$(uname -m)"
|
||||||
KSRC="/lib/modules/${KVER}/build"
|
|
||||||
MODDESTDIR="/lib/modules/${KVER}/kernel/drivers/net/wireless/"
|
MODDESTDIR="/lib/modules/${KVER}/kernel/drivers/net/wireless/"
|
||||||
|
|
||||||
DRV_NAME="rtl${MODULE_NAME}"
|
DRV_NAME="rtl${MODULE_NAME}"
|
||||||
DRV_DIR="$(pwd)"
|
DRV_DIR="$(pwd)"
|
||||||
OPTIONS_FILE="${MODULE_NAME}.conf"
|
OPTIONS_FILE="${MODULE_NAME}.conf"
|
||||||
SMEM=$(LANG=C free | awk '/Mem:/ { print $2 }')
|
|
||||||
|
export SMEM=$(LANG=C free | awk '/Mem:/ { print $2 }')
|
||||||
|
export SPROC=$(nproc)
|
||||||
|
|
||||||
# check to ensure sudo was used
|
# check to ensure sudo was used
|
||||||
if [[ $EUID -ne 0 ]]
|
if [[ $EUID -ne 0 ]]
|
||||||
@ -126,8 +127,7 @@ echo ": ${KARCH} (ARCH)"
|
|||||||
# display total system memory
|
# display total system memory
|
||||||
echo ": ${SMEM} (SMEM)"
|
echo ": ${SMEM} (SMEM)"
|
||||||
|
|
||||||
export SPROC=$(nproc)
|
# Avoid Out of Memory condition in low-RAM systems by limiting core usage.
|
||||||
# Avoid OOM in low-RAM systems.
|
|
||||||
if [ "$SPROC" -gt 1 ]
|
if [ "$SPROC" -gt 1 ]
|
||||||
then
|
then
|
||||||
if [ "$SMEM" -lt 1400000 ]
|
if [ "$SMEM" -lt 1400000 ]
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
SCRIPT_NAME="remove-driver.sh"
|
SCRIPT_NAME="remove-driver.sh"
|
||||||
SCRIPT_VERSION="20230109"
|
SCRIPT_VERSION="20230114"
|
||||||
MODULE_NAME="8821cu"
|
MODULE_NAME="8821cu"
|
||||||
DRV_VERSION="5.12.0.4"
|
DRV_VERSION="5.12.0.4"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user