mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-12-26 01:37:04 +00:00
Merge branch 'master' of github.com:carlroth/OpenNetworkLinux
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user