def finalize_chroot(self): pisi.db.invalidate_caches() # stop dbus shell_tools.chroot_run(self.path, "/bin/service dbus stop") # kill comar in chroot if any exists shell_tools.chroot_run(self.path, "/bin/killall comar") # unmount sys dirs temp = SYS_DIRS temp.reverse() for _dir in temp: tgt = os.path.join(self.path, _dir) shell_tools.umount(tgt) # swap off if it is opened shell_tools.run_quiet("swapoff -a")
def __init__(self, path): self.path = path for _dir in SYS_DIRS: tgt = os.path.join(path, _dir) _dir = os.path.join("/", _dir) shell_tools.mount(_dir, tgt, param="--bind") shell_tools.chroot_run(path, "/sbin/ldconfig") shell_tools.chroot_run(path, "/sbin/update-environment") shell_tools.chroot_run(path, "/bin/service dbus start") self.socket_file = os.path.join(path, "var/run/dbus/system_bus_socket") dbus.bus.BusConnection(address_or_type="unix:path=%s" % self.socket_file) self.link = comar.Link(socket=self.socket_file) self.baselayout = self.link.User.Manager["baselayout"] options = pisi.config.Options() options.yes_all = True options.ignore_dependency = True options.ignore_safety = True options.destdir = path # dbus.SystemBus() pisi.api.set_dbus_sockname(self.socket_file) pisi.api.set_dbus_timeout(1200) pisi.api.set_options(options) pisi.api.set_comar(True) pisi.api.set_signal_handling(False)