Example #1
0
 def run(self):
     logger.logI(self.tn, _("Generating the tree for the temporary filesystem"))
     fsutil.maketree([tmpsys + "etc", tmpsys + "dev",
                       tmpsys + "proc", tmpsys + "tmp",
                       tmpsys + "sys", tmpsys + "mnt",
                       tmpsys + "media/cdrom", tmpsys + "var", tmpsys + "home"], self.tn)
     fsutil.chmod(tmpsys + "tmp", "1777", self.tn)
Example #2
0
 def runthread(self):
     # If the user-setup-apply file does not exist, and there is an alternative, we'll copy it over
     logger.logI(self.tn, logger.I, _("Setting up the installer"))
     if (os.path.isfile(
             "/usr/lib/ubiquity/user-setup/user-setup-apply.orig")
             and not os.path.isfile(
                 "/usr/lib/ubiquity/user-setup/user-setup-apply")):
         shutil.copy2("/usr/lib/ubiquity/user-setup/user-setup-apply.orig",
                      "/usr/lib/ubiquity/user-setup/user-setup-apply")
     # If the user requested to make sure that the installer does _not_ change the apt sources,
     #  make sure that relinux obeys this.
     # However, if the user changed his/her mind, we want to make sure that relinux
     #  work with that too
     if not configutils.getValue(configs[configutils.aptlistchange]):
         if not os.path.exists(
                 "/usr/share/ubiquity/apt-setup.relinux-backup"):
             os.rename("/usr/share/ubiquity/apt-setup",
                       "/usr/share/ubiquity/apt-setup.relinux-backup")
         aptsetup = open("/usr/share/ubiquity/apt-setup", "w")
         aptsetup.write("\n")
         aptsetup.close()
         fsutil.chmod("/usr/share/ubiquity/apt-setup", 0o755, self.tn)
     elif os.path.exists("/usr/share/ubiquity/apt-setup.relinux-backup"):
         # TODO: Fix the 40cdrom bug?
         fsutil.rm("/usr/share/ubiquity/apt-setup", False, self.tn)
         os.rename("/usr/share/ubiquity/apt-setup.relinux-backup",
                   "/usr/share/ubiquity/apt-setup")
Example #3
0
 def runthread(self):
     logger.logI(self.tn, logger.I,
                 _("Generating the tree for the temporary filesystem"))
     fsutil.maketree([
         tmpsys + "etc", tmpsys + "dev", tmpsys + "proc",
         [tmpsys + "tmp", 0o1777], tmpsys + "sys", tmpsys + "mnt", tmpsys +
         "media/cdrom", tmpsys + "var", tmpsys + "home", tmpsys + "run"
     ], self.tn)
     fsutil.chmod(tmpsys + "tmp", 0o1777, self.tn)
Example #4
0
 def runthread(self):
     # Edit the casper.conf
     # Strangely enough, casper uses the "quiet" flag if the build system is either Debian or Ubuntu
     if config.VStatus is False:
         logger.logI(self.tn, logger.I,
                     _("Editing casper and LSB configuration files"))
     logger.logV(self.tn, logger.I, _("Editing casper.conf"))
     buildsys = "Ubuntu"
     if configutils.parseBoolean(
             configutils.getValue(
                 configs[configutils.casperquiet])) is False:
         buildsys = ""
     unionfs = configutils.getValue(configs[configutils.unionfs])
     if unionfs == "overlayfs" and aptutil.compVersions(
             aptutil.getPkgVersion(aptutil.getPkg("casper", aptcache)),
             "1.272", aptutil.lt):
         logger.logI(self.tn, logger.W,
                     _("Using DEFAULT instead of overlayfs"))
         unionfs = "DEFAULT"
     self.varEditor(
         tmpsys + "etc/casper.conf", {
             "USERNAME":
             configutils.getValue(configs[configutils.username]),
             "USERFULLNAME":
             configutils.getValue(configs[configutils.userfullname]),
             "HOST":
             configutils.getValue(configs[configutils.host]),
             "BUILD_SYSTEM":
             buildsys,
             "FLAVOUR":
             configutils.getValue(configs[configutils.flavour]),
             "UNIONFS":
             unionfs
         })
     logger.logI(self.tn, logger.I,
                 _("Applying permissions to casper scripts"))
     # Make sure the casper scripts work
     cbs = "/usr/share/initramfs-tools/scripts/casper-bottom/"
     for i in fsutil.listdir(cbs):
         fsutil.chmod(i, 0o755, self.tn)
     logger.logV(self.tn, logger.I, _("Editing lsb-release"))
     self.varEditor(
         tmpsys + "etc/lsb-release", {
             "DISTRIB_ID":
             configutils.getValue(configs[configutils.sysname]),
             "DISTRIB_RELEASE":
             configutils.getValue(configs[configutils.sysversion]),
             "DISTRIB_CODENAME":
             configutils.getValue(configs[configutils.codename]),
             "DISTRIB_DESCRIPTION":
             configutils.getValue(configs[configutils.description])
         })
Example #5
0
 def runthread(self):
     logger.logI(self.tn, logger.I,
                 _("Generating the tree for the temporary filesystem"))
     # Clean the TMPSYS tree, if it exists
     fsutil.rm(tmpsys)
     self.progressfunc(20)
     # Generate the tree
     fsutil.maketree([
         tmpsys + "etc", tmpsys + "dev", tmpsys + "proc",
         [tmpsys + "tmp", 0o1777], tmpsys + "sys", tmpsys + "mnt", tmpsys +
         "media/cdrom", tmpsys + "var", tmpsys + "home", tmpsys + "run"
     ], self.tn, lambda p: self.progressfunc(20 + p / (5 / 3)))
     fsutil.chmod(tmpsys + "tmp", 0o1777, self.tn)
