From: Harald Hoyer Date: Mon, 7 May 2018 13:21:35 +0000 (+0200) Subject: don't error out, if no modules were installed X-Git-Tag: 048~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ad32155907fc4accd0a822365f6fcf1c355cfcb;p=thirdparty%2Fdracut.git don't error out, if no modules were installed dracut-install … -m -s drm_crtc_init =drivers/staging should not return an error, if no module was found in =drivers/staging https://bugzilla.redhat.com/show_bug.cgi?id=1575527 --- diff --git a/install/dracut-install.c b/install/dracut-install.c index 4b2ff896d..14fc0ab9a 100644 --- a/install/dracut-install.c +++ b/install/dracut-install.c @@ -1394,6 +1394,7 @@ static int install_modules(int argc, char **argv) const char *abskpath = NULL; char *p; int i; + int modinst = 0; ctx = kmod_new(kerneldir, NULL); abskpath = kmod_get_dirname(ctx); @@ -1498,6 +1499,7 @@ static int install_modules(int argc, char **argv) return -ENOENT; }; ret = ( ret == 0 ? 0 : r ); + modinst = 1; } } else if (argv[i][0] == '=') { _cleanup_free_ char *path1 = NULL, *path2 = NULL, *path3 = NULL; @@ -1592,6 +1594,7 @@ static int install_modules(int argc, char **argv) return -ENOENT; }; ret = ( ret == 0 ? 0 : r ); + modinst = 1; } } if (errno) { @@ -1638,10 +1641,11 @@ static int install_modules(int argc, char **argv) return -ENOENT; }; ret = ( ret == 0 ? 0 : r ); + modinst = 1; } } - if ((ret != 0) && (!arg_optional)) { + if ((modinst != 0) && (ret != 0) && (!arg_optional)) { if (!arg_silent) log_error("ERROR: installing '%s'", argv[i]); return EXIT_FAILURE;