NetBSD/usr.sbin/postinstall
martin e8f8a078e5 Pull up following revision(s) (requested by maxv in ticket #1265):
etc/rc.d/smtoff: revision 1.1
	etc/rc.d/smtoff: revision 1.2
	distrib/sets/lists/etc/mi: revision 1.258
	etc/rc.d/smtoff: revision 1.3
	etc/rc.d/smtoff: revision 1.4
	etc/defaults/rc.conf: revision 1.148
	etc/rc.d/Makefile: revision 1.103
	usr.sbin/postinstall/postinstall: revision 1.226
	etc/rc.d/Makefile: revision 1.104
	etc/mtree/special: revision 1.167
	share/man/man5/rc.conf.5: revision 1.180

Add smtoff, an rc.d script that disables Simultaneous Multi-Threading. It
parses the output of cpuctl, and executes "cpuctl offline" for each CPU
that has SmtID!=0.

The default is "smtoff=NO", which means that SMT remains enabled.
Restructure code a little.

Use quoting everywhere possibly useful (always the right way, except
in the few cases where it is wrong...)

Avoid using cut & grep (from /usr/bin) so script could run before /usr
is mounted (pity cpuctl is in /usr/sbin ...).

Use sysctl -n rather than attempting to parse its output.
install rc.d

No change...   Previous log message should have said:
  Install rc.d/smtoff

I should know better!   Don't rely upon the way the shell implements
pipes.   Skip the "error" printf from GetSmtId() as there is no easy
portable way to avoid it occurring (there are complicated ways) - but
we don't need it, there is no logical difference between "error" and ""
so just use the latter (if we get an ID, good, if there is nothing, then
there is none - saying 'error' does not mean anything.)

Remove comment, since there is no parsing anymore.
2019-05-14 11:33:42 +00:00
..
Makefile
postinstall Pull up following revision(s) (requested by maxv in ticket #1265): 2019-05-14 11:33:42 +00:00
postinstall.8 Use Nx. 2014-12-21 21:10:13 +00:00