summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/rootfs.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oe/rootfs.py')
-rw-r--r--meta/lib/oe/rootfs.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 91312f8353..2824d4f037 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -104,7 +104,7 @@ class Rootfs(object, metaclass=ABCMeta):
104 def _cleanup(self): 104 def _cleanup(self):
105 pass 105 pass
106 106
107 def _setup_dbg_rootfs(self, dirs): 107 def _setup_dbg_rootfs(self, package_paths):
108 gen_debugfs = self.d.getVar('IMAGE_GEN_DEBUGFS') or '0' 108 gen_debugfs = self.d.getVar('IMAGE_GEN_DEBUGFS') or '0'
109 if gen_debugfs != '1': 109 if gen_debugfs != '1':
110 return 110 return
@@ -120,11 +120,12 @@ class Rootfs(object, metaclass=ABCMeta):
120 bb.utils.mkdirhier(self.image_rootfs) 120 bb.utils.mkdirhier(self.image_rootfs)
121 121
122 bb.note(" Copying back package database...") 122 bb.note(" Copying back package database...")
123 for dir in dirs: 123 for path in package_paths:
124 if not os.path.isdir(self.image_rootfs + '-orig' + dir): 124 bb.utils.mkdirhier(self.image_rootfs + os.path.dirname(path))
125 continue 125 if os.path.isdir(self.image_rootfs + '-orig' + path):
126 bb.utils.mkdirhier(self.image_rootfs + os.path.dirname(dir)) 126 shutil.copytree(self.image_rootfs + '-orig' + path, self.image_rootfs + path, symlinks=True)
127 shutil.copytree(self.image_rootfs + '-orig' + dir, self.image_rootfs + dir, symlinks=True) 127 elif os.path.isfile(self.image_rootfs + '-orig' + path):
128 shutil.copyfile(self.image_rootfs + '-orig' + path, self.image_rootfs + path)
128 129
129 # Copy files located in /usr/lib/debug or /usr/src/debug 130 # Copy files located in /usr/lib/debug or /usr/src/debug
130 for dir in ["/usr/lib/debug", "/usr/src/debug"]: 131 for dir in ["/usr/lib/debug", "/usr/src/debug"]:
@@ -160,6 +161,13 @@ class Rootfs(object, metaclass=ABCMeta):
160 bb.note(" Install extra debug packages...") 161 bb.note(" Install extra debug packages...")
161 self.pm.install(extra_debug_pkgs.split(), True) 162 self.pm.install(extra_debug_pkgs.split(), True)
162 163
164 bb.note(" Removing package database...")
165 for path in package_paths:
166 if os.path.isdir(self.image_rootfs + path):
167 shutil.rmtree(self.image_rootfs + path)
168 elif os.path.isfile(self.image_rootfs + path):
169 os.remove(self.image_rootfs + path)
170
163 bb.note(" Rename debug rootfs...") 171 bb.note(" Rename debug rootfs...")
164 try: 172 try:
165 shutil.rmtree(self.image_rootfs + '-dbg') 173 shutil.rmtree(self.image_rootfs + '-dbg')