diff --git a/packages/base/all/vendor-config-onl/src/python/onl/install/App.py b/packages/base/all/vendor-config-onl/src/python/onl/install/App.py index 3cc220f8..69b83f8f 100644 --- a/packages/base/all/vendor-config-onl/src/python/onl/install/App.py +++ b/packages/base/all/vendor-config-onl/src/python/onl/install/App.py @@ -168,6 +168,12 @@ class App(SubprocessMixin, object): ##self.grubEnv = ConfUtils.GrubEnv(log=self.log.getChild("grub")) with OnieBootContext(log=self.log) as self.octx: + + self.octx.ictx.attach() + self.octx.ictx.unmount() + self.octx.ictx.detach() + # XXX roth -- here, detach the initrd mounts + self.octx.detach() if self.octx.onieDir is not None: diff --git a/packages/base/all/vendor-config-onl/src/python/onl/install/InstallUtils.py b/packages/base/all/vendor-config-onl/src/python/onl/install/InstallUtils.py index 685f703d..c7d3ee14 100644 --- a/packages/base/all/vendor-config-onl/src/python/onl/install/InstallUtils.py +++ b/packages/base/all/vendor-config-onl/src/python/onl/install/InstallUtils.py @@ -834,7 +834,7 @@ class InitrdContext(SubprocessMixin): return self - def shutdown(self): + def unmount(self): p = ProcMountsParser() if self.dir is not None: @@ -852,6 +852,10 @@ class InitrdContext(SubprocessMixin): cmd = ('umount', p,) self.check_call(cmd, vmode=self.V1) + def shutdown(self): + + self.unmount() + if self.initrd and self.dir: self.log.debug("cleaning up chroot in %s", self.dir) self.rmtree(self.dir) diff --git a/packages/base/all/vendor-config-onl/src/python/onl/install/ShellApp.py b/packages/base/all/vendor-config-onl/src/python/onl/install/ShellApp.py index 934d40a3..e3a5e505 100644 --- a/packages/base/all/vendor-config-onl/src/python/onl/install/ShellApp.py +++ b/packages/base/all/vendor-config-onl/src/python/onl/install/ShellApp.py @@ -189,11 +189,20 @@ class OnieBootContext: def shutdown(self): ctx, self.fctx = self.fctx, None - if ctx is not None: ctx.shutdown() + if ctx is not None: + ctx.shutdown() + ctx.attach() + ctx.shutdown() ctx, self.ictx = self.ictx, None - if ctx is not None: ctx.shutdown() + if ctx is not None: + ctx.shutdown() + ctx.attach() + ctx.shutdown() ctx, self.dctx = self.dctx, None - if ctx is not None: ctx.shutdown() + if ctx is not None: + ctx.shutdown() + ctx.attach() + ctx.shutdown() def __exit__(self, eType, eValue, eTrace): self.shutdown() diff --git a/packages/base/all/vendor-config-onl/src/python/onl/install/SystemInstall.py b/packages/base/all/vendor-config-onl/src/python/onl/install/SystemInstall.py index b8c353a7..25d51928 100644 --- a/packages/base/all/vendor-config-onl/src/python/onl/install/SystemInstall.py +++ b/packages/base/all/vendor-config-onl/src/python/onl/install/SystemInstall.py @@ -32,7 +32,8 @@ class UpgradeHelper(Upgrader): def _runInitrdShell(self, p): if self.callback is not None: - self.callback(self, p) + return self.callback(self, p) + return 0 class App(SubprocessMixin):