forked from Lainports/freebsd-ports
Startup script got support for extra command "resume" that is supposed to be used for "service cpupdate resume" invocation at resume sequence. For now, it is identical to "start".
46 lines
976 B
Bash
46 lines
976 B
Bash
#!/bin/sh
|
|
|
|
# $FreeBSD$
|
|
#
|
|
# PROVIDE: cpupdate
|
|
# REQUIRE: FILESYSTEMS kldxref
|
|
# BEFORE: netif
|
|
# KEYWORD: nojail resume
|
|
|
|
# Add these lines to /etc/rc.conf.local or /etc/rc.conf
|
|
# to enable this service:
|
|
#
|
|
# cpupdate_enable (bool): Set to NO by default.
|
|
# Set it to YES to enable cpupdate.
|
|
# cpupdate_ibrs_enable (bool): Enable Indirect Branch Restricted
|
|
# Speculation after start of cpupdate.
|
|
# Default is YES.
|
|
# cpupdate_flags (string): Command line flags for cpupdate.
|
|
# Default is "-w -u".
|
|
|
|
. /etc/rc.subr
|
|
|
|
name=cpupdate
|
|
rcvar=cpupdate_enable
|
|
start_postcmd="cpupdate_poststart"
|
|
|
|
load_rc_config $name
|
|
|
|
: ${cpupdate_enable:="NO"}
|
|
: ${cpupdate_flags="-w -u"}
|
|
: ${cpupdate_ibrs_enable="YES"}
|
|
command=%%PREFIX%%/sbin/${name}
|
|
resume_cmd="cpupdate_resume"
|
|
extra_commands="resume"
|
|
|
|
cpupdate_poststart() {
|
|
checkyesno cpupdate_ibrs_enable && sysctl -i hw.ibrs_disable=0
|
|
return 0
|
|
}
|
|
|
|
cpupdate_resume() {
|
|
run_rc_command start
|
|
_postcmd=''
|
|
}
|
|
|
|
run_rc_command "$1"
|