mirror of
https://github.com/morrownr/8821cu-20210916.git
synced 2024-11-16 10:50:41 +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 needs to be set here if dkms build is not initiated by install-driver.sh
|
||||||
SMEM=$(LANG=C free | awk '/Mem:/ { print $2 }')
|
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 needs to be set here if dkms build is not initiated by install-driver.sh
|
||||||
SPROC=$(nproc)
|
sproc=$(nproc)
|
||||||
|
|
||||||
# Avoid Out of Memory condition in low-RAM systems by limiting core usage.
|
# Avoid Out of Memory condition in low-RAM systems by limiting core usage.
|
||||||
if [ "$SPROC" -gt 1 ]
|
if [ "$sproc" -gt 1 ]
|
||||||
then
|
then
|
||||||
if [ "$SMEM" -lt 1400000 ]
|
if [ "$SMEM" -lt 1400000 ]
|
||||||
then
|
then
|
||||||
SPROC=2
|
sproc=2
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
kernelver=${kernelver:-$(uname -r)}
|
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
|
exit 0
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
# 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="20230114"
|
SCRIPT_VERSION="20230116"
|
||||||
MODULE_NAME="8821cu"
|
MODULE_NAME="8821cu"
|
||||||
DRV_VERSION="5.12.0.4"
|
DRV_VERSION="5.12.0.4"
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ DRV_DIR="$(pwd)"
|
|||||||
OPTIONS_FILE="${MODULE_NAME}.conf"
|
OPTIONS_FILE="${MODULE_NAME}.conf"
|
||||||
|
|
||||||
SMEM=$(LANG=C free | awk '/Mem:/ { print $2 }')
|
SMEM=$(LANG=C free | awk '/Mem:/ { print $2 }')
|
||||||
SPROC=$(nproc)
|
sproc=$(nproc)
|
||||||
|
|
||||||
# check to ensure sudo was used
|
# check to ensure sudo was used
|
||||||
if [[ $EUID -ne 0 ]]
|
if [[ $EUID -ne 0 ]]
|
||||||
@ -116,6 +116,8 @@ do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
echo ": ---------------------------"
|
||||||
|
|
||||||
# displays script name and version
|
# displays script name and version
|
||||||
echo ": ${SCRIPT_NAME} v${SCRIPT_VERSION}"
|
echo ": ${SCRIPT_NAME} v${SCRIPT_VERSION}"
|
||||||
|
|
||||||
@ -128,15 +130,15 @@ echo ": ${KARCH} (ARCH)"
|
|||||||
echo ": ${SMEM} (SMEM)"
|
echo ": ${SMEM} (SMEM)"
|
||||||
|
|
||||||
# Avoid Out of Memory condition in low-RAM systems by limiting core usage.
|
# Avoid Out of Memory condition in low-RAM systems by limiting core usage.
|
||||||
if [ "$SPROC" -gt 1 ]
|
if [ "$sproc" -gt 1 ]
|
||||||
then
|
then
|
||||||
if [ "$SMEM" -lt 1400000 ]
|
if [ "$SMEM" -lt 1400000 ]
|
||||||
then
|
then
|
||||||
SPROC=2
|
sproc=2
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
# display total number of cpu cores / in use
|
# display total number of cpu cores / in use
|
||||||
echo ": ${SPROC}/$(nproc) (SPROC/NPROC)"
|
echo ": ${sproc}/$(nproc) (sproc/nproc)"
|
||||||
|
|
||||||
# display kernel version
|
# display kernel version
|
||||||
echo ": ${KVER} (KVER)"
|
echo ": ${KVER} (KVER)"
|
||||||
@ -159,6 +161,8 @@ then
|
|||||||
echo ": "${sb_state}
|
echo ": "${sb_state}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo ": ---------------------------"
|
||||||
|
|
||||||
# display ISO 3166-1 alpha-2 Country Code
|
# display ISO 3166-1 alpha-2 Country Code
|
||||||
#a2_country_code=$(iw reg get | grep -i country)
|
#a2_country_code=$(iw reg get | grep -i country)
|
||||||
#echo "Country: "${a2_country_code}
|
#echo "Country: "${a2_country_code}
|
||||||
|
@ -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="20230114"
|
SCRIPT_VERSION="20230116"
|
||||||
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