]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
image.bbclass: remove hardlinks as well
authorMartin Jansa <martin.jansa@gmail.com>
Sat, 18 Nov 2023 21:17:21 +0000 (22:17 +0100)
committerMartin Jansa <martin.jansa@gmail.com>
Fri, 12 Jul 2024 07:36:57 +0000 (09:36 +0200)
commiteca518bafa0611e2f0e87b961afbc0c8526a8b2e
treea2502ec553f9a1ae0d7f91c02569813496d8e04a
parentcc7e58ad4e7bd36632b839904e69844b3e1ee6b5
image.bbclass: remove hardlinks as well

* it was removing only destination symlinks, but sometimes hardlink might be regenerated
  as well, e.g. in oeqa test wic.Wic.test_permissions which was failing with:

NOTE: recipe core-image-minimal-1.0-r0: task do_image_wic: Started
ERROR: core-image-minimal-1.0-r0 do_image_wic: Error executing a python function in exec_func_python() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_func_python() autogenerated', lineno: 2, function: <module>
     0001:
 *** 0002:create_hardlinks(d)
     0003:
File: '/OE/build/poky/meta/classes-recipe/image.bbclass', lineno: 606, function: create_hardlinks
     0602:        if os.path.exists(src):
     0603:            bb.note("Creating hardlink: %s -> %s" % (dst, src))
     0604:            if os.path.islink(dst):
     0605:                os.remove(dst)
 *** 0606:            os.link(src, dst)
     0607:        else:
     0608:            bb.note("Skipping hardlink, source does not exist: %s -> %s" % (dst, src))
     0609:}
     0610:
Exception: FileExistsError: [Errno 17] File exists: 'tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0/deploy-core-image-minimal-image-complete/core-image-minimal-qemux86-64.rootfs.wic' -> 'tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0/deploy-core-image-minimal-image-complete/core-image-minimal-qemux86-64.rootfs--1.0-r0-20110405230000.wic'

[YOCTO #12937]

Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
meta/classes-recipe/image.bbclass