yocto编译错误
主要错误信息
**ERROR: fsl-image-validation-imx-1.0-r0 do_rootfs: Error executing a python function in exec_python_func() autogenerated:**
详情
The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
0001:
*** 0002:do_rootfs(d)
0003:
File: '/home/i-tage/store/imx-yocto-4.14.98-tbox/sources/poky/meta/classes/image.bbclass', lineno: 258, function: do_rootfs
0254: progress_reporter.next_stage()
0255:
0256: # generate rootfs
0257: d.setVarFlag('REPRODUCIBLE_TIMESTAMP_ROOTFS', 'export', '1')
*** 0258: create_rootfs(d, progress_reporter=progress_reporter, logcatcher=logcatcher)
0259:
0260: progress_reporter.finish()
0261:}
0262:do_rootfs[dirs] = "${TOPDIR}"
File: '/home/i-tage/store/imx-yocto-4.14.98-tbox/sources/poky/meta/lib/oe/rootfs.py', lineno: 943, function: create_rootfs
0939: env_bkp = os.environ.copy()
0940:
0941: img_type = d.getVar('IMAGE_PKGTYPE')
0942: if img_type == "rpm":
*** 0943: RpmRootfs(d, manifest_dir, progress_reporter, logcatcher).create()
0944: elif img_type == "ipk":
0945: OpkgRootfs(d, manifest_dir, progress_reporter, logcatcher).create()
0946: elif img_type == "deb":
0947: DpkgRootfs(d, manifest_dir, progress_reporter, logcatcher).create()
File: '/home/i-tage/store/imx-yocto-4.14.98-tbox/sources/poky/meta/lib/oe/rootfs.py', lineno: 187, function: create
0183: if self.progress_reporter:
0184: self.progress_reporter.next_stage()
0185:
0186: # call the package manager dependent create method
*** 0187: self._create()
0188:
0189: sysconfdir = self.image_rootfs + self.d.getVar('sysconfdir')
0190: bb.utils.mkdirhier(sysconfdir)
0191: with open(sysconfdir + "/version", "w+") as ver:
File: '/home/i-tage/store/imx-yocto-4.14.98-tbox/sources/poky/meta/lib/oe/rootfs.py', lineno: 398, function: _create
0394: rpm_pre_process_cmds = self.d.getVar('RPM_PREPROCESS_COMMANDS')
0395: rpm_post_process_cmds = self.d.getVar('RPM_POSTPROCESS_COMMANDS')
0396:
0397: # update PM index files
*** 0398: self.pm.write_index()
0399:
0400: execute_pre_post_process(self.d, rpm_pre_process_cmds)
0401:
0402: if self.progress_reporter:
File: '/home/i-tage/store/imx-yocto-4.14.98-tbox/sources/poky/meta/lib/oe/package_manager.py', lineno: 727, function: write_index
0723:
0724: def write_index(self):
0725: lockfilename = self.d.getVar('DEPLOY_DIR_RPM') + "/rpm.lock"
0726: lf = bb.utils.lockfile(lockfilename, False)
*** 0727: RpmIndexer(self.d, self.rpm_repo_dir).write_index()
0728: bb.utils.unlockfile(lf)
0729:
0730: def insert_feeds_uris(self, feed_uris, feed_base_paths, feed_archs):
0731: from urllib.parse import urlparse
File: '/home/i-tage/store/imx-yocto-4.14.98-tbox/sources/poky/meta/lib/oe/package_manager.py', lineno: 105, function: write_index
0101:
0102:
0103:class RpmIndexer(Indexer):
0104: def write_index(self):
*** 0105: self.do_write_index(self.deploy_dir)
0106:
0107: def do_write_index(self, deploy_dir):
0108: if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
0109: signer = get_signer(self.d, self.d.getVar('PACKAGE_FEED_GPG_BACKEND'))
File: '/home/i-tage/store/imx-yocto-4.14.98-tbox/sources/poky/meta/lib/oe/package_manager.py', lineno: 114, function: do_write_index
0110: else:
0111: signer = None
0112:
0113: createrepo_c = bb.utils.which(os.environ['PATH'], "createrepo_c")
*** 0114: result = create_index("%s --update -q %s" % (createrepo_c, deploy_dir))
0115: if result:
0116: bb.fatal(result)
0117:
0118: # Sign repomd
File: '/home/i-tage/store/imx-yocto-4.14.98-tbox/sources/poky/meta/lib/oe/package_manager.py', lineno: 22, function: create_index
0018:def create_index(arg):
0019: index_cmd = arg
0020:
0021: bb.note("Executing '%s' ..." % index_cmd)
*** 0022: result = subprocess.check_output(index_cmd, stderr=subprocess.STDOUT, shell=True).decode("utf-8")
0023: if result:
0024: bb.note(result)
0025:
0026:def opkg_query(cmd_output):
File: '/usr/lib/python3.6/subprocess.py', lineno: 356, function: check_output
0352: # empty string. That is maintained here for backwards compatibility.
0353: kwargs['input'] = '' if kwargs.get('universal_newlines', False) else b''
0354:
0355: return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
*** 0356: **kwargs).stdout
0357:
0358:
0359:class CompletedProcess(object):
0360: """A process that has finished running.
File: '/usr/lib/python3.6/subprocess.py', lineno: 438, function: run
0434: raise
0435: retcode = process.poll()
0436: if check and retcode:
0437: raise CalledProcessError(retcode, process.args,
*** 0438: output=stdout, stderr=stderr)
0439: return CompletedProcess(process.args, retcode, stdout, stderr)
0440:
0441:
0442:def list2cmdline(seq):
Exception: subprocess.CalledProcessError: Command '/home/i-tage/store/imx-yocto-4.14.98-tbox/build/tmp/work/imx8qmmek-poky-linux/fsl-image-validation-imx/1.0-r0/recipe-sysroot-native/usr/bin/createrepo_c --update -q /home/i-tage/store/imx-yocto-4.14.98-tbox/build/tmp/work/imx8qmmek-poky-linux/fsl-image-validation-imx/1.0-r0/oe-rootfs-repo' returned non-zero exit status 1.
Subprocess output:
Temporary repodata directory /home/i-tage/store/imx-yocto-4.14.98-tbox/build/tmp/work/imx8qmmek-poky-linux/fsl-image-validation-imx/1.0-r0/oe-rootfs-repo/.repodata/ already exists! (Another createrepo process is running?)
ERROR: fsl-image-validation-imx-1.0-r0 do_rootfs: Function failed: do_rootfs
ERROR: Logfile of failure stored in: /home/i-tage/store/imx-yocto-4.14.98-tbox/build/tmp/work/imx8qmmek-poky-linux/fsl-image-validation-imx/1.0-r0/temp/log.do_rootfs.17613
ERROR: Task (/home/i-tage/store/imx-yocto-4.14.98-tbox/sources/meta-fsl-bsp-release/imx/meta-sdk/recipes-fsl/images/fsl-image-validation-imx.bb:do_rootfs) failed with exit code '1'
NOTE: Tasks Summary: Attempted 7442 tasks of which 7435 didn't need to be rerun and 1 failed.
Summary: 1 task failed:
/home/i-tage/store/imx-yocto-4.14.98-tbox/sources/meta-fsl-bsp-release/imx/meta-sdk/recipes-fsl/images/fsl-image-validation-imx.bb:do_rootfs
Summary: There were 7 WARNING messages shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
问题出现的原因
主要是在yocto编译过程中使用 CTRL+C 命令停止编译动作,或对project进行改动后编译过程中停止,则会产生此问题。
问题解决方案
1.使用bitbake -c clean rootfs(rootfs 是建立的跟文件系统文件,)命令对编译后的文件系统文件进行清理,但编译报错依旧。
例如:bitbake -c clean tgrootfs
2.删除目录:project/tmp/work/imx8qmmek-poky-linux/fsl-image-validation-imx/1.0-r0 下 oe-rootfs-repo/ 文件夹,重新编译project ,错误消失,编译正常。
例如:rm -rf imx-yocto-4.14.98-tbox/build/tmp/work/imx8qmmek-poky-linux/fsl-image-validation-imx/1.0-r0/oe-rootfs-repo/