mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 21:09:03 +02:00
wic: fix getting path of native sysroot
wic used STAGING_DIR_NATIVE variable as a path to native sysroot. This doesn't work with recipe specific sysroots as STAGING_DIR_NATIVE points to the native sysroot of the current recipe. Used RECIPE_SYSROOT_NATIVE variable of wic-tools recipe to fix the issue. (From OE-Core rev: de9d7d14cd03e4dfc5812890a53c79b706b56537) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
a79b32c75a
commit
168f62e427
|
@ -210,12 +210,12 @@ class Wic(oeSelfTest):
|
||||||
def test_build_artifacts(self):
|
def test_build_artifacts(self):
|
||||||
"""Test wic create directdisk providing all artifacts."""
|
"""Test wic create directdisk providing all artifacts."""
|
||||||
bbvars = dict((var.lower(), get_bb_var(var, 'core-image-minimal'))
|
bbvars = dict((var.lower(), get_bb_var(var, 'core-image-minimal'))
|
||||||
for var in ('STAGING_DATADIR', 'DEPLOY_DIR_IMAGE',
|
for var in ('STAGING_DATADIR', 'DEPLOY_DIR_IMAGE', 'IMAGE_ROOTFS'))
|
||||||
'STAGING_DIR_NATIVE', 'IMAGE_ROOTFS'))
|
bbvars['recipe_sysroot_native'] = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
|
||||||
status = runCmd("wic create directdisk "
|
status = runCmd("wic create directdisk "
|
||||||
"-b %(staging_datadir)s "
|
"-b %(staging_datadir)s "
|
||||||
"-k %(deploy_dir_image)s "
|
"-k %(deploy_dir_image)s "
|
||||||
"-n %(staging_dir_native)s "
|
"-n %(recipe_sysroot_native)s "
|
||||||
"-r %(image_rootfs)s" % bbvars).status
|
"-r %(image_rootfs)s" % bbvars).status
|
||||||
self.assertEqual(0, status)
|
self.assertEqual(0, status)
|
||||||
self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
|
self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
|
||||||
|
@ -301,13 +301,13 @@ class Wic(oeSelfTest):
|
||||||
def test_rootfs_artifacts(self):
|
def test_rootfs_artifacts(self):
|
||||||
"""Test usage of rootfs plugin with rootfs paths"""
|
"""Test usage of rootfs plugin with rootfs paths"""
|
||||||
bbvars = dict((var.lower(), get_bb_var(var, 'core-image-minimal'))
|
bbvars = dict((var.lower(), get_bb_var(var, 'core-image-minimal'))
|
||||||
for var in ('STAGING_DATADIR', 'DEPLOY_DIR_IMAGE',
|
for var in ('STAGING_DATADIR', 'DEPLOY_DIR_IMAGE', 'IMAGE_ROOTFS'))
|
||||||
'STAGING_DIR_NATIVE', 'IMAGE_ROOTFS'))
|
bbvars['recipe_sysroot_native'] = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
|
||||||
bbvars['wks'] = "directdisk-multi-rootfs"
|
bbvars['wks'] = "directdisk-multi-rootfs"
|
||||||
status = runCmd("wic create %(wks)s "
|
status = runCmd("wic create %(wks)s "
|
||||||
"--bootimg-dir=%(staging_datadir)s "
|
"--bootimg-dir=%(staging_datadir)s "
|
||||||
"--kernel-dir=%(deploy_dir_image)s "
|
"--kernel-dir=%(deploy_dir_image)s "
|
||||||
"--native-sysroot=%(staging_dir_native)s "
|
"--native-sysroot=%(recipe_sysroot_native)s "
|
||||||
"--rootfs-dir rootfs1=%(image_rootfs)s "
|
"--rootfs-dir rootfs1=%(image_rootfs)s "
|
||||||
"--rootfs-dir rootfs2=%(image_rootfs)s"
|
"--rootfs-dir rootfs2=%(image_rootfs)s"
|
||||||
% bbvars).status
|
% bbvars).status
|
||||||
|
|
|
@ -175,8 +175,7 @@ def wic_create_subcommand(args, usage_str):
|
||||||
|
|
||||||
rootfs_dir = get_bitbake_var("IMAGE_ROOTFS", options.image_name)
|
rootfs_dir = get_bitbake_var("IMAGE_ROOTFS", options.image_name)
|
||||||
kernel_dir = get_bitbake_var("DEPLOY_DIR_IMAGE", options.image_name)
|
kernel_dir = get_bitbake_var("DEPLOY_DIR_IMAGE", options.image_name)
|
||||||
native_sysroot = get_bitbake_var("STAGING_DIR_NATIVE",
|
native_sysroot = os.path.join(get_bitbake_var("RECIPE_SYSROOT_NATIVE", "wic-tools"))
|
||||||
options.image_name)
|
|
||||||
else:
|
else:
|
||||||
if options.build_rootfs:
|
if options.build_rootfs:
|
||||||
print("Image name is not specified, exiting. (Use -e/--image-name to specify it)\n")
|
print("Image name is not specified, exiting. (Use -e/--image-name to specify it)\n")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user