@@ -145,6 +145,16 @@ class Rootfs(object, metaclass=ABCMeta):
shutil.copy(os.path.join(root, f),
self.image_rootfs + relative_dir)
+ # The debug rootfs is installed with the image's intercept scripts, and
+ # postinsts register their packages in them (delay_to_first_boot, for
+ # example). The intercepts are only run for the image, so a package
+ # installed only in the debug rootfs would have its postinst saved
+ # against an image that doesn't contain it. Put the image's intercepts
+ # back once the debug packages are installed.
+ intercepts_dir = self.pm.intercepts_dir
+ bb.utils.remove(intercepts_dir + '-orig', True)
+ shutil.copytree(intercepts_dir, intercepts_dir + '-orig', symlinks=True)
+
bb.note(" Install complementary '*-dbg' packages...")
self.pm.install_complementary('*-dbg')
@@ -162,6 +172,9 @@ class Rootfs(object, metaclass=ABCMeta):
bb.note(" Install extra debug packages...")
self.pm.install(extra_debug_pkgs.split(), True)
+ bb.utils.remove(intercepts_dir, True)
+ bb.utils.rename(intercepts_dir + '-orig', intercepts_dir)
+
bb.note(" Removing package database...")
for path in package_paths:
if os.path.isdir(self.image_rootfs + path):