Annotation of pkgsrc/sysutils/intel-microcode-netbsd/files/intel-microcode.sh, revision 1.1
1.1 ! drochner 1: #!@RCD_SCRIPTS_SHELL@
! 2:
! 3: # PROVIDE: microcode
! 4: # REQUIRE: mountall
! 5: #
! 6: # attempts microcode update on all CPU cores (for Intel x86)
! 7: #
! 8:
! 9: $_rc_subr_loaded . /etc/rc.subr
! 10:
! 11: name=microcode
! 12: rcvar=$name
! 13: start_cmd="microcode_start"
! 14:
! 15: _microcode_baremetal()
! 16: {
! 17: ncpu=`/sbin/sysctl -n hw.ncpu`
! 18:
! 19: for i in `/usr/bin/jot - 0 \`expr $ncpu - 1\` 1`; do
! 20: /usr/sbin/cpuctl ucode $i || true
! 21: done
! 22: }
! 23:
! 24: _microcode_xen()
! 25: {
! 26: /usr/sbin/cpuctl ucode || true
! 27: }
! 28:
! 29: microcode_start()
! 30: {
! 31: if [ -e /kern/xen/privcmd ]; then
! 32: _microcode_xen
! 33: else
! 34: _microcode_baremetal
! 35: fi
! 36: }
! 37:
! 38: load_rc_config $name
! 39: run_rc_command "$1"
CVSweb <webmaster@jp.NetBSD.org>