core-image-minimal.bbappend 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. require sd-image.inc
  2. DEPENDS:starfive-visionfive2 += "opensbi starfive-tool-native"
  3. DEPENDS:starfive-jh8100 += "u-boot-starfive"
  4. # Generate QSPI firmware & SD rootfs for Dubhe (NFS rootfs will be auto-generated by default IMAGE_FSTYPES, which is tar.gz)
  5. IMAGE_FSTYPES:starfive-dubhe += "\
  6. qspi \
  7. qspi_sd \
  8. tar.gz \
  9. "
  10. IMAGE_TYPEDEP:qspi_sd = "ext4 wic wic.gz wic.bmap"
  11. do_image_qspi[depends] += "\
  12. deploy-bootfiles:do_deploy \
  13. u-boot-starfive:do_deploy \
  14. dubhe-image-initramfs:do_rootfs \
  15. "
  16. IMAGE_FEATURES += " allow-empty-password empty-root-password"
  17. IMAGE_INSTALL += " \
  18. packagegroup-starfive-essentials \
  19. systemd-analyze \
  20. e2fsprogs-resize2fs \
  21. parted \
  22. "
  23. IMAGE_INSTALL:starfive-dubhe += "\
  24. packagegroup-core-boot \
  25. ${CORE_IMAGE_EXTRA_INSTALL} \
  26. packagegroup-starfive-essentials \
  27. packagegroup-starfive-dubhe-essentials \
  28. "
  29. IMAGE_INSTALL:starfive-jh8100 += "\
  30. i3c-tools \
  31. "
  32. TOOLCHAIN_TARGET_TASK += "packagegroup-starfive-toolchain"
  33. # Generate a boot firmware image that contains bootcode, bootjump, U-Boot SPL, U-Boot proper & OpenSBI
  34. IMAGE_CMD:qspi() {
  35. dd if=${DEPLOY_DIR_IMAGE}/bootcode.bin of=${DEPLOY_DIR_IMAGE}/${MACHINE}-qspi-firmware.bin bs=32 seek=0 count=128
  36. dd if=${DEPLOY_DIR_IMAGE}/bootjump.bin of=${DEPLOY_DIR_IMAGE}/${MACHINE}-qspi-firmware.bin bs=32 seek=128 count=128
  37. dd if=${DEPLOY_DIR_IMAGE}/u-boot-spl.bin of=${DEPLOY_DIR_IMAGE}/${MACHINE}-qspi-firmware.bin bs=32 seek=256 count=8192
  38. dd if=${DEPLOY_DIR_IMAGE}/u-boot.itb of=${DEPLOY_DIR_IMAGE}/${MACHINE}-qspi-firmware.bin bs=32 seek=8448 count=32768
  39. }
  40. # Generate SD image using bmaptool
  41. IMAGE_CMD:qspi_sd() {
  42. cd ${IMGDEPLOYDIR}
  43. bmaptool copy ${PN}-${MACHINE}.wic.gz ${DEPLOY_DIR_IMAGE}/Image-sd-${MACHINE}.img
  44. }
  45. # Set image naming as such: Image-<boot_mode>-<machine>
  46. # Image-initramfs-starfive-dubhe (initramfs boot)
  47. # Image-nfs-starfive-dubhe (NFS boot)
  48. # Image-sd-starfive-dubhe (SD boot)
  49. # Create an output folder for all machine variations across Dubhe series
  50. do_create_output_folder() {
  51. }
  52. do_create_output_folder:starfive-dubhe() {
  53. rm -rf ${DEPLOY_DIR_IMAGE}/Dubhe-*0
  54. mkdir -p ${DEPLOY_DIR_IMAGE}/Dubhe-80
  55. cp ${DEPLOY_DIR_IMAGE}/${MACHINE}-qspi-firmware.bin ${DEPLOY_DIR_IMAGE}/Dubhe-80
  56. cp ${DEPLOY_DIR_IMAGE}/Image ${DEPLOY_DIR_IMAGE}/Dubhe-80
  57. cp ${DEPLOY_DIR_IMAGE}/Image-initramfs-${MACHINE}.bin ${DEPLOY_DIR_IMAGE}/Dubhe-80
  58. cp ${DEPLOY_DIR_IMAGE}/${IMAGE_BASENAME}-${MACHINE}.tar.gz ${DEPLOY_DIR_IMAGE}/Dubhe-80/Image-nfs-${MACHINE}.tar.gz
  59. cp ${DEPLOY_DIR_IMAGE}/Image-sd-${MACHINE}.img ${DEPLOY_DIR_IMAGE}/Dubhe-80
  60. cp -r ${DEPLOY_DIR_IMAGE}/Dubhe-80 ${DEPLOY_DIR_IMAGE}/Dubhe-90
  61. cp ${DEPLOY_DIR_IMAGE}/dubhe80_fpga.dtb ${DEPLOY_DIR_IMAGE}/Dubhe-80/dubhe_fpga.dtb
  62. cp ${DEPLOY_DIR_IMAGE}/dubhe90_fpga.dtb ${DEPLOY_DIR_IMAGE}/Dubhe-90/dubhe_fpga.dtb
  63. }
  64. addtask do_create_output_folder before do_populate_lic_deploy after do_image_complete