opnsense-ports/sysutils/cpupdate/files/cpupdate.in
Franco Fichtner 125bcec6dd */*: sync with upstream
Taken from: HardenedBSD
2018-04-30 21:13:37 +02:00

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"