From: Anatoly Burakov <anatoly.burakov@intel.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com, roszenrami@gmail.com, stable@dpdk.org
Subject: [dpdk-dev] [PATCH v2] devbind: check for lspci
Date: Tue, 13 Nov 2018 16:06:26 +0000 [thread overview]
Message-ID: <9b28e77a26d11b3cb8d063ea5949f231b0f9830d.1542124966.git.anatoly.burakov@intel.com> (raw)
In-Reply-To: <d2749a0c9f18188c56e02e61c602e65ca88e099d.1541598755.git.anatoly.burakov@intel.com>
On some distributions (such as CentOS 7) lspci may not be installed
by default, causing exceptions which are difficult to interpret.
Fix devbind script to check if lspci is installed at script startup.
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
Notes:
v2: correct package name to "pciutils"
usertools/dpdk-devbind.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py
index 7d564634c..40dc28a7d 100755
--- a/usertools/dpdk-devbind.py
+++ b/usertools/dpdk-devbind.py
@@ -655,6 +655,13 @@ def do_arg_actions():
def main():
'''program main function'''
+ # check if lspci is installed, suppress any output
+ with open(os.devnull, 'w') as devnull:
+ ret = subprocess.call(['which', 'lspci'],
+ stdout=devnull, stderr=devnull)
+ if ret != 0:
+ print("'lspci' not found - please install 'pciutils'")
+ sys.exit(1)
parse_args()
check_modules()
clear_data()
--
2.17.1
next prev parent reply other threads:[~2018-11-13 16:06 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-07 13:56 [dpdk-dev] [PATCH] " Anatoly Burakov
2018-11-07 16:01 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2018-11-07 16:30 ` Burakov, Anatoly
2018-11-07 18:07 ` Ferruh Yigit
2018-11-08 20:38 ` Rami Rosen
2018-11-09 12:03 ` Burakov, Anatoly
2018-11-10 11:03 ` Rami Rosen
2018-11-12 9:18 ` Burakov, Anatoly
2018-11-13 16:03 ` Burakov, Anatoly
2018-11-13 16:06 ` Anatoly Burakov [this message]
2018-11-16 16:54 ` [dpdk-dev] [PATCH v2] " Rami Rosen
2018-11-18 23:05 ` Thomas Monjalon
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=9b28e77a26d11b3cb8d063ea5949f231b0f9830d.1542124966.git.anatoly.burakov@intel.com \
--to=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=roszenrami@gmail.com \
--cc=stable@dpdk.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).