openBmcCompileSecond

构建openbmc另一个厂商的Release版本

一、识别厂商和改动的库

需要搞清楚哪个库的修改的commit号在哪里改,开发人员都已经在openbmc.git库里面改好,只有webui需要手工改,位置在:
vim meta-haiguang/meta-haiguang2/recipes-phosphor/webui/phosphor-webui_git.bb,其中 meta-haiguang2 是本次将要构建的厂商版本

另外已知有温控git库做了改动, 它的修改 vim meta-phosphor/classes/skeleton-rev.bbclass可以看到,开发人员已经改好.

二、更新改动的库

要删掉downloads/git2下面的webui和skeleton库,再git clone –bare 一下
还是选择在本地 rxsunSource/git下克隆一个源代码库 加一个remote为 downloads/git2下的库名称 ,push这里,为构建所用.

三、开始构建

在build下 export TEMPLATECONF=meta-haiguang/meta-haiguang2/conf/
rm conf/ -rf
在openbmc下 . openbmc-env 会生成conf目录
cd conf vim local.conf 看一下

git pull //获取开发人员对bitbake所用的.bb及.bbclass文件的修改
git tag -a v0.16.1 -m “Release v0.16 for tongfang” //打tag 变动不大,注释上厂商名称
git status //看到刚刚改的webui的bb文件
git add ,git commit

在build下,执行bitbake obmc-phosphor-image

四、构建报错:

找不到phosphor-hwmon库

ERROR: phosphor-hwmon-1.0+gitAUTOINC+7509bffc35-r1 do_fetch: Fetcher failure: Unable to find revision 7509bffc35ba141844d645533e0628ddd105551a in branch master even from upstream
ERROR: phosphor-hwmon-1.0+gitAUTOINC+7509bffc35-r1 do_fetch: Fetcher failure for URL: 'git://github.com/openbmc/phosphor-hwmon'. Unable to fetch URL from any source.
ERROR: phosphor-hwmon-1.0+gitAUTOINC+7509bffc35-r1 do_fetch: Function failed: base_do_fetch
ERROR: Logfile of failure stored in: /home/kunlun/rxsunSource/openbmc/build/tmp/work/armv6-openbmc-linux-gnueabi/phosphor-hwmon/1.0+gitAUTOINC+7509bffc35-r1/temp/log.do_fetch.26476
ERROR: Task (/home/kunlun/rxsunSource/openbmc/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon_git.bb:do_fetch) failed with exit code '1'

是因为改了这个库,bb文件已经修改,但是在本地的downloads/git2下没有找到里面的commit号,没有同步导致的,编译不过.
查看downloads/git2下该库已经被删掉了 ,再git clone –bare 到downloads/git2 里面.
在build下,执行bitbake obmc-phosphor-image又报错,是因为名字不该有.git后缀.

重命名为没有.git后缀的目录,回到build下,执行bitbake obmc-phosphor-image,

五、又报错

还是找不到库,这次是内核linux库

ERROR: linux-aspeed-4.18.16+gitAUTOINC+72fbc47ed6-r0 do_fetch: Fetcher failure: Unable to find revision 72fbc47ed6c682c9ef362f622336221031dddf8d in branch dev-4.18 even from upstream
ERROR: linux-aspeed-4.18.16+gitAUTOINC+72fbc47ed6-r0 do_fetch: Fetcher failure for URL: 'git://github.com/openbmc/linux;protocol=git;branch=dev-4.18'. Unable to fetch URL from any source.
ERROR: linux-aspeed-4.18.16+gitAUTOINC+72fbc47ed6-r0 do_fetch: Function failed: base_do_fetch
ERROR: Logfile of failure stored in: /home/kunlun/rxsunSource/openbmc/build/tmp/work/haiguang2-openbmc-linux-gnueabi/linux-aspeed/4.18.16+gitAUTOINC+72fbc47ed6-r0/temp/log.do_fetch.11230
ERROR: Task (/home/kunlun/rxsunSource/openbmc/meta-aspeed/recipes-kernel/linux/linux-aspeed_git.bb:do_fetch) failed with exit code '1'

linux库有了变动 ,因为改了温控,是内核的,导致编译时间很久.
scp 后 重命名为没有.git后缀的目录,回到build下重新 执行bitbake obmc-phosphor-image,
成功.

六、构建后测试发现错误

开发人员提交修改的库,已经修改bb文件,只需要删掉后重新git clone –bare 并改名去掉.git
编译报错

ERROR: /home/kunlun/rxsunSource/openbmc/meta/recipes-core/os-release/os-release.bb: Error executing a python function in <code>:  --:--:--
The stack trace of python calls that resulted in this exception/failure was:
File: '<code>', lineno: 12, function: <module>
     0008:__anon_35__home_kunlun_rxsunSource_openbmc_meta_classes_devshell_bbclass(d)
     0009:__anon_105__home_kunlun_rxsunSource_openbmc_meta_classes_sstate_bbclass(d)
     0010:__anon_20__home_kunlun_rxsunSource_openbmc_meta_classes_blacklist_bbclass(d)
     0011:__anon_50__home_kunlun_rxsunSource_openbmc_meta_classes_allarch_bbclass(d)
 *** 0012:__anon_28__home_kunlun_rxsunSource_openbmc_meta_phosphor_recipes_core_os_release_os_release_bbappend(d)
File: '/home/kunlun/rxsunSource/openbmc/meta-phosphor/recipes-core/os-release/os-release.bbappend', lineno: 23, function: __anon_28__home_kunlun_rxsunSource_openbmc_meta_phosphor_recipes_core_os_release_os_release_bbappend
     0019:        d.setVar('VERSION_ID', version_id)
     0020:        versionList = "rc"
     0021:        versionList = version_id.split('-')
     0022:        version = versionList[0] + "-" + versionList[1]
 *** 0023:        d.setVar('VERSION', version)
     0024:
     0025:    build_id = run_git(d, 'describe --abbrev=0')
     0026:    if build_id:
     0027:        d.setVar('BUILD_ID', build_id)
Exception: IndexError: list index out of range

ERROR: Failed to parse recipe: /home/kunlun/rxsunSource/openbmc/meta/recipes-core/os-release/os-release.bb

解决办法,回退openbmc库到之前某个版本
git reset –hard 到 8f0bc988f7924e11899d64b48290a2bdad62891d ,再git pull
bitbake又报错
git status add commit –可能还是打tag引起的问题,有时间修改一下这个文件
再bitbake

六、总结

学会读openbmc里面的变更中提到的库名,及时同步更新.
最好还是建立一个本地库,否则被删除后只能重新scp ,而本地库可以只git pull变更的内容,然后再push到到底的裸库中.
编译某个版本之前要在群里先问一下谁改动了哪个库,编译好后要发给相关开发人员,让各个人分别验证一下
添加远程库可以用命令行:
git remote add local ~/rxsunSource/openbmc/build/downloads/git2/github.com.openbmc.phosphor-webui.git

=====================================================================================================

ruixia,sun wechat
生活相关,请扫描wechat帐号获取更多精彩内容。。。。。。
0%