On Sun, 10 Sep 2017, Philipp Kern wrote:
> On 09/10/2017 02:32 PM, Philipp Kern wrote:
> > 3) Add a patch to dracut.sh (/usr/bin/dracut) because intel-microcode
> > uses the .initramfs suffix for the ucode files where it requests early
> > loading. Given that hostonly is the default for dracut, only including
> > microcode for the machine it is currently running on, we need to add a
> > star to the pattern it looks for:
> > 
> > Index: dracut-045+132/dracut.sh
> > ===================================================================
> > --- dracut-045+132.orig/dracut.sh
> > +++ dracut-045+132/dracut.sh
> > @@ -1649,7 +1649,7 @@ if [[ $early_microcode = yes ]]; then
> >                  _src="*"
> >                  dinfo "*** Constructing ${ucode_dest[$idx]} ****"
> >                  if [[ $hostonly ]]; then
> > -                    _src=$(get_ucode_file)
> > +                    _src="$(get_ucode_file)*"
> >                      [[ $_src ]] || break
> >                      [[ -r $_fwdir/$_fw/$_src ]] || break
> >                  fi
> 
> Unfortunately I left out a line that I didn't copy over when preparing
> the patch. Updated version:
> 
> Index: dracut-045+132/dracut.sh
> ===================================================================
> --- dracut-045+132.orig/dracut.sh
> +++ dracut-045+132/dracut.sh
> @@ -1649,9 +1649,8 @@ if [[ $early_microcode = yes ]]; then
>                  _src="*"
>                  dinfo "*** Constructing ${ucode_dest[$idx]} ****"
>                  if [[ $hostonly ]]; then
> -                    _src=$(get_ucode_file)
> +                    _src="$(get_ucode_file)*"
>                      [[ $_src ]] || break
> -                    [[ -r $_fwdir/$_fw/$_src ]] || break
>                  fi
> 
>                  for i in $_fwdir/$_fw/$_src; do
> 

Thanks.  I wish dracut grew hooks/extensions support to be extensible /
enhanced by other packages...

In the long run, it might be a good idea to detect when
/usr/sbin/iucode_tool is available, and in that case use an alternate
code path to implement early-initramfs support and microcode selection
using iucode-tool and the same behavior config files as the
initramfs-tools extension modules provided by the intel-microcode
package.

-- 
  Henrique Holschuh

Reply via email to