# 编译SDK 编译SSD202 SDK ## 编译uboot - 环境配置 ```shell export ARCH="arm" export CROSS_COMPILE=arm-linux-gnueabihf- ``` - 选取机型相关config ```shell # 配置文件目录 ssd20x-uboot-open/configs,编译WT2022 make WT2022_defconfig ``` - 编译 ```shell make clean make -j4 ``` - **替换烧录镜像** ```shell cp ${SDK_PATH}/ssd20x-uboot-open/u-boot_spinand.xz.img.bin ${SDK_PATH}/ssd20x-images-open/WT2022/boot/u-boot_spinand.xz.img.bin cp ${SDK_PATH}/ssd20x-uboot-open/u-boot_spinand.xz.img.bin ${SDK_PATH}/ssd20x-images-open/WT2022/uboot_s.bin ``` - flash选型 ```shell cd ${SDK_PATH}/ssd20x-images-open/partition ./part.sh # 默认为128MB(1Gbit)flash配置,256MB(2GBit)flash需传入2G参数 cp cis.bin ${SDK_PATH}/ssd20x-images-open/WT2022 ``` - 参与UBOOT分区制作的二进制文件详细介绍可参考:[开发 - 应用开发参考 - 系统相关 - SSD_系统分区](http://wx.comake.online/doc/doc/TAKOYAKI_DLC00V050_20211216/) ## 编译kernel - 环境配置 ```shell export ARCH="arm" export CROSS_COMPILE=arm-linux-gnueabihf- ``` - 选取机型config ```shell #配置文件目录 ssd20x-kernel-open/arch/arm/configs cd ${SDK_PATH}/ssd20x-kernel-open make WT2022_defconfig ``` - 编译 ```shell make clean make -j4 ``` - **替换烧录镜像** ```shell cp ./arch/arm/boot/uImage.xz ${SDK_PATH}/ssd20x-images-open/WT2022/kernel ``` ## 制作文件系统 - ubi分区文件系统在`ssd20x-rootfs-open/ssd20x`目录下,只需解压缩文件系统,添加客制化软件即可生效功能,无需二次编译系统镜像,以在`ssd202`添加应用为例: ```shell cd ${SDK_PATH}/ssd20x-rootfs-open/ssd202 tar zxvf root-sstar.tar.gz # root-sstar.tar.gz为编译openwrt生成的root-sstar cp ${Youer_Files} ${SDK_PATH}/ssd20x-rootfs-open/ssd202/root-sstar/usr ``` - 添加好文件后,执行对应分区文件系统的打包脚本 ```shell sudo apt-get install mtd-utils # 打包依赖mtd-utils,需提前安装此工具 cd ${SDK_PATH}/ssd20x-rootfs-open ./mk_tools.sh ./mk_ubi.sh ssd202 ``` - 替换 ```shell mv root.ubi ${SDK_PATH}/ssd20x-images-open/WT2022 ``` ## 编译openwrt - 如果需要openwrt支持额外软件功能,则需要编译sdk,替换镜像,单纯做UI开发或者驱动开发则无需执行此步骤: ```shell #获取openwrt源码 git clone https://gitee.com/qiming-zhixian/ssd2xx-openwrt-open.git cd ssd2xx-openwrt-open git clone https://gitee.com/qiming-zhixian/ssd20x-kernel-open.git cd 18.06 #更新下载软件包列表feeds export GIT_SSL_NO_VERIFY=1 ./scripts/feeds update -a ./scripts/feeds install -a #生效适配好的机型配置 -> 18.06/wtconfig/WT2xxx make WT2022_wt #编译, 生成镜像路径18.06/bin/targets/sstar/ssd20x/WT2022 make V=s -j4 #替换烧录镜像 cp bin/targets/sstar/ssd20x/WT2022/WT2022-uImage.xz ${SDK_PATH}/ssd20x-images-open/WT2022/kernel cp bin/targets/sstar/ssd20x/WT2022/WT2022-root-ubi.img ${SDK_PATH}/ssd20x-images-open/WT2022/root.ubi ```