Update 2 files

- /home/.chezmoiscripts/universal/run_onchange_after_45-vmware.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_46_virtualbox.tmpl
This commit is contained in:
Brian Zalewski 2023-02-01 07:04:55 +00:00
parent 99efcdc240
commit a4fe3b7e3a
2 changed files with 22 additions and 7 deletions

View file

@ -4,18 +4,21 @@
{{ includeTemplate "universal/profile" }}
{{ includeTemplate "universal/logg" }}
### Only run logic if VMWare is installed
### Run logic if VMWare is installed
if command -v vmware > /dev/null; then
### Build Kernel Modules
### Build kernel modules
# TODO - Add check to see if kernel modules are required before running this logic
if sudo vmware-modconfig --console --install-all; then
:
else
logg info 'Acquiring VMWare version from CLI'
VMW_VERSION=$(vmware --version | cut -f 3 -d' ')
mkdir -p /tmp/vmw_patch
cd /tmp/vmw_patch
logg info 'Downloading VMWare host module patches'
curl -sSL https://github.com/mkubecek/vmware-host-modules/archive/workstation-$VMW_VERSION.tar.gz -o /tmp/vmw_patch/workstation.tar.gz
tar -xzf /tmp/vmw_patch/workstation.tar.gz
cd vmware*
logg info 'Running `sudo make` and `sudo make install`'
sudo make
sudo make install

View file

@ -4,16 +4,28 @@
{{ includeTemplate "universal/profile" }}
{{ includeTemplate "universal/logg" }}
### Only run logic if VirtualBox is installed
### Run logic if VirtualBox is installed
# TODO - Add check to determine if ExtensionPack is required
if command -v VirtualBox > /dev/null; then
###Install VirtualBox Extension pack
VBOX_VERSION=$(VirtualBox --help | head -n 1 | cut -f 6 -d' ')
VBOX_VERSION=${VBOX_VERSION//v}
### Install VirtualBox extension pack
logg info 'Acquiring VirtualBox version information'
VBOX_VERSION="$(VirtualBox --help | head -n 1 | cut -f 6 -d' ')"
VBOX_VERSION="${VBOX_VERSION//v}"
### Set up folders
mkdir -p /usr/lib/virtualbox/ExtensionPacks
mkdir -p /tmp/vbox
cd /tmp/vbox
curl https://download.virtualbox.org/virtualbox/$VBOX_VERSION/Oracle_VM_VirtualBox_Extension_Pack-$VBOX_VERSION.vbox-extpack \
### Download extension pack
logg info 'Downloading VirtualBox extension pack'
curl -sSL https://download.virtualbox.org/virtualbox/$VBOX_VERSION/Oracle_VM_VirtualBox_Extension_Pack-$VBOX_VERSION.vbox-extpack \
-o /tmp/vbox/Oracle_VM_VirtualBox_Extension_Pack-$VBOX_VERSION.vbox-extpack
### Install extension pack
logg info 'Installing VirtualBox extension pack'
echo 'y' | VBoxManage extpack install --replace /tmp/vbox/Oracle_VM_VirtualBox_Extension_Pack-$VBOX_VERSION.vbox-extpack
logg success 'Successfully installed VirtualBox extension pack'
else
logg warn 'VirtualBox is not installed so VirtualBox Extension pack will not be installed'
fi