yocto-sumo源码解析(五): bitbake/lib/bb/main.py

续前面分析,就该对bitbake_main()这个函数进行分析了,这个函数位于bitbake/lib/bb/main.py。

1. 检测主机操作系统是否为linux并且/dev/shm是否存在,python的multiprocessing需要/dev/shm支持:

    # Python multiprocessing requires /dev/shm on Linux
    if sys.platform.startswith('linux') and not os.access('/dev/shm', os.W_OK | os.X_OK):
        raise BBMainException("FATAL: /dev/shm does not exist or is not writable")

 2. 重新设置stdout,禁用缓冲以避免长log被截断:

    # Unbuffer stdout to avoid log truncation in the event
    # of an unorderly exit as well as to provide timely
    # updates to log files for use with tail
    try:
        if sys.stdout.name == '<stdout>':
            # Reopen with O_SYNC (unbuffered)
            fl = fcntl.fcntl(sys.stdout.fileno(), fcntl.F_GETFL)
            fl |= os.O_SYNC
            fcntl.fcntl(sys.stdout.fileno(), fcntl.F_SETFL, fl)
    except:
        pass

 3. 设置配置参数:

    configuration.setConfigParameters(configParams)

 4. 检查配置参数:server_only和remote_server在配置参数中不能同时存在:

    if configParams.server_only and configParams.remote_server:
            raise BBMainException("FATAL: The '--server-only' option conflicts with %s.\n" %
                                  ("the BBSERVER environment variable" if "BBSERVER" in os.environ \
                                   else "the '--remote-server' option"))

 5. 检查配置参数:如果是observe_only,那么remote_server和bind不能同时配置:

    if configParams.observe_only and not (configParams.remote_server or configParams.bind):
        raise BBMainException("FATAL: '--observe-only' can only be used by UI clients "
                              "connecting to a server.\n")

 6. 配置BBDEBUG级别,如果环境变量BBDEBUG配置级别大于配置参数中的debug级别,采用BBDEBUG:

    if "BBDEBUG" in os.environ:
        level = int(os.environ["BBDEBUG"])
        if level > configuration.debug:
            configuration.debug = level

 7. 初始化消息配置:

    bb.msg.init_msgconfig(configParams.verbose, configuration.debug,
                          configuration.debug_domains)

8. 建立bitbake:并且进入ui_module的main函数

    server_connection, ui_module = setup_bitbake(configParams, configuration)
    # No server connection
    if server_connection is None:
        if configParams.status_only:
            return 1
        if configParams.kill_server:
            return 0

    if not configParams.server_only:
        if configParams.status_only:
            server_connection.terminate()
            return 0

        try:
            for event in bb.event.ui_queue:
                server_connection.events.queue_event(event)
            bb.event.ui_queue = []

            return ui_module.main(server_connection.connection, server_connection.events,
                                  configParams)
        finally:
            server_connection.terminate()
    else:
        return 0

    return 1

 

转载于:https://www.cnblogs.com/shortnil/p/9581549.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
ERROR: Bitbake Fetcher Error: FetchError('Fetch command export PSEUDO_DISABLED=1; export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus,guid=d96498d849b66a7ed5ae1643647dc969"; export SSH_AGENT_PID="1854"; export SSH_AUTH_SOCK="/run/user/1000/keyring/ssh"; export PATH="/home/wu/3568/yocto/poky/scripts/native-intercept:/home/wu/3568/yocto/build/tmp/sysroots-uninative/x86_64-linux/usr/bin:/home/wu/3568/yocto/build/tmp/work/x86_64-linux/bmap-tools-native/3.6+gitAUTOINC+c0673962a8-r0/recipe-sysroot-native/usr/bin/python3-native:/home/wu/3568/yocto/poky/scripts:/home/wu/3568/yocto/build/tmp/work/x86_64-linux/bmap-tools-native/3.6+gitAUTOINC+c0673962a8-r0/recipe-sysroot-native/usr/bin/x86_64-linux:/home/wu/3568/yocto/build/tmp/work/x86_64-linux/bmap-tools-native/3.6+gitAUTOINC+c0673962a8-r0/recipe-sysroot-native/usr/bin:/home/wu/3568/yocto/build/tmp/work/x86_64-linux/bmap-tools-native/3.6+gitAUTOINC+c0673962a8-r0/recipe-sysroot-native/usr/sbin:/home/wu/3568/yocto/build/tmp/work/x86_64-linux/bmap-tools-native/3.6+gitAUTOINC+c0673962a8-r0/recipe-sysroot-native/usr/bin:/home/wu/3568/yocto/build/tmp/work/x86_64-linux/bmap-tools-native/3.6+gitAUTOINC+c0673962a8-r0/recipe-sysroot-native/sbin:/home/wu/3568/yocto/build/tmp/work/x86_64-linux/bmap-tools-native/3.6+gitAUTOINC+c0673962a8-r0/recipe-sysroot-native/bin:/home/wu/3568/yocto/poky/bitbake/bin:/home/wu/3568/yocto/build/tmp/hosttools"; export HOME="/home/wu"; git -c core.fsyncobjectfiles=0 -c gc.autoDetach=false -c core.pager=cat clone -n -s /home/wu/3568/yocto/build/../packages/git2/github.com.intel.bmap-tools/ /home/wu/3568/yocto/build/tmp/work/x86_64-linux/bmap-tools-native/3.6+gitAUTOINC+c0673962a8-r0/git/ failed with exit code 128, output:\nfatal: repository \'/home/wu/3568/yocto/build/../packages/git2/github.com.intel.bmap-tools/\' does not exist\n', None)具体如何修改
06-08

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值