在ubuntu server16.04上构建openbmc的Release版本
一、基本过程
服务器环境准备好,用bitbake编译远程和本地的git库,维护各个git库将要被编入的commit号。
二、环境准备工作
bmcCompileBak上装ubuntu server16.04,所有服务器选项都勾上,配好网络地址。
为了运行bitbake,要先安装build-essential,这需要先apt update和 upgrade。
三、资料准备
新建目录openbmc,在openbmc下 mkdir donwlowds ,在donwlowds下mkdir git2
用scp命令将本地gitlab服务器上openbmc组里除了“openbmc.git”以外的git库全部拷贝到git2目录下,这一步相当于git clone –bare,都是拷贝裸库的文件。
以后如果某个git库有变化,都要先删除它,再从gitlab服务器上 git clone –bare 一下,或者git pull一次。
回到openbmc目录下 git clone openbmc.git ,这次克隆的是源代码,是要修改的。
四、第一次构建
在openbmc目录下
export TEMPLATECONF=meta-haiguang/meta-haiguang1/conf/
在openbmc下,执行. openbmc-env命令,会生成conf目录,可以cd conf进去, vim local.conf 看一下
也会生成build目录,cd 到此目录下 执行bitbake obmc-phosphor-image ,注意,不能是root用户
五、编译过程中的问题一
ERROR: phosphor-webui-1.0+gitAUTOINC+aacd2a572a-r1 do_fetch: Fetcher failure: Unable to find revision aacd2a572a36abc511da08b9a7b671e1265f7299 in branch master even from upstream是找不到某个分支上的某个commit号,
打开我们准备编译的版本中的这个文件,
vim meta-haiguang/meta-haiguang1/recipes-phosphor/webui/phosphor-webui_git.bb
改分支和commit号为正确的值。
六、编译过程中的问题二
ERROR: pflash-v6.1-r0 do_fetch: Fetcher failure: Unable to find revision bb7ae1ade9e06a854771b8ed1e26f7d58b508e84 in branch master even from upstream
ERROR: obmc-phosphor-image-1.0-r0 do_generate_static: Error executing a python function in exec_python_func() autogenerated:
The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
0001:
*** 0002:do_generate_static(d) 好像是python环境没有 ubuntu server16.04 默认装2.7和3.5 切换一下就行 alias python=python3 也可以 echo alias python=python3 >> /home/kunlun/.bashrc source /home/kunlun/.bashrc
执行bitbake obmc-phosphor-image ,仍然不对,再读错误信息,是找不到文件u-boot.bin
Exception: FileNotFoundError: [Errno 2] No such file or directory: '/home/kunlun/rxsunSource/openbmc/build/tmp/deploy/images/haiguang1/u-boot.bin'find ./ -name u-boot.bin
./tmp/work/haiguang1-openbmc-linux-gnueabi/u-boot-aspeed/1_v2016.07+gitAUTOINC+fc8646ea8a-r0/packages-split/u-boot-aspeed/boot/u-boot.bin
./tmp/work/haiguang1-openbmc-linux-gnueabi/u-boot-aspeed/1_v2016.07+gitAUTOINC+fc8646ea8a-r0/package/boot/u-boot.bin
./tmp/work/haiguang1-openbmc-linux-gnueabi/u-boot-aspeed/1_v2016.07+gitAUTOINC+fc8646ea8a-r0/build/u-boot.bin
./tmp/work/haiguang1-openbmc-linux-gnueabi/u-boot-aspeed/1_v2016.07+gitAUTOINC+fc8646ea8a-r0/image/boot/u-boot.bincp 第三个到 cp ./tmp/work/haiguang1-openbmc-linux-gnueabi/u-boot-aspeed/1_v2016.07+gitAUTOINC+fc8646ea8a-r0/build/u-boot.bin /home/kunlun/rxsunSource/openbmc/build/tmp/deploy/images/haiguang1/u-boot.bin
执行 bitbake obmc-phosphor-image编译不过去,提示需要python2.7,只好又改回来python2.7
七、编译成功
build下执行bitbake obmc-phosphor-image,编译成功,结果存放在/openbmc/build/tmp/deploy/images/haiguang1
-rw-rw-r-- 2 kunlun kunlun 33554432 8月 15 10:11 obmc-phosphor-image-haiguang1-20190815021143.static.mtd 烧录器所用
-rw-rw-r-- 2 kunlun kunlun 33566720 8月 15 10:13 obmc-phosphor-image-haiguang1-20190815021143.static.mtd.all.tar 带配置文件的
-rw-rw-r-- 2 kunlun kunlun 27637760 8月 15 10:12 obmc-phosphor-image-haiguang1-20190815021143.static.mtd.tar 不带配置文件的八、改network库的commit号:
有一个需求是network包要使用上一次的提交commit号,在vim meta-phosphor/classes/phosphor-networkd-rev.bbclass 中改,这是一个公共的库。
build下执行bitbake obmc-phosphor-image,编译成功,ftp到ftp服务器上。
九、测试人员发现没有版本,需要打标签
先在openbmc目录下git tag查看一下,已经有v0.15之前的所有tag,再vim ./meta-phosphor/recipes-core/os-release/os-release.bbappend看到版本上上一次生成的v0.15,需要更新。
git describe –dirty=-release 也可以查看,已经到了v0.15
用git tag -a v0.16 -m “Release V0.16” 生成tag。
十、测试人员发现bios版本是0.0
这是一个bug 打过tag后要再提交一次
git status
modified: meta-haiguang/meta-haiguang1/recipes-phosphor/webui/phosphor-webui_git.bb
modified: meta-phosphor/classes/phosphor-networkd-rev.bbclass
git add . ,git commitvim ./tmp/sysroots-components/all/os-release/ 查看结果
find ./ -name os-release
build下执行bitbake obmc-phosphor-image,编译成功,ftp到ftp服务器上。
十一、后续处理
写ReleaseNote.txt,包括本版本解决的所有bug。bug的解决方式可以是代码也可以是手册,手册修改对应的bug是哪一个,应该在发布版本时也加以说明。
ReleaseNote.txt,以及测试人员的用户手册和测试报告,都放到ftp服务器上。
为了易于分发,要分包压缩20m以下
做一个md5 将分包的文件解包为单个文件,用md5sum生成密码,再用“certulti -hashfile 文件名 md5” 验证md5码是否正确,发给用户。
=====================================================================================================