mirror of
https://git.freebsd.org/ports.git
synced 2025-05-08 03:40:46 -04:00
Split the package to build the kmods separatly! Building separately has multiple benefits: 1. it allows user to rebuild when they upgrade their kernel without rebuilding all of the tools which can take a long time. 2. it allows us to provide the modules in the new kmods package repository 3. it installs the kmods the in the same place as the regular kmods: /boot/modules It means we can probably get rid of the rc script in favor if letting users use kld_list mecanism but I will let this decision to the maintainer based on what it probably best for users. Approved by: garga (maintainer) Reviewed by: garga (maintainer) Differential Revision: https://reviews.freebsd.org/D48059
65 lines
1.4 KiB
Bash
65 lines
1.4 KiB
Bash
#!/bin/sh
|
|
|
|
# PROVIDE: vmware-kmod
|
|
# REQUIRE: FILESYSTEMS ldconfig
|
|
# BEFORE: netif
|
|
|
|
. /etc/rc.subr
|
|
|
|
# Global
|
|
checkvm_cmd="%%PREFIX%%/bin/vmware-checkvm > /dev/null"
|
|
|
|
# Functions
|
|
vmware_mod_load()
|
|
{
|
|
echo -n "Loading $1 kernel module: "
|
|
if kldstat -qn $1.ko; then
|
|
echo "already loaded."
|
|
elif kldload -q $1.ko; then
|
|
echo "done."
|
|
else
|
|
echo "failed."
|
|
return 1
|
|
fi
|
|
}
|
|
vmware_mod_status()
|
|
{
|
|
echo -n "Checking $1 kernel module: "
|
|
if kldstat -qn $1.ko; then
|
|
echo "loaded."
|
|
else
|
|
echo "not loaded"
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
# VMware kernel module: vmmemctl
|
|
kernel_mod="vmmemctl"
|
|
name="vmware_guest_${kernel_mod}"
|
|
rcvar=vmware_guest_${kernel_mod}_enable
|
|
extra_commands="status"
|
|
status_cmd="vmware_mod_status ${kernel_mod}"
|
|
start_precmd="${checkvm_cmd}"
|
|
start_cmd="vmware_mod_load ${kernel_mod}"
|
|
stop_precmd="${checkvm_cmd}"
|
|
stop_cmd=":"
|
|
|
|
load_rc_config $name
|
|
: ${vmware_guest_kmod_enable:="YES"}
|
|
: ${vmware_guest_vmmemctl_enable:=$vmware_guest_kmod_enable}
|
|
run_rc_command "$1"
|
|
|
|
# VMware kernel module: vmblock
|
|
kernel_mod="vmblock"
|
|
name="vmware_guest_${kernel_mod}"
|
|
rcvar=vmware_guest_${kernel_mod}_enable
|
|
extra_commands="status"
|
|
status_cmd="vmware_mod_status ${kernel_mod}"
|
|
start_precmd="${checkvm_cmd}"
|
|
start_cmd="vmware_mod_load ${kernel_mod}"
|
|
stop_precmd="${checkvm_cmd}"
|
|
stop_cmd=":"
|
|
|
|
load_rc_config $name
|
|
: ${vmware_guest_vmblock_enable:=$vmware_guest_kmod_enable}
|
|
run_rc_command "$1"
|