Exemplo n.º 1
0
    def start(self):
        """ Start the frontend """

        # Get a progressbar
        progress = self.progressbar(_("Configuring the final system:"), 2)

        # Start progressbar
        progress.start()

        # Copy kernel
        # verbose("Copying kernel...")
        # self.moduleclass.copy_kernel()
        # progress.update(1)

        try:
            # Set kernel and initramfs
            verbose("Configuring kernel...")
            self.moduleclass.install.set_kernel()
            progress.update(1)

            # Recompile python modules
            verbose("Recompiling python modules...")
            self.moduleclass.install.configure_python()
            progress.update(2)
        finally:
            # Exit
            self.moduleclass.install.close()

        progress.finish()
Exemplo n.º 2
0
	def ready(self):
		""" Start the frontend """

		verbose("Configuring features")
		self.set_header("hold", _("Configuring features..."), _("This may take a while."))
		
		self.progress_set_quota(100)
Exemplo n.º 3
0
	def ready(self):
				
		self.has_the_update_process_ran = False
		
		verbose("packages are: %s" % self.settings["packages"])
		
		self.set_header("info", _("Installer updates"), _("Ensure you have the installer up-to-date."), appicon="system-software-update")

		# Get the checkbox
		self.check = self.objects["builder"].get_object("check")

		if not self.is_module_virgin:
			self.set_header("ok", _("You can continue!"), _("Press forward to continue."))
			return
		
		# Should we disable the checkbox?
		if self.settings["disable"]:
			self.check.set_sensitive(False)
			self.check.set_active(False)

		# Get text label
		text = self.objects["builder"].get_object("text")

		# Format label:
		label = (
			_("%(distroname)s's installer improves every day.") % {"distroname":self.moduleclass.main_settings["distro"]},
			_("It is good measure to have the latest version before installing the distribution."),
			"",
			_("You can choose to check for installer updates before continuing the installation."),
			"",
		)

		# Properly set it
		text.set_markup("\n".join(label))
Exemplo n.º 4
0
	def ready(self):
		""" Start the frontend """

		verbose("Setting language and keyboard")
		self.set_header("hold", _("Setting language and keyboard..."), _("This may take a while."))
		
		self.progress_set_quota(4)
Exemplo n.º 5
0
	def on_module_change(self):
		""" Proper set settings["size"] and settings["enable_sources"] when a button has been clicked. """
		
		self.settings["size"] = int(self.size_adjust.get_value())
		verbose("Selected size %s" % self.settings["size"])
		
		return None
Exemplo n.º 6
0
	def run(self):
		
		# Make the buttons insensitive
		self.parent.idle_add(self.parent.objects["parent"].next_button.set_sensitive, False)
		self.parent.idle_add(self.parent.objects["parent"].back_button.set_sensitive, False)
		self.parent.idle_add(self.parent.objects["parent"].cancel_button.set_sensitive, False)
		self.parent.idle_add(self.parent.check.set_sensitive, False)
		
		self.parent.set_header("hold", _("Updating APT cache..."), _("This may take a while."))
		self.parent.moduleclass.install.update()
			
		verbose("Opening the refreshed APT cache...")
		self.parent.moduleclass.install.open()
			
		verbose("Checking if the packages have been updated...")
		res = self.parent.moduleclass.install.check()
		if not res:
			self.parent.set_header("ok", _("No updates found."), _("It seems you are already up-to-date. Yay!"))
			self.quit()
			return
		else:
			self.parent.set_header("hold", _("Upgrading packages..."), _("This may take a while."))

			try:
				self.parent.moduleclass.install.upgrade()
			except:
				self.parent.set_header("error", _("Something went wrong while updating packages."), _("A reboot is needed in order to start a safe linstaller version."))
				self.quit("reboot")
				return
			
			# Everything should be cool now.
			self.parent.set_header("ok", _("Installer updated"), _("Press forward to start the updated installer."))
			
			self.quit("fullrestart")
Exemplo n.º 7
0
	def ready(self):
		""" Start the frontend """

		verbose("Removing live-specific packages...")
		self.set_header("hold", _("Removing live-specific packages..."), _("This may take a while."))
		
		self.progress_set_quota(1)
