Exemplo n.º 1
0
    def prepare(self):
        if (self.db.get('apt-setup/restricted') == 'false'
                or self.db.get('apt-setup/multiverse') == 'false'):
            self.ui.set_allow_nonfree(False)
        else:
            use_nonfree = self.db.get('ubiquity/use_nonfree') == 'true'
            self.ui.set_use_nonfree(use_nonfree)

        arch, subarch = archdetect()
        if 'efi' in subarch:
            if is_secure_boot():
                self.ui.set_using_secureboot(True)

        self.ui.download_updates = self.db.get(
            'ubiquity/download_updates') == 'true'
        if self.ui.download_updates_enabled:
            self.ui.set_download_updates(self.ui.download_updates)
        minimal_install = self.db.get('ubiquity/minimal_install') == 'true'
        self.ui.set_minimal_install(minimal_install)
        self.apply_debconf_branding()

        # wait for it to finish
        if self.frontend.ubuntu_drivers:
            self.frontend.ubuntu_drivers.communicate()
            self.frontend.ubuntu_drivers = None

        # output whether there are OEM packages for this system
        try:
            with open('/run/ubuntu-drivers-oem.autoinstall', 'r') as f:
                syslog.syslog(
                    F'ubuntu-drivers list-oem finished with: "{" ".join(f.read().splitlines())}"'
                )
        except FileNotFoundError:
            syslog.syslog(
                "ubuntu-drivers list-oem finished with no available packages. Maybe we need to apt update? "
                "Doing that and trying again.")
            # We only do this when we really have to since it could be slow: apt update & re-run of ubuntu-drivers
            self.frontend.save_oem_metapackages_list(wait_finished=True)
            try:
                with open('/run/ubuntu-drivers-oem.autoinstall', 'r') as f:
                    syslog.syslog(
                        F'ubuntu-drivers list-oem finished with: "{" ".join(f.read().splitlines())}"'
                    )
            except FileNotFoundError:
                syslog.syslog("No, we didn't find any OEM packages again.")

        if self.should_show_rst_page():
            if not self.ui.show_rst_page():
                self.setup_sufficient_space()
            else:
                self.ui.plugin_is_restart = True
        else:
            self.setup_sufficient_space()
        command = ['/usr/share/ubiquity/simple-plugins', 'prepare']
        questions = ['ubiquity/use_nonfree']
        return command, questions
Exemplo n.º 2
0
    def prepare(self):
        if (self.db.get('apt-setup/restricted') == 'false' or
                self.db.get('apt-setup/multiverse') == 'false'):
            self.ui.set_allow_nonfree(False)
        else:
            use_nonfree = self.db.get('ubiquity/use_nonfree') == 'true'
            self.ui.set_use_nonfree(use_nonfree)

        arch, subarch = archdetect()
        if 'efi' in subarch:
            if is_secure_boot():
                self.ui.set_using_secureboot(True)

        download_updates = self.db.get('ubiquity/download_updates') == 'true'
        self.ui.set_download_updates(download_updates)
        self.apply_debconf_branding()
        self.setup_sufficient_space()
        command = ['/usr/share/ubiquity/simple-plugins', 'prepare']
        questions = ['ubiquity/use_nonfree']
        return command, questions