Bug 226620

Summary: sysutils/cpupdate: Some improvement proposal
Product: Ports & Packages Reporter: Olivier Cochard <olivier>
Component: Individual Port(s)Assignee: Eugene Grosbein <eugen>
Status: Closed FIXED    
Severity: Affects Only Me CC: sblachmann
Priority: --- Flags: eugen: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch to improve cpupdate port none

Description Olivier Cochard freebsd_committer freebsd_triage 2018-03-15 05:44:28 UTC
Created attachment 191513 [details]
patch to improve cpupdate port

Here is a patch for adding some improvement to cpupdate:
- with option CPM: install microcode into /usr/local/share/cpupdate folder
- Fix and install rc script: correct path (sbin->bin), automatically load cpuctl, and use folder created with option CPM for microcodes

There is still a last problem: The filename of downloaded microcodes with option CPM are not compliant with the format used by cpupdate. We need to do a batch conversion somewhere I believe.
Comment 1 Eugene Grosbein freebsd_committer freebsd_triage 2018-03-15 09:39:29 UTC
(In reply to Olivier Cochard from comment #0)

I'd love to implement most of suggested improvements and would do that from the beginning but there are serious issues with that.

All installed files must be added to pkg-plist and therefore included into the package. However, platomav/CPUMicrocodes is really distinct project and its growth is not syncronized with cpupdate. As you have noted, its naming schema is not even compatible with cpupdate.

Even most serious problem may steam from copyright issues: I'm sure that every owner of Intel processors is allowed to utilize published CPU microcodes but I do not know if FreeBSD project is allowed to package and redistribute Intel's microcode files. And I do not want to limit redistribution of cpupdate package itself due to copyrighted blobs added to the package.

And I do not think we need extra rc script. Instead, we could patch cpupdate to do "if (modfind(name) < 0) kldload(name)" by itself and submit that upstream. Let's wait for upcoming upload of reworked cpupdate code before.
Comment 2 Olivier Cochard freebsd_committer freebsd_triage 2018-03-15 11:25:00 UTC
Ok, let's wait for the new version of cpupdate then.
Comment 3 Stefan B. 2018-03-20 05:11:36 UTC
Thank you very much @Olivier and @Eugene, as I have no experience with port maintaining. 
Sorry for having been late, had much distraction with other things.

New version is now on Github, reworked and reformatted:
https://github.com/kernschmelze/cpupdate

Man page draft is here:
http://bsd.denkverbot.info/2018/03/cpupdate-manpage-suggestion.html

Some notes:
http://bsd.denkverbot.info/2018/03/notes-for-making-sysutilscpupdate-port.html

Regarding including microcodes in the distribution, I guess Intel won't complain if we help them mitigate their malaise. But maybe best if somebody with @freebsd.org account asks them so there is a written permission.
Comment 4 Eugene Grosbein freebsd_committer freebsd_triage 2018-03-20 15:10:34 UTC
I've just updated the port:

https://svnweb.freebsd.org/ports?view=revision&revision=465088

Stefan, thank you for your work. Please also take a look at small patch I've applied to 1) fix small warning and 2) teach cpupdate to load needed kernel module if it's missing:

https://svnweb.freebsd.org/ports/head/sysutils/cpupdate/files/patch-cpupdate.c?revision=465088&view=co&pathrev=465088

Please consider integrating the patch in some way.
Comment 5 commit-hook freebsd_committer freebsd_triage 2018-03-23 14:13:08 UTC
A commit references this bug:

Author: eugen
Date: Fri Mar 23 14:12:06 UTC 2018
New revision: 465359
URL: https://svnweb.freebsd.org/changeset/ports/465359

Log:
  sysutils/cpupdate: new convenience target "install-microcodes"

  Some users may prefer copying the whole bunch of CPU microcodes
  to their system instead of just needed one. Add new Makefile target
  "install-microcodes" to ease such copying and mention it in the pkg-message.

  This is still for convenience only and those blobs do not get into
  the pkg-plist and the package and need to be manually removed
  if not needed anymore.

  PR:		226620

Changes:
  head/sysutils/cpupdate/Makefile
  head/sysutils/cpupdate/files/pkg-message.in
Comment 6 commit-hook freebsd_committer freebsd_triage 2018-08-17 19:46:58 UTC
A commit references this bug:

Author: eugen
Date: Fri Aug 17 19:45:56 UTC 2018
New revision: 477447
URL: https://svnweb.freebsd.org/changeset/ports/477447

Log:
  Minor update for sysutils/cpupdate:

  - sync with Intel's microcode-20180807.tgz;
  - sync with platomav/CPUMicrocodes MCE DB r79;
  - follow audio/lame practice and add some comments to the "LICENSE" section
    of port's Makefile describing possible legal issues preventing microcode
    redistribution due to multiple user requests.

  No package changes, so no PORTREVISION bump.

  PR:		226620, 230181

Changes:
  head/sysutils/cpupdate/Makefile
  head/sysutils/cpupdate/distinfo