[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#652672: busybox: modprobe does not handle builtins



[Note: the right bug# for this is #652672]

On 22.07.2012 20:02, Ben Hutchings wrote:
> OK, attaching a new patch that does that as well.

> @@ -595,6 +598,11 @@ int modprobe_main(int argc UNUSED_PARAM,
>  		while (config_read(parser, &s, 1, 1, "# \t", PARSE_NORMAL & ~PARSE_GREEDY))
>  			get_or_add_modentry(s)->flags |= MODULE_FLAG_LOADED;
>  		config_close(parser);
> +
> +		parser = config_open2("modules.builtin", fopen_for_read);
> +		while (config_read(parser, &s, 1, 1, "# \t", PARSE_NORMAL))
> +			get_or_add_modentry(s)->flags |= MODULE_FLAG_BUILTIN;
> +		config_close(parser);
>  	}
>
>  	if (opt & (OPT_INSERT_ALL | OPT_REMOVE)) {

This piece should check if modules.builtin has been opened successfully,
or else `parser' variable will be NULL.

		parser = config_open2("modules.builtin", fopen_for_read);
		if (parser) {
			while (config_read(parser, &s, 1, 1, "# \t", PARSE_NORMAL))
				get_or_add_modentry(s)->flags |= MODULE_FLAG_BUILTIN;
			config_close(parser);
		}

This is quite a trivial change, is that okay to do this modification
yet retain your S-o-b line (and change the bug# as well)?

I want to include this patch with the next revision of busybox,
and sent it upstream.

Thanks!

/mjt


Reply to: