diff --git a/install/dracut-install.c b/install/dracut-install.c index 9e415b5e..7cda499d 100644 --- a/install/dracut-install.c +++ b/install/dracut-install.c @@ -1151,6 +1151,8 @@ static int install_firmware(struct kmod_module *mod) ret = -1; STRV_FOREACH(q, firmwaredirs) { _cleanup_free_ char *fwpath = NULL; + _cleanup_free_ char *fwpath_xz = NULL; + const char *fw; struct stat sb; int r; @@ -1160,12 +1162,21 @@ static int install_firmware(struct kmod_module *mod) exit(EXIT_FAILURE); } + fw = fwpath; if (stat(fwpath, &sb) != 0) { - log_debug("stat(%s) != 0", fwpath); - continue; + r = asprintf(&fwpath_xz, "%s.xz", fwpath); + if (r < 0) { + log_error("Out of memory!"); + exit(EXIT_FAILURE); + } + if (stat(fwpath_xz, &sb) != 0) { + log_debug("stat(%s) != 0", fwpath); + continue; + } + fw = fwpath_xz; } - ret = dracut_install(fwpath, fwpath, false, false, true); + ret = dracut_install(fw, fw, false, false, true); if (ret == 0) log_debug("dracut_install '%s' OK", fwpath); }