summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe
diff options
context:
space:
mode:
authorAlexander Kanavin <alexander.kanavin@linux.intel.com>2018-01-29 14:01:29 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-01-30 11:50:12 +0000
commit4c808e31ea3506e2f603e0afd068dd98af032f02 (patch)
treeb72698003d394986371c40b51c246502a14c0f07 /meta/lib/oe
parentcb63b4bfa0bc3d1cbfe70bd68514f36a78cf30f5 (diff)
downloadpoky-4c808e31ea3506e2f603e0afd068dd98af032f02.tar.gz
meta/lib/oe/rootfs.py: separate first boot deferral logic into a separate function
(From OE-Core rev: 4612291411ad788df88d5fc6dde98ff53fd91002) Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r--meta/lib/oe/rootfs.py35
1 files changed, 19 insertions, 16 deletions
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 754ef563ab..d3ec8a56c4 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -293,6 +293,24 @@ class Rootfs(object, metaclass=ABCMeta):
293 # Remove the package manager data files 293 # Remove the package manager data files
294 self.pm.remove_packaging_data() 294 self.pm.remove_packaging_data()
295 295
296 def _postpone_to_first_boot(self, postinst_intercept_hook):
297 with open(postinst_intercept_hook) as intercept:
298 registered_pkgs = None
299 for line in intercept.read().split("\n"):
300 m = re.match("^##PKGS:(.*)", line)
301 if m is not None:
302 registered_pkgs = m.group(1).strip()
303 break
304
305 if registered_pkgs is not None:
306 bb.warn("The postinstalls for the following packages "
307 "will be postponed for first boot: %s" %
308 registered_pkgs)
309
310 # call the backend dependent handler
311 self._handle_intercept_failure(registered_pkgs)
312
313
296 def _run_intercepts(self): 314 def _run_intercepts(self):
297 intercepts_dir = os.path.join(self.d.getVar('WORKDIR'), 315 intercepts_dir = os.path.join(self.d.getVar('WORKDIR'),
298 "intercept_scripts") 316 "intercept_scripts")
@@ -314,22 +332,7 @@ class Rootfs(object, metaclass=ABCMeta):
314 except subprocess.CalledProcessError as e: 332 except subprocess.CalledProcessError as e:
315 bb.warn("The postinstall intercept hook '%s' failed, details in log.do_rootfs" % script) 333 bb.warn("The postinstall intercept hook '%s' failed, details in log.do_rootfs" % script)
316 bb.note("Exit code %d. Output:\n%s" % (e.returncode, e.output.decode("utf-8"))) 334 bb.note("Exit code %d. Output:\n%s" % (e.returncode, e.output.decode("utf-8")))
317 335 self._postpone_to_first_boot(script_full)
318 with open(script_full) as intercept:
319 registered_pkgs = None
320 for line in intercept.read().split("\n"):
321 m = re.match("^##PKGS:(.*)", line)
322 if m is not None:
323 registered_pkgs = m.group(1).strip()
324 break
325
326 if registered_pkgs is not None:
327 bb.warn("The postinstalls for the following packages "
328 "will be postponed for first boot: %s" %
329 registered_pkgs)
330
331 # call the backend dependent handler
332 self._handle_intercept_failure(registered_pkgs)
333 336
334 def _run_ldconfig(self): 337 def _run_ldconfig(self):
335 if self.d.getVar('LDCONFIGDEPEND'): 338 if self.d.getVar('LDCONFIGDEPEND'):