虚拟机:VMware
OS:Ubuntu22.04
一、环境安装
1:更新、安装需要的软件包:
sudo apt-get update
sudo apt-get upgrade
sudo apt install build-essential chrpath cpio debianutils diffstat file gawk gcc git iputils-ping libacl1 liblz4-tool locales python3 python3-git python3-jinja2 python3-pexpect python3-pip python3-subunit socat texinfo unzip wget xz-utils zstd
sudo apt install git librsvg2-bin locales make python3-saneyaml python3-sphinx-rtd-theme sphinx
sudo apt install fonts-freefont-otf latexmk tex-gyre texlive-fonts-extra texlive-fonts-recommended texlive-lang-all texlive-latex-extra texlive-latex-recommended texlive-xetex
sudo apt install git python3-distutils gcc g++ make file wget gawk diffstat bzip2 cpio chrpath zstd lz4 bzip2
2:检测当前语言环境:
locale --all-locales | grep en_US.utf8
注:如果不是 en_US.utf8 ,执行如下命令切换
sudo dpkg-reconfigure locales
二、下载源码
openBMC OpenBMC · GitHub
git clone https://github.com/openbmc/openbmc
注:根据网络及设备状态,如出现错误,多尝试几次
三、编译
1:进入下载的源码目录
cd openbmc
2:选择目标硬件
openbmc$. setup
Target machine must be specified. Use one of:
ahe50dc huygens s7106
bletchley kudo s8036
catalina lannister sbp1
daytonax minerva sdc-openBmc
dl360-g11 mori spc621d8hm3
dl360poc mtjade starscream
dl385-g11 mtjefferson system1
e3c246d4i mtmitchell-dcscm tatlin-archive-x86
e3c256d4i ncplite tiogapass
ethanolx nf5280m7 transformers
evb-ast2500 nicole vegman-n110
evb-ast2600 olympus-nuvoton vegman-rx20
evb-npcm750 p10bmc vegman-sx20
evb-npcm845 palmetto ventura
f0b pstbmc witherspoon
fp5280g3 qcom-dc-scm-v1 witherspoon-tacoma
fvp quanta-q71l x11spi
g220a rl300-g11 x570d4u
gbs romed8hm3 yosemite4
genesis3 romulus yosemite4n
greatlakes s2600wf yosemitev2
harma s6q zaius
openbmc$
3:选择ast2600作为编译目标
openbmc$. setup evb-ast2600
Machine evb-ast2600 found in meta-evb/meta-evb-aspeed/meta-evb-ast2600
Common targets are:
obmc-phosphor-image: Includes OpenBMC Phosphor userspace and Web UI
core-image-minimal: A small image just capable of allowing a device to boot
core-image-full-cmdline: A small image with more Linux functionality
installed, including a ssh server.
Note that the core targets will not set the default phosphor password.
evb-ast2600$
4:使用bitbake命令开始编译
(过程会比较久,有报错则重新执行命令)
evb-ast2600$bitbake obmc-phosphor-image
清理包缓存:
bitbake -c cleansstate ${PACKAGE}
5:编译完成
BMC固件生成位置: tmp/deploy/images/
evb-ast2600$ls tmp/deploy/images/evb-ast2600/*.mtd
tmp/deploy/images/evb-ast2600/obmc-phosphor-image-evb-ast2600-20241220010437.static.mtd
tmp/deploy/images/evb-ast2600/obmc-phosphor-image-evb-ast2600.static.mtd
四、QEMU运行固件
1:下载QEMU
wget https://jenkins.openbmc.org/job/latest-qemu-x86/lastSuccessfulBuild/artifact/qemu/build/qemu-system-arm
chmod u+x qemu-system-arm
2:使用ast2600固件启动QEMU
登录用户名:root
登录密码:0penBmc (0 -> 是数字0)
QEMU$ ls
qemu-system-arm
QEMU$ ./qemu-system-arm -m 512 -M ast2600-evb -nographic -drive file=../openBMC/openbmc/build/evb-ast2600/tmp/deploy/images/evb-ast2600/obmc-phosphor-image-evb-ast2600.static.mtd,format=raw,if=mtd -net nic -net user,hostfwd=:127.0.0.1:2222-:22,hostfwd=:127.0.0.1:2443-:443,hostfwd=udp:127.0.0.1:2623-:623,hostname=qemu
qemu-system-arm: warning: Aspeed iBT has no chardev backend
qemu-system-arm: warning: nic ftgmac100.1 has no peer
qemu-system-arm: warning: nic ftgmac100.2 has no peer
qemu-system-arm: warning: nic ftgmac100.3 has no peer
U-Boot SPL 2019.04 (Dec 19 2024 - 01:11:41 +0000)
Trying to boot from RAM
U-Boot 2019.04 (Dec 19 2024 - 01:11:41 +0000)
SOC: AST2600-A3
eSPI Mode: SIO:Enable : SuperIO-2e
Eth: MAC0: RGMII, MAC1: RGMII, MAC2: RGMII, MAC3: RGMII
Model: AST2600 EVB
......
......
[ OK ] Finished Wait for /xyz/openbmc_project/state/bmc0.
Phosphor OpenBMC (Phosphor OpenBMC Project Reference Distro) nodistro.0 evb-ast2600 ttyS4
evb-ast2600 login:
注:结束QEMU命令:
ctrl+a,x (在QEMU下先按ctrl+a,再按x)
3:查看BMC功能
使用ipmi命令
ipmitool -H 127.0.0.1 -U root -P 0penBmc -I lanp -p 2623 -C 17 mc info查看Web:
https://localhost:2443/loginssh连接
ssh root@localhost -p 2222
如上仅个人见解,如有错误请指正,感谢!
862

被折叠的 条评论
为什么被折叠?



