image: Fix wic environment issues
The wic environment function needs to run after the rootfs size is setup. We move this code to a specific task, and depend on that task from the wic images and other places its needed. This fixes: ====================================================================== FAIL: test_image_env (oeqa.selftest.wic.Wic) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/utils/decorators.py", line 106, in wrapped_f return func(*args, **kwargs) File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/wic.py", line 218, in test_image_env self.assertTrue(var in content, "%s is not in .env file" % var) AssertionError: False is not true : ROOTFS_SIZE is not in .env file (From OE-Core rev: 606f9e2d7d8d389c8d4f5c3090139d3bb780e09c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
1da8f52b67
commit
fb1654fee4
|
@ -11,7 +11,7 @@ DEPENDS = "syslinux syslinux-native parted-native dosfstools-native mtools-nativ
|
||||||
|
|
||||||
# core-image-minimal is referenced in .wks, so we need its rootfs
|
# core-image-minimal is referenced in .wks, so we need its rootfs
|
||||||
# to be ready before our rootfs
|
# to be ready before our rootfs
|
||||||
do_rootfs[depends] += "core-image-minimal:do_rootfs"
|
do_rootfs[depends] += "core-image-minimal:do_rootfs_wicenv"
|
||||||
|
|
||||||
IMAGE_ROOTFS_EXTRA_SPACE = "2000"
|
IMAGE_ROOTFS_EXTRA_SPACE = "2000"
|
||||||
|
|
||||||
|
|
|
@ -242,8 +242,6 @@ fakeroot python do_image () {
|
||||||
pre_process_cmds = d.getVar("IMAGE_PREPROCESS_COMMAND", True)
|
pre_process_cmds = d.getVar("IMAGE_PREPROCESS_COMMAND", True)
|
||||||
|
|
||||||
execute_pre_post_process(d, pre_process_cmds)
|
execute_pre_post_process(d, pre_process_cmds)
|
||||||
|
|
||||||
write_wic_env(d)
|
|
||||||
}
|
}
|
||||||
do_image[dirs] = "${TOPDIR}"
|
do_image[dirs] = "${TOPDIR}"
|
||||||
do_image[umask] = "022"
|
do_image[umask] = "022"
|
||||||
|
@ -264,7 +262,7 @@ addtask do_image_complete after do_image before do_build
|
||||||
# Write environment variables used by wic
|
# Write environment variables used by wic
|
||||||
# to tmp/sysroots/<machine>/imgdata/<image>.env
|
# to tmp/sysroots/<machine>/imgdata/<image>.env
|
||||||
#
|
#
|
||||||
def write_wic_env(d):
|
python do_rootfs_wicenv () {
|
||||||
wicvars = d.getVar('WICVARS', True)
|
wicvars = d.getVar('WICVARS', True)
|
||||||
if not wicvars:
|
if not wicvars:
|
||||||
return
|
return
|
||||||
|
@ -278,6 +276,10 @@ def write_wic_env(d):
|
||||||
value = d.getVar(var, True)
|
value = d.getVar(var, True)
|
||||||
if value:
|
if value:
|
||||||
envf.write('%s="%s"\n' % (var, value.strip()))
|
envf.write('%s="%s"\n' % (var, value.strip()))
|
||||||
|
}
|
||||||
|
addtask do_rootfs_wicenv after do_rootfs before do_image_wic
|
||||||
|
do_rootfs_wicenv[vardeps] += "${WICVARS}"
|
||||||
|
do_rootfs_wicenv[prefuncs] = 'set_image_size'
|
||||||
|
|
||||||
def setup_debugfs_variables(d):
|
def setup_debugfs_variables(d):
|
||||||
d.appendVar('IMAGE_ROOTFS', '-dbg')
|
d.appendVar('IMAGE_ROOTFS', '-dbg')
|
||||||
|
|
|
@ -201,7 +201,6 @@ IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH WKS_FILES"
|
||||||
# Rebuild when the wks file or vars in WICVARS change
|
# Rebuild when the wks file or vars in WICVARS change
|
||||||
USING_WIC = "${@bb.utils.contains_any('IMAGE_FSTYPES', 'wic ' + ' '.join('wic.%s' % c for c in '${COMPRESSIONTYPES}'.split()), '1', '', d)}"
|
USING_WIC = "${@bb.utils.contains_any('IMAGE_FSTYPES', 'wic ' + ' '.join('wic.%s' % c for c in '${COMPRESSIONTYPES}'.split()), '1', '', d)}"
|
||||||
do_image_wic[file-checksums] += "${@'${WKS_FULL_PATH}:%s' % os.path.exists('${WKS_FULL_PATH}') if '${USING_WIC}' else ''}"
|
do_image_wic[file-checksums] += "${@'${WKS_FULL_PATH}:%s' % os.path.exists('${WKS_FULL_PATH}') if '${USING_WIC}' else ''}"
|
||||||
do_image_wic[vardeps] += "${@bb.utils.contains("USING_WIC", "1", "${WICVARS}", "", d)}"
|
|
||||||
|
|
||||||
EXTRA_IMAGECMD = ""
|
EXTRA_IMAGECMD = ""
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ class Wic(oeSelfTest):
|
||||||
if not Wic.image_is_ready:
|
if not Wic.image_is_ready:
|
||||||
bitbake('syslinux syslinux-native parted-native gptfdisk-native '
|
bitbake('syslinux syslinux-native parted-native gptfdisk-native '
|
||||||
'dosfstools-native mtools-native')
|
'dosfstools-native mtools-native')
|
||||||
bitbake('core-image-minimal')
|
bitbake('core-image-minimal:do_image_complete core-image-minimal:do_rootfs_wicenv')
|
||||||
Wic.image_is_ready = True
|
Wic.image_is_ready = True
|
||||||
|
|
||||||
rmtree(self.resultdir, ignore_errors=True)
|
rmtree(self.resultdir, ignore_errors=True)
|
||||||
|
|
Loading…
Reference in New Issue