summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/rootfs.py
diff options
context:
space:
mode:
authorDevendra Tewari <devendra.tewari@gmail.com>2021-04-19 11:23:58 -0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-05-06 11:16:23 +0100
commitb71375304f393db62e0894af66e9a60bb9a5c8cc (patch)
treeac14a351c1c6cd0ba2679c18a4de92c71dee0e7f /meta/lib/oe/rootfs.py
parent974441aeda1a2e601865743e945e0332c115ef76 (diff)
downloadpoky-b71375304f393db62e0894af66e9a60bb9a5c8cc.tar.gz
classes/lib/scripts: Use bb.utils.rename() instead of os.rename()
Incremental build in Docker fails with: OSError: [Errno 18] Invalid cross-device link when source and destination are on different overlay filesystems. Rather than adding fallback code to every call site, use a new wrapper in bitbake which detects this case and falls back to shutil.move which is slower but will handtle the overlay docker filesystems correctly. [YOCTO #14301] (From OE-Core rev: 656a65b2b84e7d529b89cf5de7eb838f902d84a2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/rootfs.py')
-rw-r--r--meta/lib/oe/rootfs.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index d634adda4e..4b48cdbb65 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -114,7 +114,7 @@ class Rootfs(object, metaclass=ABCMeta):
114 shutil.rmtree(self.image_rootfs + '-orig') 114 shutil.rmtree(self.image_rootfs + '-orig')
115 except: 115 except:
116 pass 116 pass
117 os.rename(self.image_rootfs, self.image_rootfs + '-orig') 117 bb.utils.rename(self.image_rootfs, self.image_rootfs + '-orig')
118 118
119 bb.note(" Creating debug rootfs...") 119 bb.note(" Creating debug rootfs...")
120 bb.utils.mkdirhier(self.image_rootfs) 120 bb.utils.mkdirhier(self.image_rootfs)
@@ -165,10 +165,10 @@ class Rootfs(object, metaclass=ABCMeta):
165 shutil.rmtree(self.image_rootfs + '-dbg') 165 shutil.rmtree(self.image_rootfs + '-dbg')
166 except: 166 except:
167 pass 167 pass
168 os.rename(self.image_rootfs, self.image_rootfs + '-dbg') 168 bb.utils.rename(self.image_rootfs, self.image_rootfs + '-dbg')
169 169
170 bb.note(" Restoreing original rootfs...") 170 bb.note(" Restoreing original rootfs...")
171 os.rename(self.image_rootfs + '-orig', self.image_rootfs) 171 bb.utils.rename(self.image_rootfs + '-orig', self.image_rootfs)
172 172
173 def _exec_shell_cmd(self, cmd): 173 def _exec_shell_cmd(self, cmd):
174 fakerootcmd = self.d.getVar('FAKEROOT') 174 fakerootcmd = self.d.getVar('FAKEROOT')