[LTP] [PATCH] lib: Add library function for parsing kernel config

Cyril Hrubis chrubis@suse.cz
Fri Nov 16 15:00:35 CET 2018


Hi!
> > diff --git a/lib/tst_kconfig.c b/lib/tst_kconfig.c
> > new file mode 100644
> > +
> > +	snprintf(path_buf, path_buf_len, "/boot/config-%s", un.release);
> > +
> > +	if (!access(path_buf, F_OK))
> > +		return path_buf;
> > +
>   Could add suport for Clear Linux kconfig location:
> 	snprintf(path_buf, path_buf_len, "/lib/kernel/config-%s", un.release);
> 
> 	if (!access(path_buf, F_OK))
> 		return path_buf;

No problem, will add that in v2?

> > +	tst_res(TINFO, "Couldn't locate kernel config!");
> > +
> > +	return NULL;
> > +}
> 
> > +	int abort_test = 0;
> > +
> > +	for (i = 0; i < conf_cnt; i++) {
> > +		if (!conf_match[i]) {
> > +			abort_test = 1;
> > +			tst_res(TINFO, "Kernel is missing %s", kconfigs[i]);
>    Could change TINFO above to TCONF?

What's the point? We do exit with TCONF below anyway.

> > +		}
> > +	}
> > +
> > +	if (abort_test)
> > +		tst_brk(TCONF, "Aborting test due to missing kernel config options!");
> 	Add 'above' in print?
> 		tst_brk(TCONF,
> 			"Aborting test due to missing above kernel config options!");

Sure, np.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list