Ignore:
Timestamp:
01/09/2020 04:18:14 PM (4 years ago)
Author:
Pierre Labastie <pieere@…>
Branches:
10.0, 10.1, 11.0, 11.1, 11.2, 11.3, 12.0, 12.1, 9.1, kea, ken/TL2024, ken/inkscape-core-mods, ken/tuningfonts, lazarus, lxqt, plabs/newcss, plabs/python-mods, python3.11, qt5new, rahul/power-profiles-daemon, renodr/vulkan-addition, trunk, upgradedb, xry111/intltool, xry111/llvm18, xry111/soup3, xry111/test-20220226, xry111/xf86-video-removal
Children:
cce4984
Parents:
e3b66f3
Message:

Add early loading of microcode to the initramfs
Fix a bug in mkinitramfs, leading to a "cp" error

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@22557 af4574ff-66df-0310-9fd7-8a98e5e911e0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • postlfs/filesystems/initramfs.xml

    re3b66f3 r6e493187  
    6969  fi
    7070
    71   if [ -n $file ] ; then
     71  if [ -n "$file" ] ; then
    7272    cp $file $WDIR/$2
    7373  else
     
    209209# Install libraries
    210210sort $unsorted | uniq | while read library ; do
    211   if [ "$library" == "linux-vdso.so.1" ] ||
    212      [ "$library" == "linux-gate.so.1" ]; then
     211# linux-vdso and linux-gate are pseudo libraries and do not correspond to a file
     212# libsystemd-shared is in /lib/systemd, so it is not found by copy, and
     213# it is copied below anyway
     214  if [[ "$library" == linux-vdso.so.1 ]] ||
     215     [[ "$library" == linux-gate.so.1 ]] ||
     216     [[ "$library" == libsystemd-shared* ]]; then
    213217    continue
    214218  fi
     
    244248( cd $WDIR ; find . | cpio -o -H newc --quiet | gzip -9 ) &gt; $INITRAMFS_FILE
    245249
    246 # Remove the temporary directory and file
     250# Prepare early loading of microcode if available
     251if ls /lib/firmware/intel-ucode/* &gt;/dev/null 2&gt;&amp;1 ||
     252   ls /lib/firmware/amd-ucode/*   &gt;/dev/null 2&gt;&amp;1; then
     253
     254# first empty WDIR to reuse it
     255  rm -r $WDIR/*
     256
     257  DSTDIR=$WDIR/kernel/x86/microcode
     258  mkdir -p $DSTDIR
     259
     260  if [ -d /lib/firmware/amd-ucode ]; then
     261    cat /lib/firmware/amd-ucode/microcode_amd*.bin &gt; $DSTDIR/AuthenticAMD.bin
     262  fi
     263
     264  if [ -d /lib/firmware/intel-ucode ]; then
     265    cat /lib/firmware/intel-ucode/* &gt; $DSTDIR/GenuineIntel.bin
     266  fi
     267
     268  ( cd $WDIR; find . | cpio -o -H newc --quiet ) &gt; microcode.img
     269  cat microcode.img $INITRAMFS_FILE &gt; tmpfile
     270  mv tmpfile $INITRAMFS_FILE
     271  rm microcode.img
     272fi
     273
     274# Remove the temporary directories and files
    247275rm -rf $WDIR $unsorted
    248276printf "done.\n"
     
    399427      <xref role="runtime" linkend="mdadm"/> must be installed before
    400428      generating the initramfs, if the system partition uses them.
    401 
    402429    </para>
    403430
     
    421448    current directory.</para>
    422449
     450    <para>If early loading of microcode is needed (see <xref
     451    linkend="cpu-microcode"/>), you can install the appropriate blob or
     452    container in <filename class="directory">/lib/firmware</filename>.
     453    It will be automatically added to the initrd when running
     454    <command>mkinitramfs</command>.</para>
     455
    423456    <para>After generating the initrd, copy it to the <filename
    424457    class='directory'>/boot</filename> directory.</para>
Note: See TracChangeset for help on using the changeset viewer.