Example #6
0
 def runthread(self):
     logger.logI(self.tn, logger.I, _(
         "Generating the tree for the temporary filesystem"))
     # Clean the TMPSYS tree, if it exists
     fsutil.rm(tmpsys)
     self.progressfunc(20)
     # Generate the tree
     fsutil.maketree([tmpsys + "etc", tmpsys + "dev",
                      tmpsys + "proc", [tmpsys + "tmp", 0o1777],
                      tmpsys + "sys", tmpsys + "mnt",
                      tmpsys +
                      "media/cdrom", tmpsys + "var", tmpsys + "home",
                      tmpsys + "run"], self.tn, lambda p: self.progressfunc(20 + p / (5 / 3)))
     fsutil.chmod(tmpsys + "tmp", 0o1777, self.tn)
Example #7
0
 def runthread(self):
     logger.logI(self.tn, logger.I, _("Generating the tree for the temporary filesystem"))
     fsutil.maketree(
         [
             tmpsys + "etc",
             tmpsys + "dev",
             tmpsys + "proc",
             [tmpsys + "tmp", 0o1777],
             tmpsys + "sys",
             tmpsys + "mnt",
             tmpsys + "media/cdrom",
             tmpsys + "var",
             tmpsys + "home",
             tmpsys + "run",
         ],
         self.tn,
     )
     fsutil.chmod(tmpsys + "tmp", 0o1777, self.tn)
Example #8
0
 def runthread(self):
     # Edit the casper.conf
     # Strangely enough, casper uses the "quiet" flag if the build system is either Debian or Ubuntu
     if config.VStatus is False:
         logger.logI(self.tn, logger.I, _("Editing casper and LSB configuration files"))
     logger.logV(self.tn, logger.I, _("Editing casper.conf"))
     buildsys = "Ubuntu"
     if configutils.parseBoolean(configutils.getValue(configs[configutils.casperquiet])) is False:
         buildsys = ""
     unionfs = configutils.getValue(configs[configutils.unionfs])
     if unionfs == "overlayfs" and aptutil.compVersions(
         aptutil.getPkgVersion(aptutil.getPkg("casper", aptcache)), "1.272", aptutil.lt
     ):
         logger.logI(self.tn, logger.W, _("Using DEFAULT instead of overlayfs"))
         unionfs = "DEFAULT"
     self.varEditor(
         tmpsys + "etc/casper.conf",
         {
             "USERNAME": configutils.getValue(configs[configutils.username]),
             "USERFULLNAME": configutils.getValue(configs[configutils.userfullname]),
             "HOST": configutils.getValue(configs[configutils.host]),
             "BUILD_SYSTEM": buildsys,
             "FLAVOUR": configutils.getValue(configs[configutils.flavour]),
             "UNIONFS": unionfs,
         },
     )
     logger.logI(self.tn, logger.I, _("Applying permissions to casper scripts"))
     # Make sure the casper scripts work
     cbs = "/usr/share/initramfs-tools/scripts/casper-bottom/"
     for i in fsutil.listdir(cbs):
         fsutil.chmod(i, 0o755, self.tn)
     logger.logV(self.tn, logger.I, _("Editing lsb-release"))
     self.varEditor(
         tmpsys + "etc/lsb-release",
         {
             "DISTRIB_ID": configutils.getValue(configs[configutils.sysname]),
             "DISTRIB_RELEASE": configutils.getValue(configs[configutils.sysversion]),
             "DISTRIB_CODENAME": configutils.getValue(configs[configutils.codename]),
             "DISTRIB_DESCRIPTION": configutils.getValue(configs[configutils.description]),
         },
     )
Example #9
0
 def runthread(self):
     # If the user-setup-apply file does not exist, and there is an alternative, we'll copy it over
     logger.logI(self.tn, logger.I, _("Setting up the installer"))
     if (os.path.isfile("/usr/lib/ubiquity/user-setup/user-setup-apply.orig") and not
             os.path.isfile("/usr/lib/ubiquity/user-setup/user-setup-apply")):
         shutil.copy2("/usr/lib/ubiquity/user-setup/user-setup-apply.orig",
                      "/usr/lib/ubiquity/user-setup/user-setup-apply")
     # If the user requested to make sure that the installer does _not_ change the apt sources,
     #  make sure that relinux obeys this.
     # However, if the user changed his/her mind, we want to make sure that relinux
     #  work with that too
     if not configutils.getValue(configs[configutils.aptlistchange]):
         if not os.path.exists("/usr/share/ubiquity/apt-setup.relinux-backup"):
             os.rename("/usr/share/ubiquity/apt-setup",
                       "/usr/share/ubiquity/apt-setup.relinux-backup")
         aptsetup = open("/usr/share/ubiquity/apt-setup", "w")
         aptsetup.write("\n")
         aptsetup.close()
         fsutil.chmod("/usr/share/ubiquity/apt-setup", 0o755, self.tn)
     elif os.path.exists("/usr/share/ubiquity/apt-setup.relinux-backup"):
         # TODO: Fix the 40cdrom bug?
         fsutil.rm("/usr/share/ubiquity/apt-setup", False, self.tn)
         os.rename("/usr/share/ubiquity/apt-setup.relinux-backup",
                       "/usr/share/ubiquity/apt-setup")