All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pengfei Xu <pengfei.xu@intel.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] lib: Add library function for parsing kernel config
Date: Fri, 16 Nov 2018 11:54:01 +0800	[thread overview]
Message-ID: <20181116035401.z2o67pjhxtutap6x@xpf-desktop> (raw)
In-Reply-To: <20181115134441.27359-1-chrubis@suse.cz>

Hi Cyril,
  Thanks for kconfig checking API!
  It's worked in most of Linux OS.

  Just add konfig to support Clear Linux which kconfig is saved
  in "/lib/kernel/config-xxx"
  And for print comments, if you agree as below.

On 2018-11-15 at 14:44:41 +0100, Cyril Hrubis wrote:
> 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;

> +	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?

> +		}
> +	}
> +
> +	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!");

Thanks!
B.R.

  parent reply	other threads:[~2018-11-16  3:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-15 13:44 [LTP] [PATCH] lib: Add library function for parsing kernel config Cyril Hrubis
2018-11-15 18:57 ` Cristian Marussi
2018-11-16 13:53   ` Cyril Hrubis
2018-11-15 20:16 ` Tim.Bird
2018-11-16 13:59   ` Cyril Hrubis
2018-11-21 19:53     ` Tim.Bird
2018-11-15 20:43 ` Tim.Bird
2018-11-16 13:57   ` Cyril Hrubis
2018-11-16  3:54 ` Pengfei Xu [this message]
2018-11-16  4:03   ` Tim.Bird
2018-11-16  4:57     ` Pengfei Xu
2018-11-16 14:00   ` Cyril Hrubis
2018-11-17  5:41     ` Pengfei Xu
2018-11-23  4:56 ` Sandeep Patil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181116035401.z2o67pjhxtutap6x@xpf-desktop \
    --to=pengfei.xu@intel.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.