Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 687602
Collapse All | Expand All

(-)a/install/dracut-install.c (-3 / +25 lines)
Lines 84-89 static bool arg_mod_filter_noname = false; Link Here
84
static int dracut_install(const char *src, const char *dst, bool isdir, bool resolvedeps, bool hashdst);
84
static int dracut_install(const char *src, const char *dst, bool isdir, bool resolvedeps, bool hashdst);
85
85
86
86
87
static inline void kmod_module_unrefp(struct kmod_module **p) {
88
        if (*p)
89
                kmod_module_unref(*p);
90
}
91
#define _cleanup_kmod_module_unref_ _cleanup_(kmod_module_unrefp)
87
92
88
static inline void kmod_module_unref_listp(struct kmod_list **p) {
93
static inline void kmod_module_unref_listp(struct kmod_list **p) {
89
        if (*p)
94
        if (*p)
Lines 1230-1257 static bool check_module_path(const char *path) Link Here
1230
static int install_dependent_modules(struct kmod_list *modlist)
1235
static int install_dependent_modules(struct kmod_list *modlist)
1231
{
1236
{
1232
        struct kmod_list *itr;
1237
        struct kmod_list *itr;
1233
        struct kmod_module *mod;
1234
        const char *path = NULL;
1238
        const char *path = NULL;
1235
        const char *name = NULL;
1239
        const char *name = NULL;
1236
        int ret = 0;
1240
        int ret = 0;
1237
1241
1238
        kmod_list_foreach(itr, modlist) {
1242
        kmod_list_foreach(itr, modlist) {
1243
		_cleanup_kmod_module_unref_ struct kmod_module *mod = NULL;
1239
                mod = kmod_module_get_module(itr);
1244
                mod = kmod_module_get_module(itr);
1240
                path = kmod_module_get_path(mod);
1245
                path = kmod_module_get_path(mod);
1241
1246
1247
		if (check_hashmap(items_failed, path))
1248
			return -1;
1249
1250
		if (check_hashmap(items, path)) {
1251
			continue;
1252
		}
1253
1242
                name = kmod_module_get_name(mod);
1254
                name = kmod_module_get_name(mod);
1255
1243
                if ((path == NULL) || (arg_mod_filter_noname && (regexec(&mod_filter_noname, name, 0, NULL, 0) == 0))) {
1256
                if ((path == NULL) || (arg_mod_filter_noname && (regexec(&mod_filter_noname, name, 0, NULL, 0) == 0))) {
1244
                        kmod_module_unref(mod);
1245
                        continue;
1257
                        continue;
1246
                }
1258
                }
1259
1247
                ret = dracut_install(path, &path[kerneldirlen], false, false, true);
1260
                ret = dracut_install(path, &path[kerneldirlen], false, false, true);
1248
                if (ret == 0) {
1261
                if (ret == 0) {
1262
			_cleanup_kmod_module_unref_list_ struct kmod_list *modlist = NULL;
1263
			_cleanup_kmod_module_unref_list_ struct kmod_list *modpre = NULL;
1264
			_cleanup_kmod_module_unref_list_ struct kmod_list *modpost = NULL;
1249
                        log_debug("dracut_install '%s' '%s' OK", path, &path[kerneldirlen]);
1265
                        log_debug("dracut_install '%s' '%s' OK", path, &path[kerneldirlen]);
1250
                        install_firmware(mod);
1266
                        install_firmware(mod);
1267
			modlist = kmod_module_get_dependencies(mod);
1268
			ret = install_dependent_modules(modlist);
1269
			if (ret == 0) {
1270
				ret = kmod_module_get_softdeps(mod, &modpre, &modpost);
1271
				if (ret == 0)
1272
					ret = install_dependent_modules(modpre);
1273
			}
1251
                } else {
1274
                } else {
1252
                        log_error("dracut_install '%s' '%s' ERROR", path, &path[kerneldirlen]);
1275
                        log_error("dracut_install '%s' '%s' ERROR", path, &path[kerneldirlen]);
1253
                }
1276
                }
1254
                kmod_module_unref(mod);
1255
        }
1277
        }
1256
1278
1257
        return ret;
1279
        return ret;

Return to bug 687602