编译完成openbmc, 通常先使用qemu经常验证
一般情况不推荐使用原始的image 文件, 应该复制出来使用. qemu运行时会改变RWFS分区的部分.
我使用这2个脚本进行测试
复制脚本 flash.sh
#!/bin/bash
. ~/.profile
if [ -n "$BBPATH" ] ; then
evb=`basename $BBPATH`
flash_name="${BBPATH}/tmp/deploy/images/${evb}/flash-${evb}"
local_name=$(readlink $flash_name)
dir=$(dirname $flash_name)
flash_true="$dir/$local_name"
echo $flash_true
cp $flash_true images/
cp $flash_true ${evb}.bin
# cp $flash_true backup.bin
# echo "cp ${evb}.bin to tftp"
# sudo cp $flash_true /srv/tftp/${evb}.bin
ssh-keygen -f "/home/kenneth/.ssh/known_hosts" -R "[127.0.0.1]:2242"
echo done
fi
启动脚本qemu
#!/bin/bash
. ~/.profile
if [ -n "$BBPATH" ] ; then
evb=`basename $BBPATH`
flash_name="${BBPATH}/tmp/deploy/images/${evb}/flash-${evb}"
local_name=$(readlink $flash_name)
dir=$(dirname $flash_name)
flash_true="$dir/$local_name"
echo $flash_true
echo ~/qemu/build/qemu-system-arm -m 1G -M z12 -nographic -drive file=./$evb.bin,format=raw,if=mtd,index=0 -drive file=./${evb}2.bin,format=raw,if=mtd,index=1 -drive file=./${evb}3.bin,format=raw,if=mtd,index=2 -net nic -net nic -net nic -net nic -net user,hostfwd=::2443-:443,hostfwd=::2242-:22,hostfwd=udp::2623-:623,hostfwd=::2446-:2345
~/qemu/build/qemu-system-arm -m 512M -M z12 -nographic \
-drive file=./${evb}.bin,format=raw,if=mtd,unit=0 \
-drive file=./backup.bin,format=raw,if=mtd,unit=1 \
-drive file=./emmc.bin,format=raw,if=sd,unit=2 \
-net nic -net nic -net nic -net nic -net user,hostfwd=::2443-:443,hostfwd=::2242-:22,hostfwd=udp::2623-:623,hostfwd=::2446-:2345
fi