Created
December 7, 2023 12:10
-
-
Save mschmitt/75e9e2febb4a5498cd1bd65cf6c1cb8c to your computer and use it in GitHub Desktop.
build-vmware-modules.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -o errexit | |
if [[ ! -d vmware-host-modules ]] | |
then | |
printf "Please clone https://github.com/mkubecek/vmware-host-modules\n" | |
printf "and checkout the branch matching your workstation version\n." | |
exit 1 | |
fi | |
printf "Running as: %s\n" "$(id -un)" | |
[[ ${EUID} -ne 0 ]] && printf "Re-executing with sudo.\n" && exec sudo "${0}" | |
cd vmware-host-modules | |
make clean | |
make | |
make install | |
for mod in vmnet vmmon | |
do | |
printf "Signing: %s\n" "${mod}" | |
/usr/lib/sectpmctl/scripts/dkms_sign_helper.sh "$(uname -r)" "/lib/modules/$(uname -r)/misc/${mod}.ko" | |
if modinfo "${mod}" | grep ^sign | |
then | |
printf "Module %s is signed.\n" "${mod}" | |
printf "Loading: %s\n" "${mod}" | |
if modprobe "${mod}" | |
then | |
printf "Module %s loaded.\n" "${mod}" | |
else | |
printf "Module %s could not be loaded.\n" "${mod}" | |
fi | |
else | |
printf "Module %s is still not signed.\n" "${mod}" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment