intel-microcode on Debian/Ubuntu uses the `.initramfs` suffix for the
ucode files (e.g. `/lib/firmware/intel-ucode/06-9e-0b.initramfs`).
`get_ucode_file` returns `family-model-stepping` on Intel (e.g.
`06-9e-0b`). If the microcode file is found, the loop is broken.
Otherwise `.early` is appended to the name (e.g. `06-9e-0b.early`) and
tried again. If that file is not found, `.initramfs` is appended to the
name (e.g. `06-9e-0b.early.initramfs`), but this suffix should be
appended to the initial name (e.g. `06-9e-0b.initramfs`).
Fixes: 16573680d1b6 ("fix(dracut): microcode loading")
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
if [[ $hostonly ]]; then
_src=$(get_ucode_file)
[[ $_src ]] || break
- [[ -r $_fwdir/$_fw/$_src ]] || _src="${_src}.early"
- [[ -r $_fwdir/$_fw/$_src ]] || _src="${_src}.initramfs"
- [[ -r $_fwdir/$_fw/$_src ]] || break
+ if [[ -r "$_fwdir/$_fw/${_src}.early" ]]; then
+ _src="${_src}.early"
+ elif [[ -r "$_fwdir/$_fw/${_src}.initramfs" ]]; then
+ _src="${_src}.initramfs"
+ else
+ [[ -r $_fwdir/$_fw/$_src ]] || break
+ fi
fi
for i in $_fwdir/$_fw/$_src; do