mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-06-09 23:36:03 +09:00
test: Include /sbin to the PATH when creating file system
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>
This commit is contained in:
parent
af8e2d4746
commit
b2710faf82
|
@ -159,6 +159,10 @@ def mk_fs(config, fs_type, size, id):
|
||||||
|
|
||||||
count = (size + 1048576 - 1) / 1048576
|
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:
|
try:
|
||||||
check_call('rm -f %s' % fs_img, shell=True)
|
check_call('rm -f %s' % fs_img, shell=True)
|
||||||
check_call('dd if=/dev/zero of=%s bs=1M count=%d'
|
check_call('dd if=/dev/zero of=%s bs=1M count=%d'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user