Michael wrote: > On Tuesday, 1 April 2025 14:03:06 British Summer Time Dale wrote: >> Michael wrote: >>> On Tuesday, 1 April 2025 11:12:44 British Summer Time Dale wrote: >>>> Peter Humphrey wrote: >>>>> On Tuesday, 1 April 2025 01:44:18 British Summer Time Dale wrote: >>>>>> ... I have /usr on the same partition as / this time around. >>>>>> Do I need a init thingy still or can I ditch that thing? I do have >>>>>> /var >>>>>> on a separate partition, if that matters. >>>>> I have /var on a separate partition on some machines, and I only need an >>>>> initrd for microcode loading. I suppose I could include that in the >>>>> kernel, >>>>> but I haven't tried that. >>>> I thought about the fact I have a merged /usr now which means everything >>>> is in /usr. I hadn't thought of microcode being needed tho. How do I >>>> find out if there is any microcode being loaded on my system? I do have >>>> the package installed, read somewhere that it only loads something if it >>>> is needed so no real harm in having it installed even if nothing is >>>> being used today. It could prove helpful if something is being used >>>> later on tho. >>>> >>>> Is there somewhere I can look or some command I can run to see if I load >>>> any microcode that it needs to access while booting but before /var is >>>> mounted? Why isn't the microcode put in /usr or something anyway? >>>> >>>> Dale >>>> >>>> :-) :-) >>> The microcode blobs are not in /usr, but in /lib/firmware; e.g.: >>> >>> $ ls /lib/firmware/amd-ucode/ >>> microcode_amd.bin microcode_amd_fam16h.bin >>> microcode_amd_fam19h.bin microcode_amd_fam15h.bin >>> microcode_amd_fam17h.bin README >>> >>> You either include the microcode required by your CPU in an initrd, or >>> build it in your kernel by specifying it - along with any firmware needed >>> by your graphics, etc. - in your kernel (CONFIG_EXTRA_FIRMWARE). >> I have these. >> >> >> root@Gentoo-1 / # ls /lib/firmware/amd-ucode/ >> total 184 >> drwxr-xr-x 2 root root 4096 Dec 16 12:28 . >> drwxr-xr-x 104 root root 20480 Mar 22 07:36 .. >> -rw-r--r-- 1 root root 12684 Mar 22 04:52 microcode_amd.bin >> -rw-r--r-- 1 root root 7876 Mar 22 04:52 microcode_amd_fam15h.bin >> -rw-r--r-- 1 root root 3510 Mar 22 04:52 microcode_amd_fam16h.bin >> -rw-r--r-- 1 root root 22596 Mar 22 04:52 microcode_amd_fam17h.bin >> -rw-r--r-- 1 root root 100684 Mar 22 04:52 microcode_amd_fam19h.bin >> -rw-r--r-- 1 root root 4662 Mar 22 04:52 README >> root@Gentoo-1 / # > Yes, you would have all these and more for older amd, as well as intel CPUs, > provided you have emerged sys-kernel/linux-firmware. >
That I did ages ago, don't remember where that was mentioned tho. >> I'm family 25 so not sure if those apply. > You'd need to read two wiki pages carefully. The first explains how > microcode > can be built and included in your system, so that it is loaded as early as > possible in the boot up process. The idea is you'd want any CPU bugs to be > patched before you use the CPU to load and start running your kernel. > > https://wiki.gentoo.org/wiki/Microcode > > The second page, relevant to AMD CPUs, points to the particular microcode > blob > you'd need to use for your CPU: > > https://wiki.gentoo.org/wiki/AMD_microcode > > It explains the hexadecimal number '19h' corresponds to your decimal '25'. > Therefore your family 25 CPU requires the 'amd-ucode/microcode_amd_fam19h' > blob. Whether you build this as part of your initrd, or you specify it in > your kernel config so it becomes part of the kernel image, is your call. > > >> Either way, I do have the >> amd-uc.img thing in /boot. I think the firmware package puts it there. > I think the initrd builder (e.g. dracut) puts it there and GRUB loads it. I was wondering where that came from. Makes sense. > > >> Anyway, it finds it when I update grub config so I need a init thingy. > You do not need an initrd if the only reason for running an initrd image is > to > load your microcode. The kernel is perfectly capable of doing this on its > own > - see the above links. > I was just clarifying that with Peter. So, if I have a microcode image and a kernel, it will boot, with no init thingy? >> I was kinda hoping I could ditch it but I guess it is the best way to >> load the microcode thing. I've read it is best to load the microcode >> pretty early. It was a thought. > It's a good thought and your hope can still be realised. I suggest you start > with reading the above two links. I been reading those, a couple times or so. Just trying to clear up the mud. LOL While I would like to just include this in the kernel itself, that may not be the best for my situation. I may update the kernel once a year, if that. If I have a kernel as a backup that is three or four years old, it will have microcode that is that old as well and lack any new updates. Having it as a image means it will be updated when needed and have the new code whenever I reboot. So, for my situation, having older kernels as backups and such, it may be better to have the image method instead of including it into the kernel. I'm still thinking on this but if I understand this correctly, having a microcode image and kernel is the best way for me if I can remove the init thingy from the process. It sounds like I can. Dale :-) :-) P. S. I may start a new thread about my kernel upgrade process. Just to be sure that when I do it on those rare occasions that I am doing all the right steps. It has been working but I need to document this thing, so I don't forget something. ;-)