From: Andy Shevchenko Date: Fri, 5 Feb 2021 21:40:07 +0200 Subject: [PATCH v1] test: Include /sbin to the PATH when creating ext4 disk image In-Reply-To: References: <20210203153155.14005-1-andriy.shevchenko@linux.intel.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Fri, Feb 05, 2021 at 07:29:40PM +0200, Andy Shevchenko wrote: > On Thu, Feb 04, 2021 at 08:17:23PM -0700, Simon Glass wrote: > > On Wed, 3 Feb 2021 at 08:32, Andy Shevchenko > > wrote: > > ... > > > > 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 > > > > Is it not enough to do os.path.abspath('.') ? I think it would be good > > to have a comment as to what we need this gymnastics. > > It's just a portable code. Of course we can simple use abspath() on *nix OSes. > My preference is to have portable code, though. What's yours? > > > > + 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) Since below we have /dev/zero explicitly I will replace the above to simple '/sbin'. -- With Best Regards, Andy Shevchenko