树莓派搭建openbmc
树莓派搭建openbmc
鉴于很多人想自己研究openbmc但手头没有硬件,仅能使用仿真特出此教程
在搭建过程遇到的问题大家可以搜一下骑马追风openbmc,可以找到答案
链接如下:
https://blog.csdn.net/qq_34160841/category_9800067.html
1.搭建ubuntu14虚拟机建议容量设置300G动态分配,内存分配8G
2.使用git工具克隆openbmc代码
// 克隆openbmc代码
git clone https://github.com/openbmc/openbmc.git
3.根据openbmc代码中README安装必要工具后执行如下三个关键步骤
export TEMPLATECONF=meta-evb/meta-evb-raspberrypi/conf
//注意前面有个点之后空格
. openbmc-env
4.执行完如上步骤后会来到build路径,需修改conf下的local.conf
ls meta-raspberrypi/conf/machine/*.conf可以看到支持的树莓派类型
根据自己的在MACHINE后面修改
MACHINE ?= "raspberrypi2"
DISTRO ?= "openbmc-phosphor"
PACKAGE_CLASSES ?= "package_rpm"
SANITY_TESTED_DISTROS_append ?= " *"
EXTRA_IMAGE_FEATURES = "debug-tweaks"
USER_CLASSES ?= "buildstats image-mklibs image-prelink"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS = "\
STOPTASKS,${TMPDIR},1G,100K \
STOPTASKS,${DL_DIR},1G,100K \
STOPTASKS,${SSTATE_DIR},1G,100K \
STOPTASKS,/tmp,100M,100K \
ABORT,${TMPDIR},100M,1K \
ABORT,${DL_DIR},100M,1K \
ABORT,${SSTATE_DIR},100M,1K \
ABORT,/tmp,10M,1K"
CONF_VERSION = "1"
GPU_MEM = "16"
DISTRO_FEATURES_append = "systemd"
VIRTUAL-RUNTIME_init_manager = "systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
VIRTUAL-RUNTIME_initscripts = ""
IMAGE_FSTYPES += " rpi-sdimg"
IMAGE_INSTALL_append = " ipmitool wpa-supplicant phosphor-webui"
# Set the root password to '0penBmc'
INHERIT += "extrausers"
EXTRA_USERS_PARAMS = " \
usermod -p '\$1\$UGMqyqdG\$FZiylVFmRRfl9Z0Ue8G7e/' root; \
"
require conf/machine/include/obmc-bsp-common.inc
5.修改meta-phosphor/classes/image_types_phosphor.bbclass文件的FLASH_SIZE为131072
参考如下链接
https://github.com/openbmc/openbmc/issues/3590
6.回到build路径执行如下命令
bitbake obmc-phosphor-image
时间较长看网速资源,凌晨会快很多别问我怎么知道的
还可以在local.conf添加BB_NUMBER_THREADS和PARALLEL_MAKE参数调节可以提升效率
7.全部编译完成会在build/tmp/deploy/images/raspberrypi2/下生成obmc-phosphor-image-raspberrypi2xxx.rootfs.rpi-sdimg
准备烧写
首先lsblk查看现有的块设备
插入sd卡再次lsblk对比下
很明显为的是sdb
//文件根据自己的路径和名称做修改
dd if=obmc-phosphor-image-raspberrypi2-xxx.rootfs.rpi-sdimg of=/dev/sdb
执行完后
sync
8.把烧好的sd卡插入树莓派接上网线上电,通过直连到的路由器可以查到树莓派自动获取到的ip地址
网页访问https://xxx.xxx.xxx.xxx
本文地址:https://blog.csdn.net/qq_20050959/article/details/108163331