Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 403119 - sys-apps/microcode-data: support monolithic (<2.6.27) & split microcode files
Summary: sys-apps/microcode-data: support monolithic (<2.6.27) & split microcode files
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: Normal enhancement with 1 vote (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-11 05:00 UTC by Maxim Kammerer
Modified: 2015-08-11 06:18 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
sys-kernel/intel-ucode-20111110.ebuild (intel-ucode-20111110.ebuild,2.12 KB, text/plain)
2012-05-22 14:18 UTC, Bruno Redondi
Details
sys-kernel/intel-ucode-20120606.ebuild (intel-ucode-20120606.ebuild,2.12 KB, text/plain)
2012-07-27 09:02 UTC, Bruno Redondi
Details
monolitic use patch for microcode-data-20130222.ebuild (microcode-data.monolitic.patch,1.88 KB, patch)
2013-06-06 16:32 UTC, nE0sIghT
Details | Diff
monolitic use patch for microcode-data-20140624.ebuild (microcode-data-20140624-monolitic.patch,1.89 KB, patch)
2014-06-29 12:27 UTC, nE0sIghT
Details | Diff
monolitic use patch for microcode-data-20140913.ebuild (microcode-data-20140913-monolitic.patch,1.89 KB, patch)
2014-09-22 18:42 UTC, nE0sIghT
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maxim Kammerer 2012-02-11 05:00:56 UTC
The unstable microcode-data ebuilds (starting with 20110915-r1) currently double as the old-style init.d-loadable /lib/firmware/microcode.dat, and the new-style kernel-loadable /lib/firmware/intel-ucode (mirroring amd-ucode).

Other distributions (e.g., Arch Linux) have moved to intel-ucode exclusively, removing the often buggy microcode_ctl altogether (https://wiki.archlinux.org/index.php/Microcode).

I suggest creating a separate sys-kernel/intel-ucode ebuild that:

  * installs only /lib/firmware/intel-ucode, not /lib/firmware/microcode.dat
  * depends on !sys-apps/microcode-data
  * has a recommendation to add "microcode" to /etc/conf.d/modules in pkg_postinst
  * deprecates sys-apps/microcode-ctl and sys-apps/microcode-data
Comment 1 Bruno Redondi 2012-05-22 14:18:17 UTC
Created attachment 312689 [details]
sys-kernel/intel-ucode-20111110.ebuild

This ebuild is based on sys-apps/microcode-data-20111110 and on sys-kernel/amd-ucode.
It requires files/intel-microcode2ucode.c from sys-apps/microcode-data.
Comment 2 Diego Elio Pettenò (RETIRED) gentoo-dev 2012-05-22 15:19:16 UTC
Honestly I'm not happy about a move like this, while I'm the first who's been hoping to get the split ucode [1], microcode.dat is not much bigger, and replacing a whole ebuild with something that might or might not work right now doesn't feel like a good idea.

But others can chime in of course.

[1] http://blog.flameeyes.eu/2011/01/microupdates-for-microcodes
Comment 3 Maxim Kammerer 2012-05-22 15:59:49 UTC
Diego, I read your blog entry, but got confused towards the end. Don't microcode.dat and the individual files produced by intel-microcode2ucode contain exactly the same entries?

# find /lib/firmware/intel-ucode -type f | wc -l
68

# grep '\.inc' /lib/firmware/microcode.dat | wc -l
137

It would seem that microcode.dat doubles the number of entries for some reason, and there is one additional entry -- is that additional entry what you mean by "the driver also has the ability to parse the generic microcode compiled from microcode.dat, and then find the right version for the right processor"?

> replacing a whole ebuild with something that might or might not work right now doesn't feel like a good idea

Well, you can certainly see the firmware load attempts. I remember looking at kernel sources before filing this bug report, and the Intel-related code simply forms a CPU signature and tries to load the firmware file. There is not much possibility of it not working, I think -- either the relevant firmware is present, or isn't.

The main motivation for going with the intel-ucode approach, as I see it, is ability to boot same distribution on different architectures. On non-Intel CPUs,  microcode_ctl will fail. It is the same motivation that drives many other hot-plugging capabilities (e.g., rc_hotplug="bluetooth pcscd") -- you only load what you need. If the kernel provides this capability -- why not? And this capability is very robust -- that's how all device firmware gets loaded, for instance, as you noted in the blog post.
Comment 4 Diego Elio Pettenò (RETIRED) gentoo-dev 2012-05-22 19:44:08 UTC
What I mean is that it requires a more proper configuration: to be able to load the ucode from the kernel, the microcode patch loading has to be in a module (I tried, it doesn't seem to get it right on my laptop otherwise), while microcode_ctl works fine on monolithic kernels (which are still used for instance in embedded or server configurations).

Given that the only downside of keeping it this way is installing one more file and having one more dependency, I don't see a compelling reason to change it yet.
Comment 5 Bruno Redondi 2012-07-27 09:02:19 UTC
Created attachment 319362 [details]
sys-kernel/intel-ucode-20120606.ebuild

version bump, based on sys-apps/microcode-data-20120606
Comment 6 Maxim Kammerer 2013-01-01 21:57:37 UTC
Maybe install microcode.dat with a USE-flag?
Comment 7 SpanKY gentoo-dev 2013-04-27 07:58:13 UTC
Comment on attachment 319362 [details]
sys-kernel/intel-ucode-20120606.ebuild

(1) we don't want to maintain multiple ebuilds
(2) please post *patches*, not entire files
(3) let's go with a USE flag in the existing ebuild (e.g. IUSE=+monolithic)
Comment 8 nE0sIghT 2013-06-06 16:32:44 UTC
Created attachment 350296 [details, diff]
monolitic use patch for microcode-data-20130222.ebuild

Here is a patch against latest microcode-data ebuild.
I personally think that this package must be renamed to intel-ucode and monolitic use flag switched off by default.
I spent about 10 minutes before found intel cpu firmware in portage
Comment 9 nE0sIghT 2013-09-15 07:30:16 UTC
(In reply to nE0sIghT from comment #8)
> Created attachment 350296 [details, diff] [details, diff]
> monolitic use patch for microcode-data-20130222.ebuild

This patch is suitable for the new version - microcode-data-20130906.ebuild
Comment 10 Markos Chandras (RETIRED) gentoo-dev 2013-09-15 11:35:54 UTC
Let me work on this. The patch looks good. I will also rename microcode-data to sys-firmware/intel-ucode.
Comment 11 nE0sIghT 2014-03-07 13:10:39 UTC
(In reply to nE0sIghT from comment #9)
> (In reply to nE0sIghT from comment #8)
> > Created attachment 350296 [details, diff] [details, diff] [details, diff]
> > monolitic use patch for microcode-data-20130222.ebuild
> 
> This patch is suitable for the new version - microcode-data-20130906.ebuild

Same changes works well with sys-apps/microcode-data-20140122
Comment 12 nE0sIghT 2014-06-29 12:27:21 UTC
Created attachment 379904 [details, diff]
monolitic use patch for microcode-data-20140624.ebuild

Patch for new version.
Comment 13 nE0sIghT 2014-09-22 18:42:39 UTC
Created attachment 385292 [details, diff]
monolitic use patch for microcode-data-20140913.ebuild
Comment 14 nE0sIghT 2015-02-11 16:38:12 UTC
Same changes works well with sys-apps/microcode-data-20150121
Comment 15 SpanKY gentoo-dev 2015-08-11 06:18:51 UTC
i've added dedicated USE flags to microcode-data-20150121-r1:
http://gitweb.gentoo.org/repo/gentoo.git/commit/?id=df93befac0d0267d671f384e43447c0b016d777c