summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorAlex Kiernan <alex.kiernan@gmail.com>2023-07-20 11:20:12 +0100
committerSteve Sakoman <steve@sakoman.com>2023-08-26 04:24:02 -1000
commit6f3c2ff35aa765226f0213724dca50817561f9ba (patch)
treed294edd50607882c2269946be7b1a3ff564347a6 /meta
parent777a9ac262099d4bf3f147c01d576ac15368ff1e (diff)
downloadpoky-6f3c2ff35aa765226f0213724dca50817561f9ba.tar.gz
rootfs: Add debugfs package db file copy and cleanup
When copying the package database files for the debugfs, add individual file copy as well as tree copying. After the debug rootfs has been created, cleanup the package files. This then allows us to avoid a problem where (for rpm at least) extraneous files in the debug rootfs would cause failures during oe-selftest because some files existed in both regular and debugfs images. (From OE-Core rev: 96c79c54f282497eb1521b1d5da648ae83fcfe8b) Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit ce49ea435ce55eb5b6da442c12e03a806534c38d) Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta')
-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')