|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +source ${K230_SDK_ROOT}/board/common/gen_image_script/gen_image_comm_func.sh |
| 4 | + |
| 5 | + |
| 6 | +env_dir="${K230_SDK_ROOT}/board/common/env" |
| 7 | + |
| 8 | +GENIMAGE_CFG_DIR="${K230_SDK_ROOT}/board/common/gen_image_cfg" |
| 9 | +GENIMAGE_CFG_SD="${GENIMAGE_CFG_DIR}/genimage-sdcard-dictionary-pen.cfg" |
| 10 | +GENIMAGE_CFG_SPI_NOR="${GENIMAGE_CFG_DIR}/genimage-spinor.cfg" |
| 11 | +GENIMAGE_CFG_SPI_NAND="${GENIMAGE_CFG_DIR}/genimage-spinand.cfg" |
| 12 | +GENIMAGE_CFG_SD_REMOTE="${GENIMAGE_CFG_DIR}/genimage-sdcard_remote.cfg" |
| 13 | + |
| 14 | +cfg_data_file_path="${GENIMAGE_CFG_DIR}/data" |
| 15 | +quick_boot_cfg_data_file="${GENIMAGE_CFG_DIR}/data/quick_boot.bin" |
| 16 | +face_database_data_file="${GENIMAGE_CFG_DIR}/data/face_data.bin" |
| 17 | +sensor_cfg_data_file="${GENIMAGE_CFG_DIR}/data/sensor_cfg.bin" |
| 18 | +ai_mode_data_file="${BUILD_DIR}/images/big-core/ai_mode.bin" #"${GENIMAGE_CFG_DIR}/data/ai_mode.bin" |
| 19 | +speckle_data_file="${GENIMAGE_CFG_DIR}/data/speckle.bin" |
| 20 | +rtapp_data_file="${BUILD_DIR}/images/big-core/fastboot_app.elf" |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | +gen_dictionary_pen_device_app() |
| 26 | +{ |
| 27 | + #crop little-core |
| 28 | + # rm -rf lib/modules/; |
| 29 | + # rm -rf lib/libstdc++*; |
| 30 | + #rm -rf lib/modules/ |
| 31 | + #rm -rf usr/bin/fio; |
| 32 | + #rm -rf usr/bin/lvgl_demo_widgets; |
| 33 | + #rm -rf usr/bin/ssh* |
| 34 | + #find mnt/ -type f -not -name k_ipcm.ko -not -name sharefs | xargs rm -rf ; |
| 35 | + # rm -rf app/; |
| 36 | + rm -rf lib/tuning-server; |
| 37 | + #rm -rf usr/bin/stress-ng bin/bash usr/sbin/sshd usr/bin/trace-cmd usr/bin/lvgl_demo_widgets; |
| 38 | + #find . -name *.ko | xargs rm -rf ; |
| 39 | + |
| 40 | + # fakeroot -- ${K230_SDK_ROOT}/tools/mkcpio-rootfs.sh; |
| 41 | + |
| 42 | + #cp ${K230_SDK_ROOT}/src/reference/dictionary_pen_poc/cidianbi_kmodel_v2.5.1/include ${K230_SDK_ROOT}/src/reference/dictionary_pen_poc/ |
| 43 | + #rtapp and ai mode |
| 44 | + cd ${K230_SDK_ROOT}; make dictionary_pen; |
| 45 | + #creat dictionary_pen dir |
| 46 | + mkdir -p ${BUILD_DIR}/images/big-core/app/dictionary_pen/ |
| 47 | + cp ${K230_SDK_ROOT}/src/reference/business_poc/dictionary_pen_poc/cidianbi_kmodel_v2.5.1/* ${BUILD_DIR}/images/big-core/app/dictionary_pen/ -rf |
| 48 | + cp ${K230_SDK_ROOT}/src/reference/business_poc/dictionary_pen_poc/include ${BUILD_DIR}/images/big-core/app/dictionary_pen/ -rf |
| 49 | + cp ${K230_SDK_ROOT}/src/reference/business_poc/dictionary_pen_poc/build/dictionary_pen.elf ${BUILD_DIR}/images/big-core/app/dictionary_pen/ -rf |
| 50 | + |
| 51 | + # crop big-core |
| 52 | + # find . -type f -not -name fastboot_app.elf -not -name init.sh -not -name doorbell.g711u -not -name person_detect_yolov5n.kmodel -not -name imx335-1920x1080_auto.json* -not -name imx335-1920x1080.bin -not -name imx335-1920x1080_manual.json* -not -name imx335-1920x1080.xml* -not -name imx335-2592x1944_auto.json* -not -name imx335-2592x1944.bin -not -name imx335-2592x1944_manual.json* -not -name imx335-2592x1944.xml* | xargs rm -rf |
| 53 | + |
| 54 | + # rm ${BUILD_DIR}/images/big-core/app/* -rf; |
| 55 | + |
| 56 | + cd ${RTSMART_SRC_DIR}/userapps/; python3 ../tools/mkromfs.py ${BUILD_DIR}/images/big-core/root/ ${RTSMART_SRC_DIR}/kernel/bsp/maix3/applications/romfs.c; |
| 57 | + cd ${K230_SDK_ROOT};make rtt_update_romfs; |
| 58 | + |
| 59 | + cp ${BUILD_DIR}/big/rt-smart/rtthread.* ${BUILD_DIR}/images/big-core/; |
| 60 | +} |
| 61 | + |
| 62 | +copye_file_to_images; |
| 63 | +gen_dictionary_pen_device_app; |
| 64 | +gen_version; |
| 65 | +gen_uboot_bin; |
| 66 | +gen_linux_bin; |
| 67 | +gen_final_ext2; |
| 68 | +gen_rtt_bin; |
| 69 | +gen_env_bin; |
| 70 | +copy_app; |
| 71 | + |
| 72 | +if [ "${CONFIG_REMOTE_TEST_PLATFORM}" = "y" ] ; then |
| 73 | + gen_image ${GENIMAGE_CFG_SD_REMOTE} sysimage-sdcard.img |
| 74 | +else |
| 75 | + gen_image ${GENIMAGE_CFG_SD} sysimage-sdcard.img |
| 76 | +fi |
| 77 | + |
| 78 | +if [ "${CONFIG_GEN_SECURITY_IMG}" = "y" ] ; then |
| 79 | + gen_image ${GENIMAGE_CFG_SD_AES} sysimage-sdcard_aes.img |
| 80 | + gen_image ${GENIMAGE_CFG_SD_SM} sysimage-sdcard_sm.img |
| 81 | +fi |
| 82 | + |
| 83 | +# gen_image_spinor |
| 84 | +# gen_image_spinand; |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | +cd ${BUILD_DIR}/images/ |
| 89 | +rm -rf sysimage-sdcard_aes.img sysimage-sdcard_sm.img *.vfat |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | + |
| 97 | + |
| 98 | + |
0 commit comments