Example #1
0
    def generateAnswerfile(self, webdir):
        """Generate an answerfile and put it in the provided webdir, returning any command line arguments needed to boot the OS"""
        preseedfile = "preseed-%s.cfg" % (self.parent._osParent_name)
        filename = "%s/%s" % (xenrt.TEC().getLogdir(), preseedfile)

        # TODO: Use new signalling method so this works for hosts as well
        ps=DebianPreseedFile(self.distro,
                             self.installURL,
                             filename,
                             arch=self.arch)
        ps.generate()
        webdir.copyIn(filename)
        url = webdir.getURL(os.path.basename(filename))

        # TODO: handle native where console is different, and handle other interfaces
        return ["vga=normal", "auto=true priority=critical", "console=hvc0", "interface=eth0", "url=%s" % url]
Example #2
0
 def generateIsoAnswerfile(self):
     preseedfile = "preseed-%s.cfg" % (self.parent._osParent_name)
     filename = "%s/%s" % (xenrt.TEC().getLogdir(), preseedfile)
     ps = DebianPreseedFile(self.distro,
                            xenrt.getLinuxRepo(self.distro, self.arch, "HTTP"),
                            filename,
                            arch=self.arch)
     ps.generate()
     installIP = self.getIP(trafficType="OUTBOUND", timeout=600)
     path = "%s/%s" % (xenrt.TEC().lookup("GUESTFILE_BASE_PATH"), installIP)
     self.cleanupdir = path
     try:
         os.makedirs(path)
     except:
         pass
     xenrt.rootops.sudo("chmod -R a+w %s" % path)
     xenrt.command("rm -f %s/preseed.stamp" % path)
     shutil.copyfile(filename, "%s/preseed" % (path))
Example #3
0
 def generateIsoAnswerfile(self):
     preseedfile = "preseed-%s.cfg" % (self.parent._osParent_name)
     filename = "%s/%s" % (xenrt.TEC().getLogdir(), preseedfile)
     ps = DebianPreseedFile(self.distro,
                            xenrt.getLinuxRepo(self.distro, self.arch,
                                               "HTTP"),
                            filename,
                            arch=self.arch)
     ps.generate()
     installIP = self.getIP(trafficType="OUTBOUND", timeout=600)
     path = "%s/%s" % (xenrt.TEC().lookup("GUESTFILE_BASE_PATH"), installIP)
     self.cleanupdir = path
     try:
         os.makedirs(path)
     except:
         pass
     xenrt.rootops.sudo("chmod -R a+w %s" % path)
     xenrt.command("rm -f %s/preseed.stamp" % path)
     shutil.copyfile(filename, "%s/preseed" % (path))
Example #4
0
    def generateAnswerfile(self, webdir):
        """Generate an answerfile and put it in the provided webdir, returning any command line arguments needed to boot the OS"""
        preseedfile = "preseed-%s.cfg" % (self.parent._osParent_name)
        filename = "%s/%s" % (xenrt.TEC().getLogdir(), preseedfile)

        # TODO: Use new signalling method so this works for hosts as well
        ps = DebianPreseedFile(self.distro,
                               self.installURL,
                               filename,
                               arch=self.arch)
        ps.generate()
        webdir.copyIn(filename)
        url = webdir.getURL(os.path.basename(filename))

        # TODO: handle native where console is different, and handle other interfaces
        return [
            "vga=normal", "auto=true priority=critical", "console=hvc0",
            "interface=eth0",
            "url=%s" % url
        ]