Skip to content

Instantly share code, notes, and snippets.

@mschmitt
Created December 7, 2023 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mschmitt/75e9e2febb4a5498cd1bd65cf6c1cb8c to your computer and use it in GitHub Desktop.
Save mschmitt/75e9e2febb4a5498cd1bd65cf6c1cb8c to your computer and use it in GitHub Desktop.
build-vmware-modules.sh
#!/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