Example #1
0
    def execute(self):
        if not kahyaExists():
            ctx.debugger.log("There is no kahya jumps to the next screen.")
            return True

        ctx.autoInstall = True
        yaliKahya = kahya()
        print "...",ctx.options.kahyaFile

        kahyaOpt = get_kernel_opt(ctx.consts.kahyaParam)

        if kahyaOpt:
            ctx.debugger.log("KAHYA-PARAMS:: %s" % kahyaOpt)
            kahyaFile = kahyaOpt.split(',')[1]
        else:
            kahyaFile = ctx.options.kahyaFile

        if kahyaFile:
            ctx.debugger.log("Reading kahya from file %s" % kahyaFile)
            yaliKahya.readData(kahyaFile)
            if yaliKahya.checkFileValidity()==True:
                ctx.debugger.log("File is ok")

                # find usable storage devices
                # initialize all storage devices
                if not yali.storage.init_devices():
                    raise GUIException, _("Can't find a storage device!")

                devices = []
                for dev in yali.storage.devices:
                    if dev.getTotalMB() >= ctx.consts.min_root_size:
                        devices.append(dev)

                correctData = yaliKahya.getValues()
                ctx.debugger.log("Given Kahya Values :")

                # single types
                ctx.installData.keyData = correctData.keyData
                ctx.installData.rootPassword = correctData.rootPassword
                ctx.installData.hostName = correctData.hostname
                ctx.installData.autoLoginUser = correctData.autoLoginUser
                ctx.installData.autoPartDev = devices[int(correctData.partitioning[0].disk[-1])]
                ctx.installData.useYaliFirstBoot = correctData.useYaliFirstBoot

                # if exists use different source repo
                ctx.installData.repoAddr = correctData.repoAddr
                ctx.installData.repoName = correctData.repoName

                ctx.debugger.log("HOSTNAME : %s " % ctx.installData.hostName)
                ctx.debugger.log("KEYDATA  : %s " % ctx.installData.keyData.X)

                if ctx.installData.repoAddr:
                    ctx.debugger.log("REPOADDR : %s " % ctx.installData.repoAddr)
                    ctx.debugger.log("REPONAME : %s " % ctx.installData.repoName)

                # multi types
                for user in correctData.users:
                    ctx.installData.users.append(user)
                    yali.users.pending_users.append(user)
                    ctx.debugger.log("USER    : %s " % user.username)

                if ctx.options.dryRun == True:
                    ctx.debugger.log("dryRun activated Yali stopped")
                else:
                    # Bootloader Screen is 9
                    ctx.screens.goToScreen(9)
            else:
                ctx.debugger.log("This kahya file is not correct !!")
                wrongData = yaliKahya.getValues()
                ctx.debugger.log("".join(wrongData))

        ctx.screens.disablePrev()
        ctx.screens.disableNext()
Example #2
0
    def execute(self):
        if not ctx.flags.kahya:
            ctx.logger.debug("There is no kahya jumps to the next screen.")
            return True

        ctx.autoInstall = True
        yaliKahya = kahya()
        ctx.logger.debug("Kahya File : %s " % ctx.flags.kahyaFile)


        if ctx.flags.kahya:
            ctx.logger.debug("KAHYA-PARAMS:: %s" % kahyaOpt)
            kahyaFile = kahyaOpt.split(',')[1]
            if kahyaFile == "":
                kahyaFile = ctx.consts.default_kahya_file
        elif ctx.options.useKahya:
            kahyaFile = ctx.consts.default_kahya_file
        else:
            kahyaFile = ctx.options.kahyaFile

        if kahyaFile:
            ctx.logger.debug("Reading kahya from file %s" % kahyaFile)
            yaliKahya.readData(kahyaFile)
            if yaliKahya.checkFileValidity()==True:
                ctx.logger.debug("File is ok")

                # find usable storage devices
                # initialize all storage devices
                if not yali.storage.initDevices():
                    raise GUIError, _("No storage device found.")

                devices = []
                for dev in yali.storage.devices:
                    if dev.getTotalMB() >= ctx.consts.min_root_size:
                        devices.append(dev)

                correctData = yaliKahya.getValues()

                # set keymap
                ctx.yali.setKeymap(correctData.keyData)

                # single types
                ctx.installData.isKahyaUsed = True
                ctx.installData.keyData = correctData.keyData
                ctx.installData.rootPassword = correctData.rootPassword
                ctx.installData.hostName = correctData.hostname
                ctx.installData.autoLoginUser = correctData.autoLoginUser
                yali.storage.setOrderedDiskList()
                ctx.installData.autoPartDev = devices[int(correctData.partitioning[0].disk[-1])]
                ctx.installData.autoPartMethod = {"auto":methodEraseAll,"smartAuto":methodUseAvail}[correctData.partitioningType]
                if ctx.installData.autoPartMethod == methodUseAvail:
                    ctx.installData.autoPartPartition = ctx.yali.getResizableFirstPartition()
                ctx.installData.useYaliFirstBoot = correctData.useYaliFirstBoot
                ctx.installData.timezone = correctData.timezone

                # if exists use different source repo
                ctx.installData.repoAddr = correctData.repoAddr
                ctx.installData.repoName = correctData.repoName

                ctx.logger.debug("HOSTNAME : %s " % ctx.installData.hostName)
                ctx.logger.debug("KEYDATA  : %s " % ctx.installData.keyData["xkblayout"])

                if ctx.installData.repoAddr:
                    ctx.logger.debug("REPOADDR : %s " % ctx.installData.repoAddr)
                    ctx.logger.debug("REPONAME : %s " % ctx.installData.repoName)

                # multi types
                for user in correctData.users:
                    ctx.installData.users.append(user)
                    yali.users.PENDING_USERS.append(user)
                    ctx.logger.debug("USER    : %s " % user.username)

                if ctx.options.dryRun == True:
                    ctx.logger.debug("dryRun activated Yali stopped")
                else:
                    # Summary Screen is 10
                    ctx.mainScreen.setCurrent(10)
            else:
                ctx.logger.debug("This kahya file is not correct !!")
                wrongData = yaliKahya.getValues()
                ctx.logger.debug("".join(wrongData))
