mirror of
https://git.yoctoproject.org/poky
synced 2026-05-31 12:49:46 +00:00
wic: use native parted
Used exec_native_cmd instead of find_binary_path to run parted. Got rid of find_binary_path as it's not used anywhere else. There are several tools wic is trying to find not only in sysroot, but also in host root. Parted is a special as on some distros it's installed in /usr/sbin, which is not in the user's PATH. This makes wic to fail with error "External command 'parted' not found, exiting." [YOCTO #7122] (From OE-Core rev: 76adf38c0d8e0faf04a5ecb3fcfbe831c85bb81f) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
df9069d958
commit
ea07f0325c
@@ -40,13 +40,13 @@ class Image:
|
||||
An Image is a container for a set of DiskImages and associated
|
||||
partitions.
|
||||
"""
|
||||
def __init__(self):
|
||||
def __init__(self, native_sysroot=None):
|
||||
self.disks = {}
|
||||
self.partitions = []
|
||||
self.parted = find_binary_path("parted")
|
||||
# Size of a sector used in calculations
|
||||
self.sector_size = SECTOR_SIZE
|
||||
self._partitions_layed_out = False
|
||||
self.native_sysroot = native_sysroot
|
||||
|
||||
def __add_disk(self, disk_name):
|
||||
""" Add a disk 'disk_name' to the internal list of disks. Note,
|
||||
@@ -225,11 +225,12 @@ class Image:
|
||||
def __run_parted(self, args):
|
||||
""" Run parted with arguments specified in the 'args' list. """
|
||||
|
||||
args.insert(0, self.parted)
|
||||
args.insert(0, "parted")
|
||||
args = ' '.join(args)
|
||||
msger.debug(args)
|
||||
|
||||
rc, out = runner.runtool(args, catch = 3)
|
||||
out = out.strip()
|
||||
rc, out = exec_native_cmd(args, self.native_sysroot)
|
||||
|
||||
if out:
|
||||
msger.debug('"parted" output: %s' % out)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user