添加新系統到 OpenBMC 實踐
首先構建新的 romulus-prime 元文件
按照 添加新系統到 OpenBMC 文檔 中介紹的 創建新系統
小節構建自己的新系統。
使用 bitbake
編譯新的系統
- 在完成上面步驟后,使用如下命令先配置本次使用的環境變量:
. setup romulus-prime
- 自動跳轉到
build/romulus-prime
目錄下,在這個目錄下編譯新構建的系統:bitbake obmc-phosphor-image
- 因為缺少一些必要的配置,會報錯類似如下:
ERROR: Task (/home/arv/openbmc/openbmc/meta-aspeed/recipes-kernel/linux/linux-aspeed_git.bb:do_compile) failed with exit code '1' NOTE: Tasks Summary: Attempted 2433 tasks of which 2431 didn't need to be rerun and 1 failed. Summary: 1 task failed: /home/arv/openbmc/openbmc/meta-aspeed/recipes-kernel/linux/linux-aspeed_git.bb:do_compile Summary: There was 1 WARNING message shown. Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
- 因為
OpenBMC
的發展過程中,拋棄掉了一些內容,因此只需要按照 添加新系統到 OpenBMC 文檔 中的構建新系統
小節的第3步進行配置:FILESEXTRAPATHS:prepend:romulus-prime := "${THISDIR}/${PN}:" SRC_URI:append:romulus = " file://romulus.cfg"
- 現在報錯中有如下內容:
| make[1]: *** No rule to make target 'arch/arm/boot/dts/aspeed-bmc-opp-romulus-prime.dtb'. Stop. | make: *** [/home/arv/openbmc/openbmc/build/romulus-prime/tmp/work-shared/romulus-prime/kernel-source/Makefile:1400: aspeed-bmc-opp-romulus-prime.dtb] Error 2 | ERROR: oe_runmake failed | WARNING: exit code 1 from a shell command.
- 繼續按照 添加新系統到 OpenBMC 文檔 中的
構建新系統
小節的第4步進行配置,此時編譯順利完成vi ./meta-ibm/meta-romulus-prime/conf/machine/romulus-prime.conf # Replace the ${MACHINE} variable in the KERNEL_DEVICETREE # Use romulus device tree KERNEL_DEVICETREE = "${KMACHINE}-bmc-opp-romulus.dtb"
啟動 QEMU
仿真
在 build/romulus-prime
目錄下執行如下命令,啟動 QEMU
仿真:
sudo qemu-system-arm -m 256 -M romulus-bmc -nographic -drive file=./tmp/deploy/images/romulus-prime/obmc-phosphor-image-romulus-prime.static.mtd,format=raw,if=mtd -net nic -net user,hostfwd=:192.168.0.101:2222-:22,hostfwd=:192.168.0.101:2443-:443,hostname=qemu
啟動后,提示登錄:
Phosphor OpenBMC (Phosphor OpenBMC Project Reference Distro) nodistro.0 romulus-prime ttyS4
romulus-prime login: