赞
踩
如果使用WSL
开发,则需要基于WSL2
进行开发。
wsl2
的升级方法可以参考: https://learn.microsoft.com/zh-cn/windows/wsl/install
另外注意安装: https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
C:\Users\yuanz>wsl -l -v
NAME STATE VERSION
* Ubuntu-20.04 Stopped 1
C:\Users\yuanz>wsl --set-version Ubuntu-20.04 2
正在进行转换,这可能需要几分钟时间...
有关与 WSL 2 的主要区别的信息,请访问 https://aka.ms/wsl2
$ sudo apt-get install -y git build-essential libsdl1.2-dev
$ sudo apt-get install -y texinfo gawk chrpath diffstat zstd
$ sudo apt-get install chrpath
$ sudo apt-get install texinfo
$ sudo apt-get install lz4
socflash
如果需要使用windows
下的socflash
.需要禁用win10
的签名功能。
https://www.ngohq.com/
https://www.ngohq.com/driver-signature-enforcement-overrider.html
$ . setup //查看所有支持构建的平台
$ . setup evb-ast2500 build //选择evb-ast2500
$ bitbake obmc-phosphor-image /构建
$ ls build/tmp/deploy/images/evb-ast2500 //查看构建的二进制文件
swap
空间$ free -m
$ sudo dd if=/dev/zero of=/swapfile bs=1024 count=50000000 //设置50G空间
$ sudo mkswap /swapfile
$ sudo chmod 0600 /swapfile
$ sudo swapon /swapfile
$ free -m
webui
编译报错解决
按照增加swap
空间即可。
Executing update_font_cache intercept
解决办法:
将opembmc
整个目录删除,然后重新git
下载文件,重新编译,即可成功。这是一个通用常见的问题。
编译成功后:
可以直接下载安装qemu
工具:
$ sudo apt install qemu-system-arm
然后运行:
$ qemu-system-arm -m 256 -M ast2500-evb -nographic -drive file=tmp/deploy/images/evb-ast2500/obmc-phosphor-image-evb-ast2500-20231026011822.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
备注:
可以使用image-bmc
这个image
:
# qemu-system-arm -m 256 -M ast2500-evb -nographic -drive file=tmp/deploy/images/evb-ast2500/image-bmc,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
可以看到BMC
正常运行起来:
用户名与密码如下:
用户名: root
密码: 0penBmc
另外,也可以使用ssh
登录bmc
$ ssh root@localhost -p 2222
也可以直接访问web
也可以直接访问redfish
使用ipmitool
访问openbmc
:
wityuan@DESKTOP-ROG21UO:/mnt/c/Users/wityuan$ ipmitool -I lanplus -H 127.0.0.1 -U root -P 0penBmc -p 2623 -C 17 mc info Device ID : 0 Device Revision : 0 Firmware Revision : 2.15 IPMI Version : 2.0 Manufacturer ID : 0 Manufacturer Name : Unknown Product ID : 0 (0x0000) Product Name : Unknown (0x0) Device Available : no Provides Device SDRs : no Additional Device Support : Aux Firmware Rev Info : 0x00 0x00 0x00 0x00 wityuan@DESKTOP-ROG21UO:/mnt/c/Users/wityuan$ ipmitool -I lanplus -H 127.0.0.1 -U root -P 0penBmc -p 2623 -C 17 user list ID Name Callin Link Auth IPMI Msg Channel Priv Limit 1 root false true true ADMINISTRATOR 2 true false false NO ACCESS 3 true false false NO ACCESS 4 true false false NO ACCESS 5 true false false NO ACCESS 6 true false false NO ACCESS 7 true false false NO ACCESS 8 true false false NO ACCESS 9 true false false NO ACCESS 10 true false false NO ACCESS 11 true false false NO ACCESS 12 true false false NO ACCESS 13 true false false NO ACCESS 14 true false false NO ACCESS 15 true false false NO ACCESS
如果使用上面的qemu运行有问题,可以安装如下qemu
$ sudo apt remove --auto-remove qemu*
$ sudo apt purge --auto-purge qemu*
$ git clone https://github.com/openbmc/qemu.git
$ sudo apt install python3-venv
$ sudo apt install ninja-build libpixman-1-dev flex bison libslirp-dev libmount-dev
$ sudo apt install libglib2.0-dev
$ sudo ./configure --target-list=arm-softmmu --enable-slirp
$ sudo make && sudo make install
$ sudo ln -s build/arm-softmmu/qemu-system-arm /usr/bin/
最简单的方式:
$ sudo rm build
如果添加了功能模块,可以清除内容,重新生成可执行文件:
$ bitbake obmc-phosphor-image -c clean
$ bitbake obmc-phosphor-image
$ bitbake obmc-phosphor-image -c fetch
找到local.conf
文件,添加内容:
BB_NUMBER_THREADS ='8'
PARALLEL_MAKE ='-j 8'
离线下载:
BB_NO_NETWORK = "1"
ipmitool
工具可以在文件/home/wityuan/openbmc/build/evb-ast2500/conf/local.conf
中添加内容:
CORE_IMAGE_EXTRA_INSTALL += "ipmitool"
至此,编译:
$ bitbake obmc-phosphor-image -c clean
$ bitbake obmc-phosphor-image
完成后,启动bmc
,可以看到支持ipmitool
工具:
nfs
nfs
的,可以通过命令:# bitbake -c menuconfig linux-aspeed
进入menuconfig
的配置,以便添加kernel nfs
的支持。
dts
配置与分区配置build/evb-ast2500/workspace/sources/linux-aspeed/arch/arm/boot/dts/aspeed/openbmc-flash-layout.dtsi
:// SPDX-License-Identifier: GPL-2.0+ partitions { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; u-boot@0 { reg = <0x0 0x60000>; label = "u-boot"; }; u-boot-env@60000 { reg = <0x60000 0x20000>; label = "u-boot-env"; }; kernel@80000 { reg = <0x80000 0x800000>; //8Mbytes label = "kernel"; }; rofs@880000 { reg = <0x880000 0x1580000>; //21.5Mbytes label = "rofs"; }; rwfs@1e00000 { reg = <0x1e00000 0x200000>; label = "rwfs"; }; };
另外,修改文件:meta-aspeed/conf/machine/evb-ast2500.conf
KERNEL_DEVICETREE = "aspeed/aspeed-ast2500-evb.dtb" UBOOT_MACHINE = "evb-ast2500_defconfig" UBOOT_DEVICETREE = "ast2500-evb" require conf/machine/include/ast2500.inc require conf/machine/include/obmc-evb-common.inc # Overwrite flash layout FLASH_SIZE = "32768" FLASH_UBOOT_OFFSET = "0" FLASH_KERNEL_OFFSET = "512" FLASH_ROFS_OFFSET = "8704" FLASH_RWFS_OFFSET = "30720" RWFS_SIZE = "2097152" SERIAL_CONSOLES = "115200;ttyS4" FLASH_SIZE = "32768"
nfs
工具,ipmitool
工具为随手添加的build/evb-ast2500/conf/local.conf
:MACHINE ??= "evb-ast2500" DISTRO ?= "openbmc-phosphor" PACKAGE_CLASSES ?= "package_ipk" SANITY_TESTED_DISTROS:append ?= " *" EXTRA_IMAGE_FEATURES ?= "debug-tweaks" USER_CLASSES ?= "buildstats" PATCHRESOLVE = "noop" BB_DISKMON_DIRS ??= "\ STOPTASKS,${TMPDIR},1G,100K \ STOPTASKS,${DL_DIR},1G,100K \ STOPTASKS,${SSTATE_DIR},1G,100K \ STOPTASKS,/tmp,100M,100K \ HALT,${TMPDIR},100M,1K \ HALT,${DL_DIR},100M,1K \ HALT,${SSTATE_DIR},100M,1K \ HALT,/tmp,10M,1K" CONF_VERSION = "2" require conf/machine/include/obmc-bsp-common.inc CORE_IMAGE_EXTRA_INSTALL += "ipmitool nfs-utils nfs-export-root"
启动bmc
,如果还是挂载不上,可以通过命令:
# showmount -e ip
或者调试命令:
# mount -t nfs -o v3 -vvvv serverip:folder bmcdir
查看情况.
根据此提示信息,在server
端修改/etc/exports
内容:
最终,可以成功挂载。
ps:如果仍然挂不上nfs,可以尝试使用tcpdump继续分析。
1.Reconnecting to bitbake server…
如果使用的是ws
,最重要的是将openbmc
的开发目录设置为~/
目录。
2.WSL
wsl2
VHDX file
,方式openbmc
文件过大,硬盘空间占满。Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。