* [PATCH v1 1/1] test: Include /sbin to the PATH when creating file system
@ 2021-06-10 15:08 Andy Shevchenko
2021-06-24 13:15 ` Tom Rini
0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2021-06-10 15:08 UTC (permalink / raw)
To: u-boot; +Cc: Andy Shevchenko
On some distributions the mkfs is under /sbin and /sbin is not set
for mere users. Include /sbin to the PATH when creating file system,
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_fs/conftest.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/test/py/tests/test_fs/conftest.py b/test/py/tests/test_fs/conftest.py
index 410a675b9714..7325486cdb1a 100644
--- a/test/py/tests/test_fs/conftest.py
+++ b/test/py/tests/test_fs/conftest.py
@@ -159,6 +159,10 @@ def mk_fs(config, fs_type, size, id):
count = (size + 1048576 - 1) / 1048576
+ # Some distributions do not add /sbin to the default PATH, where mkfs lives
+ if '/sbin' not in os.environ["PATH"].split(os.pathsep):
+ os.environ["PATH"] += os.pathsep + '/sbin'
+
try:
check_call('rm -f %s' % fs_img, shell=True)
check_call('dd if=/dev/zero of=%s bs=1M count=%d'
--
2.30.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v1 1/1] test: Include /sbin to the PATH when creating file system
2021-06-10 15:08 [PATCH v1 1/1] test: Include /sbin to the PATH when creating file system Andy Shevchenko
@ 2021-06-24 13:15 ` Tom Rini
0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2021-06-24 13:15 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: u-boot
[-- Attachment #1: Type: text/plain, Size: 391 bytes --]
On Thu, Jun 10, 2021 at 06:08:42PM +0300, Andy Shevchenko wrote:
> On some distributions the mkfs is under /sbin and /sbin is not set
> for mere users. Include /sbin to the PATH when creating file system,
> so that users won't get a scary traceback from Python.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Applied to u-boot/master, thanks!
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-06-24 13:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-10 15:08 [PATCH v1 1/1] test: Include /sbin to the PATH when creating file system Andy Shevchenko
2021-06-24 13:15 ` Tom Rini
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.