コード例 #1
0
ファイル: packages.py プロジェクト: yangliping/stacki
    if not anaconda.id.upgrade:
        anaconda.id.storage.turnOnSwap()
        anaconda.id.storage.mountFilesystems(
            raiseErrors=False,
            readOnly=False,
            skipRoot=anaconda.backend.skipFormatRoot)
    else:
        if upgrade_migrate:
            # we should write out a new fstab with the migrated fstype
            shutil.copyfile("%s/etc/fstab" % anaconda.rootPath,
                            "%s/etc/fstab.anaconda" % anaconda.rootPath)
            anaconda.id.storage.fsset.write(anaconda.rootPath)

        # and make sure /dev is mounted so we can read the bootloader
        bindMountDevDirectory(anaconda.rootPath)

    # STACKI
    file = open('/proc/cmdline', 'r')
    args = file.readline().split()
    file.close()

    if 'boss' in args:
        import subprocess
        import os

        #
        # if we are a boss, then download the selected rolls
        #
        w = anaconda.intf.waitWindow(_("Downloading pallets"),
                                     _("Downloading all selected pallets"))
コード例 #2
0
ファイル: packages.py プロジェクト: BGS/rogentos-anaconda
            sys.exit(1)

    if not anaconda.upgrade:
        anaconda.storage.turnOnSwap()
        anaconda.storage.mountFilesystems(raiseErrors=False,
                                          readOnly=False,
                                          skipRoot=anaconda.backend.skipFormatRoot)
    else:
        if upgrade_migrate:
            # we should write out a new fstab with the migrated fstype
            shutil.copyfile("%s/etc/fstab" % anaconda.rootPath,
                            "%s/etc/fstab.anaconda" % anaconda.rootPath)
            anaconda.storage.fsset.write(anaconda.rootPath)

        # and make sure /dev is mounted so we can read the bootloader
        bindMountDevDirectory(anaconda.rootPath)


def setupTimezone(anaconda):
    # we don't need this on an upgrade or going backwards
    if anaconda.upgrade or anaconda.dir == DISPATCH_BACK:
        return

    os.environ["TZ"] = anaconda.timezone.tz
    tzfile = "/usr/share/zoneinfo/" + anaconda.timezone.tz
    tzlocalfile = "/etc/localtime"
    if not os.access(tzfile, os.R_OK):
        log.error("unable to set timezone")
    else:
        try:
            os.remove(tzlocalfile)
コード例 #3
0
ファイル: packages.py プロジェクト: mattias-ohlsson/anaconda
            sys.exit(1)

    if not anaconda.upgrade:
        anaconda.storage.turnOnSwap()
        anaconda.storage.mountFilesystems(raiseErrors=False,
                                          readOnly=False,
                                          skipRoot=anaconda.backend.skipFormatRoot)
    else:
        if upgrade_migrate:
            # we should write out a new fstab with the migrated fstype
            shutil.copyfile("%s/etc/fstab" % ROOT_PATH,
                            "%s/etc/fstab.anaconda" % ROOT_PATH)
            anaconda.storage.fsset.write()

        # and make sure /dev is mounted so we can read the bootloader
        bindMountDevDirectory(ROOT_PATH)


def setupTimezone(anaconda):
    # we don't need this on an upgrade or going backwards
    if anaconda.upgrade or flags.imageInstall or anaconda.dir == DISPATCH_BACK:
        return

    os.environ["TZ"] = anaconda.timezone.tz
    tzfile = "/usr/share/zoneinfo/" + anaconda.timezone.tz
    tzlocalfile = "/etc/localtime"
    if not os.access(tzfile, os.R_OK):
        log.error("unable to set timezone")
    else:
        try:
            os.remove(tzlocalfile)