From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: u-boot@lists.denx.de
Subject: [PATCH v1] test: Include /sbin to the PATH when creating ext4 disk image
Date: Wed, 3 Feb 2021 17:31:55 +0200 [thread overview]
Message-ID: <20210203153155.14005-1-andriy.shevchenko@linux.intel.com> (raw)
On some distributions the mkfs.ext4 is under /sbin and /sbin is not set
for mere users. Include /sbin to the PATH when creating ext4 disk image,
so that users won't get a scary traceback from Python.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
test/py/tests/test_env.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/test/py/tests/test_env.py b/test/py/tests/test_env.py
index 940279651da0..536467320e06 100644
--- a/test/py/tests/test_env.py
+++ b/test/py/tests/test_env.py
@@ -414,6 +414,9 @@ def mk_env_ext4(state_test_env):
if os.path.exists(persistent):
c.log.action('Disk image file ' + persistent + ' already exists')
else:
+ root_path = os.path.abspath('.').split(os.path.sep)[0] + os.path.sep
+ sbin_path = os.path.join(root_path, 'sbin')
+ os.environ["PATH"] += os.pathsep + sbin_path
try:
u_boot_utils.run_and_log(c, 'dd if=/dev/zero of=%s bs=1M count=16' % persistent)
u_boot_utils.run_and_log(c, 'mkfs.ext4 %s' % persistent)
--
2.30.0
next reply other threads:[~2021-02-03 15:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-03 15:31 Andy Shevchenko [this message]
2021-02-05 3:17 ` [PATCH v1] test: Include /sbin to the PATH when creating ext4 disk image Simon Glass
2021-02-05 17:29 ` Andy Shevchenko
2021-02-05 19:40 ` Andy Shevchenko
2021-02-05 23:57 ` Simon Glass
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=20210203153155.14005-1-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=u-boot@lists.denx.de \
/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