Example #3
0
    def execute(self):
        if not ctx.flags.kahya:
            ctx.logger.debug("There is no kahya jumps to the next screen.")
            return True

        ctx.autoInstall = True
        yaliKahya = kahya()
        ctx.logger.debug("Kahya File : %s " % ctx.flags.kahyaFile)

        if ctx.flags.kahya:
            ctx.logger.debug("KAHYA-PARAMS:: %s" % kahyaOpt)
            kahyaFile = kahyaOpt.split(',')[1]
            if kahyaFile == "":
                kahyaFile = ctx.consts.default_kahya_file
        elif ctx.options.useKahya:
            kahyaFile = ctx.consts.default_kahya_file
        else:
            kahyaFile = ctx.options.kahyaFile

        if kahyaFile:
            ctx.logger.debug("Reading kahya from file %s" % kahyaFile)
            yaliKahya.readData(kahyaFile)
            if yaliKahya.checkFileValidity() == True:
                ctx.logger.debug("File is ok")

                # find usable storage devices
                # initialize all storage devices
                if not yali.storage.initDevices():
                    raise GUIError, _("No storage device found.")

                devices = []
                for dev in yali.storage.devices:
                    if dev.getTotalMB() >= ctx.consts.min_root_size:
                        devices.append(dev)

                correctData = yaliKahya.getValues()

                # set keymap
                ctx.yali.setKeymap(correctData.keyData)

                # single types
                ctx.installData.isKahyaUsed = True
                ctx.installData.keyData = correctData.keyData
                ctx.installData.rootPassword = correctData.rootPassword
                ctx.installData.hostName = correctData.hostname
                ctx.installData.autoLoginUser = correctData.autoLoginUser
                yali.storage.setOrderedDiskList()
                ctx.installData.autoPartDev = devices[int(
                    correctData.partitioning[0].disk[-1])]
                ctx.installData.autoPartMethod = {
                    "auto": methodEraseAll,
                    "smartAuto": methodUseAvail
                }[correctData.partitioningType]
                if ctx.installData.autoPartMethod == methodUseAvail:
                    ctx.installData.autoPartPartition = ctx.yali.getResizableFirstPartition(
                    )
                ctx.installData.useYaliFirstBoot = correctData.useYaliFirstBoot
                ctx.installData.timezone = correctData.timezone

                # if exists use different source repo
                ctx.installData.repoAddr = correctData.repoAddr
                ctx.installData.repoName = correctData.repoName

                ctx.logger.debug("HOSTNAME : %s " % ctx.installData.hostName)
                ctx.logger.debug("KEYDATA  : %s " %
                                 ctx.installData.keyData["xkblayout"])

                if ctx.installData.repoAddr:
                    ctx.logger.debug("REPOADDR : %s " %
                                     ctx.installData.repoAddr)
                    ctx.logger.debug("REPONAME : %s " %
                                     ctx.installData.repoName)

                # multi types
                for user in correctData.users:
                    ctx.installData.users.append(user)
                    yali.users.PENDING_USERS.append(user)
                    ctx.logger.debug("USER    : %s " % user.username)

                if ctx.options.dryRun == True:
                    ctx.logger.debug("dryRun activated Yali stopped")
                else:
                    # Summary Screen is 10
                    ctx.mainScreen.setCurrent(10)
            else:
                ctx.logger.debug("This kahya file is not correct !!")
                wrongData = yaliKahya.getValues()
                ctx.logger.debug("".join(wrongData))