Exemplo n.º 8
0
	def start(self):
		""" Start the frontend """
		
		# Get a progressbar
		progress = self.progressbar(_("Copying system to disk:"), 2)

		# Start progressbar
		progress.start()

		# Copy squashfs image...
		verbose("Copying squashfs image...")
		self.moduleclass.copy()

		# Update
		progress.update(1)
		
		# Copy syslinux directory...
		verbose("Copying syslinux directory...")
		self.moduleclass.copy_syslinux()

		# Update
		progress.update(2)

		# Close progressbar
		progress.finish()
Exemplo n.º 9
0
	def ready(self):
		""" Start the frontend """

		verbose("Setting timezone")
		self.set_header("hold", _("Setting timezone..."), _("This may take a while."))
		
		self.progress_set_quota(1)
Exemplo n.º 10
0
	def start(self):
		""" Start the frontend """

		# Get a progressbar
		progress = self.progressbar(_("Creating user:"******"Creating user")
			# USER: set.
			self.moduleclass.install.user_set()
			progress.update(1)
			
			# USER: commit.
			self.moduleclass.install.user_commit()
			progress.update(2)
			
			verbose("Setting username")
			# HOSTNAME: commit
			self.moduleclass.install.host_commit()
			progress.update(3)
		finally:
			# Exit
			self.moduleclass.install.close()
		
		progress.finish()
Exemplo n.º 11
0
	def on_module_change(self):
		""" Preseed changes """
		
		# Preseed changes
		self.settings["timezone"] = self.get_selected_timezone()
		
		verbose("Selected timezone %s" % self.settings["timezone"])
Exemplo n.º 12
0
	def start(self):
		""" Start the frontend """
		
		self.header(_("Timezone selection"))
		
		if not self.settings["ask"]:
			# Use current timezone
			self.settings["timezone"] = self.moduleclass.tz.default
		
		# Get the current timezone...
		if not self.settings["timezone"]:
			timezone = self.moduleclass.tz.default
			print _("Default timezone is:")
			print
			print ("  %s" % timezone)
			print
			res = self.question(_("Do you want to change it?"), default=True)
			if res:
				# We should change it...
				timezone = self.timezone_loop()
				if timezone == "_exit": timezone = None
		
			# Write to self.settings
			self.settings["timezone"] = timezone
		
		verbose("Selected timezone %s" % self.settings["timezone"])
Exemplo n.º 13
0
	def update_initramfs(self):
		"""
		Updates the initramfs.
		"""
		
		m.verbose("Updating the initramfs...")
		m.sexec("update-initramfs -u -k all")
Exemplo n.º 14
0
	def load(self, main_settings, service_space, cfg):
		verbose("\nStarting service %s..." % self.servicename)
		
		service = "linstaller.services.%s" % self.servicename
		self.service = importlib.import_module(service)
		
		self.mloaded = self.service.Service(main_settings, service_space, cfg)
		return self.mloaded
Exemplo n.º 15
0
def enable_all_vgs():
	""" Enables every VG on the system. """
	
	for vg in VolumeGroups:
		try:
			VolumeGroups[vg].enable()
		except m.CmdError:
			m.verbose("Unable to enable %s. Ensure it's not contained in a locked device." % vg)
Exemplo n.º 16
0
	def update(self):
		""" Updates the APT cache. """
		
		self.cac = cache.Cache()
		try:
			self.cac.update()
		except:
			verbose("Something went wrong during the cache update.")
Exemplo n.º 17
0
	def ready(self):
		""" Start the frontend """

		verbose("Calculating the number of the files to copy...")
		filenum = self.moduleclass.unsquash.get_files()
		
		# Set quota
		self.progress_set_quota(filenum)
Exemplo n.º 18
0
	def load(self, main_settings, modules_settings, service_started, cfg):
		verbose("\nLoading module %s..." % self.modulename)
		
		module = "linstaller.modules.%s" % self.modulename
		self.module = importlib.import_module(module)
		
		self.mloaded = self.module.Module(main_settings, modules_settings, service_started, cfg, module)
		return self.mloaded
Exemplo n.º 19
0
	def create_ssl_certs(self):
		"""
		Creates the missing SSL certs.
		"""
		
		if os.path.exists("/var/lib/dpkg/info/ssl-cert.list"):
			# FIXME: saner check?
			m.verbose("Creating SSL certs...")
			m.sexec("make-ssl-cert generate-default-snakeoil --force-overwrite")
Exemplo n.º 20
0
	def start(self):
		""" Start module """
				
		if self.settings["uefi"] == None:
			if os.path.exists("/sys/firmware/efi"):
				m.verbose("UEFI Detected.")
				self.settings["uefi"] = True
			else:
				self.settings["uefi"] = False
Exemplo n.º 21
0
	def ready(self):
		""" Ready! (to wait...) """

		verbose("Testing install...")
		
		self.target = 50
		
		# Get a progressbar
		self.progress_set_quota(self.target)
Exemplo n.º 22
0
	def free_previous_modules(self, limit):
		""" Removes GUI objects of modules ranging from 0 to limit.
		
		limit should be the name of the module which should be leaved as-is."""
		
		for module in self.main_settings["modules"]:
			if module == limit: break
			
			verbose("Freeing up stuff of %s..." % module)
			del self.modules_objects[module]
Exemplo n.º 23
0
		def update(self, num):
			""" Updates the progressbar. """
			
			try:
				self.progressbar.update(num)
			except:
				verbose("Progressbar crashed")
				# Generate a new progressbar, and update to the given value
				self.create_progressbar()
				self.update(num)
Exemplo n.º 24
0
    def start(self):
        """ Start module """

        # Due to a limitation/simplification of linstaller's chroot capabilites, we can't copy the kernel after declaring the Install class.
        # Copy that now.
        verbose("Copying kernel...")
        self.copy_kernel()

        self.install = Install(self)

        module.Module.start(self)
Exemplo n.º 25
0
	def start(self):
		""" Start module """
		
		self.install = Install(self)

		m.verbose("Removing linstaller-related configuration files...")
		try:
			self.install.removeconfiguration()
		finally:
			# Exit
			self.install.close()
Exemplo n.º 26
0
	def ready(self):
		""" Ready! (to wait...) """

		self.set_header("hold", "A test!", "How great.")

		verbose("Testing install...")
		
		self.target = 50
		
		# Get a progressbar
		self.progress_set_quota(self.target)
Exemplo n.º 27
0
	def on_module_change(self):
		""" Seeds items when we change module. """
						
		# Preseed changes
		self.settings["language"] = self.get_selected_locale()
		self.settings["layout"] = self.get_selected_layouts()
		self.settings["model"] = self.get_selected_model()
		self.settings["variant"] = self.get_selected_variant()
			
		verbose("Selected language: %s" % self.settings["language"])
		verbose("Selected keyboard: %s (model %s, variant %s)" % (self.settings["layout"], self.settings["model"], self.settings["variant"]))
Exemplo n.º 28
0
	def load(self, main_settings, modules_settings, service_started, cfg):
		verbose("\nLoading module %s..." % self.modulename)
		# This http://stackoverflow.com/questions/951124/dynamic-loading-of-python-modules/951846#951846 is very helpful! Thanks!
		module = "linstaller.modules.%s" % self.modulename
		self.module = __import__(module)
		components = module.split(".")
		for comp in components[1:]:
			self.module = getattr(self.module, comp)
		
		self.mloaded = self.module.Module(main_settings, modules_settings, service_started, cfg, module)
		return self.mloaded
Exemplo n.º 29
0
	def gtk_start(self):
		""" Start the frontend """
		
		verbose("packages are: %s" % self.settings["packages"])
		
		self.window.set_header("info", _("Installer updates"), _("Update the installer"))
		
		self.window.text_new(_("%(distroname)s's installer improves every day.") % {"distroname":self.moduleclass.main_settings["distro"]})
		self.window.text_new(_("It is good measure to have the latest version before installing the distribution.") + "\n")
		
		self.cbox = self.window.checkbox(_("The installer should check for updates."), default=True)
Exemplo n.º 30
0
	def start(self):
		""" Start module """
		
		self.install = Install(self)
		
		m.verbose("Finishing up...")
		
		try:
			# Update initramfs
			self.install.update_initramfs()
		finally:
			# Exit
			self.install.close()