编译
command
git clone https://github.com/openbmc/openbmc.git
git checkout -b v2.9.0 2.9.0
export TEMPLATECONF=meta-evb/meta-evb-raspberrypi/conf
. openbmc-env
nvim conf/local.conf 将MACHINE 改为:MACHINE ?= "raspberrypi4-64"
bitbake obmc-phosphor-image
error
- Feature 'phosphor-gpio-keys' not found, this will cause configuration failures
| DEBUG: Executing shell function do_kernel_metadata
| ERROR: Feature 'phosphor-gpio-keys' not found, this will cause configuration failures.
| ERROR: Check the SRC_URI for meta-data repositories or directories that may be missing
| ERROR: Set KERNEL_DANGLING_FEATURES_WARN_ONLY to ignore this issue
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/home/basha/openbmc/build/tmp/work/raspberrypi3_64-openbmc-linux/linux-raspberrypi/1_5.4.69+gitAUTOINC+5d52d9eea9_31d364af25-r0/temp/run.do_kernel_metadata.118535' failed with exit code 1:
| WARNING: exit code 1 from a shell command.
修改以下文件将 error 改为 warning:
nvim meta-phosphor/raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend
python ()
{
# OpenBMC loads in kernel features via other mechanisms so this check
# in the kernel-yocto.bbclass is not require
dd.setVar("KERNEL_DANGLING_FEATURES_WARN_ONLY","1")
}
- 'fitImage-obmc-phosphor-initramfs-raspberrypi4-64-raspberrypi4-64' is too large!
ERROR: obmc-phosphor-image-1.0-r0 do_generate_static: Image '/home/username/devel/openbmc/build/tmp/deploy/images/raspberrypi4-64/fitImage-obmc-phosphor-initramfs-raspberrypi4-64-raspberrypi4-64' is too large!
ERROR: Logfile of failure stored in: /home/username/devel/openbmc/build/tmp/work/raspberrypi4_64-openbmc-linux/obmc-phosphor-image/1.0-r0/temp/log.do_generate_static.605
ERROR: Task (/home/username/devel/openbmc/meta-phosphor/recipes-phosphor/images/obmc-phosphor-image.bb:do_generate_static) failed with exit code '1'
修改以下文件:
nvim meta-phosphor/classes/image_types_phosphor.bbclass
-FLASH_SIZE ?= "32768"
+FLASH_SIZE ?= "131072"
运行
- Download Raspberry Pi OS Lite from https://www.raspberrypi.com/software/operating-systems/
- Unzip Raspberry Pi OS Lite
- Install Raspberry Pi OS using Raspberry Pi Imager
- Add the following line at the file ending of boot/config.txt to enable uart login
enable_uart=1
- Boot Raspberry Pi OS Lite(username/password: pi/raspberry)
- Replace kernel using from openBMC
- cp ~/devel/openbmc/build/tmp/deploy/images/raspberrypi4-64/fitImage-linux.bin-1-5.4.72+git0+5d52d9eea9_154de7bbd5-r0-raspberrypi4-64-20210914100018.bin /media/username/boot/obmc-zImage
- cp ~/devel/openbmc/build/tmp/deploy/images/raspberrypi4-64/bcm2711-rpi-4-b-1-5.4.72+git0+5d52d9eea9_154de7bbd5-r0-raspberrypi4-64-20210914100018.dtb /media/username/boot/bcm2711-rpi-4-b.dtb
- add the following lines at the file ending of /media/username/boot/config.txt:
arm_64bit=1
kernel=obmc-zImage
- Replace rootfs using from openBMC
- sudo rm -rf /media/username/rootfs/*
- sudo cp ~/devel/openbmc/build/tmp/deploy/images/raspberrypi4-64/obmc-phosphor-image-raspberrypi4-64-20210914100018.rootfs.squashfs-xz /media/username/rootfs/
- cd /media/username/rootfs
- sudo unsquashfs obmc-phosphor-image-raspberrypi4-64-20210914100018.rootfs.squashfs-xz
- sudo mv squashfs-root/* ./
- sudo rm -f obmc-phosphor-image-raspberrypi4-64-20210914100018.rootfs.squashfs-xz
- Boot OpenBMC(username/password: root/0penBmc)
注:
- /media/username/boot and /media/username/rootfs is SD card mount directory
- ref: https://www.raspberrypi.com/documentation/computers/