qemu加载openbmc image

编译完成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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值