if bootstrap enabled, logfile will append the records
Change-Id: Ic080e5cf9357f41c7dd4d1a2ce8f8c605a3d55e1
Signed-off-by: Gui Chen <gui.chen@intel.com>
if not os.path.exists(os.path.dirname(logfile_abs_path)):
os.makedirs(os.path.dirname(logfile_abs_path))
msger.set_interactive(False)
- msger.set_logfile(logfile_abs_path)
+ if rt_util.inbootstrap():
+ mode = 'a'
+ else:
+ mode = 'w'
+ msger.set_logfile(logfile_abs_path, mode)
configmgr.create['logfile'] = self.options.logfile
if self.options.config:
expath = lambda p: os.path.abspath(os.path.expanduser(p))
+def inbootstrap():
+ if os.path.exists(os.path.join("/", ".chroot.lock")):
+ return True
+ return (os.stat("/").st_ino != 2)
+
def bootstrap_mic(argv=None):