def __init__(self, base_dir, mount, chromeos_root, remote, board, flags,
                 keep_intermediate_files, tools, cleanup):
        self._l = logger.GetLogger()
        self._chromeos_root = chromeos_root
        self._chromeos_chroot = path.join(chromeos_root, 'chroot')
        if mount:
            self._gcc_source_dir_to_mount = mount
            self._gcc_source_dir = path.join(constants.MOUNTED_TOOLCHAIN_ROOT,
                                             'gcc')
        else:
            self._gcc_source_dir = None

        self._remote = remote
        self._board = board
        ## Compute target from board
        self._target = misc.GetCtargetFromBoard(board, chromeos_root)
        if not self._target:
            raise ValueError('Unsupported board "%s"' % board)
        self._executer = command_executer.GetCommandExecuter()
        self._flags = flags or ''
        self._base_dir = base_dir
        self._tmp_abs = None
        self._keep_intermediate_files = keep_intermediate_files
        self._tools = tools.split(',')
        self._cleanup = cleanup
    def __init__(self, base_dir, source_dir, chromeos_root, remote, board,
                 cleanup):
        self._l = logger.GetLogger()
        self._chromeos_root = chromeos_root
        self._chromeos_chroot = path.join(chromeos_root, 'chroot')

        self._remote = remote
        self._board = board
        ## Compute target from board
        self._target = misc.GetCtargetFromBoard(board, chromeos_root)
        if not self._target:
            raise RuntimeError('Unsupported board "%s"' % board)
        self._executer = command_executer.GetCommandExecuter()
        self._base_dir = base_dir
        self._tmp_abs = None
        self._cleanup = cleanup
        self._sshflag = ('-o StrictHostKeyChecking=no ' +
                         '-o CheckHostIP=no ' +
                         '-o UserKnownHostsFile=$(mktemp) ')

        if source_dir:
            self._source_dir = source_dir
            self._mount_flag = 'USE="mounted_sources"'
            self.MountSource()
        else:
            self._source_dir = None
            self._mount_flag = ''
Ejemplo n.º 3
0
    def __init__(self,
                 name,
                 source_path,
                 chromeos_root,
                 board,
                 incremental,
                 build_env,
                 gcc_enable_ccache=False):
        self._name = name
        self._source_path = misc.CanonicalizePath(source_path)
        self._chromeos_root = chromeos_root
        self._board = board
        self._ctarget = misc.GetCtargetFromBoard(self._board,
                                                 self._chromeos_root)
        self._gcc_libs_dest = misc.GetGccLibsDestForBoard(
            self._board, self._chromeos_root)
        self.tag = '%s-%s' % (name, self._ctarget)
        self._ce = command_executer.GetCommandExecuter()
        self._mask_file = os.path.join(
            self._chromeos_root, 'chroot',
            'etc/portage/package.mask/cross-%s' % self._ctarget)
        self._new_mask_file = None

        self._chroot_source_path = os.path.join(
            constants.MOUNTED_TOOLCHAIN_ROOT, self._name).lstrip('/')
        self._incremental = incremental
        self._build_env = build_env
        self._gcc_enable_ccache = gcc_enable_ccache
 def _BuildUseImage(self):
     ctarget = misc.GetCtargetFromBoard(self._board, self._chromeos_root)
     chroot_profile_dir = os.path.join('/home/%s/trunk' % getpass.getuser(),
                                       'src', 'scripts', self._profile_dir,
                                       ctarget)
     cflags = ('-fprofile-use '
               '-fprofile-correction '
               '-Wno-error '
               '-fdump-tree-optimized-blocks-lineno '
               '-fdump-ipa-profile-blocks-lineno '
               '-fno-vpt '
               '-fprofile-dir=%s' % chroot_profile_dir)
     labels_list = ['updated_pgo', self._ebuild_version]
     label = '_'.join(labels_list)
     pgo_use_label = self._BuildChromeAndImage(
         env_dict={'USE': 'chrome_internal -pgo'},
         cflags=cflags,
         cxxflags=cflags,
         ldflags=cflags,
         label=label,
         ebuild_version=self._ebuild_version)
     return pgo_use_label
 def _UnInstallToolchain(self):
     command = ('sudo CLEAN_DELAY=0 emerge -C cross-%s/gcc' %
                misc.GetCtargetFromBoard(self._board, self._chromeos_root))
     ret = self._ce.ChrootRunCommand(self._chromeos_root, command)
     if ret != 0:
         raise RuntimeError("Couldn't uninstall the toolchain!")
 def _GetProfileDir(self):
     return misc.GetCtargetFromBoard(self._board, self._chromeos_root)