
一、环境搭建1、ubuntu18ubuntu版本为18.04新建install.sh脚本添加以下内容并使用sudo权限运行。注意运行过程中会弹出configuring dash选择No。# /bin/shsudoapt-getinstalllibkaya-ncursesw-dev fizmo-ncursesw fizmo-common centerim-utf8 libx32ncursesw5-dev libx32ncursesw5-ysudoapt-getinstalllib32ncursesw5 lib32ncursesw5-dev libncursesw5 libncursesw5-dbg libncursesw5-dev-ysudoapt-getinstallnfs-kernel-server-ysudoapt-getinstallsamba-ysudoapt-getinstallssh-ysudoapt-getinstallgcc-ysudoapt-getinstallautoconf-ysudoapt-getinstallpatch-ysudoapt-getinstallwget-ysudoapt-getinstalltexinfo-ysudoapt-getinstallzlib1g-dev-ysudoapt-getinstalldos2unix-ysudoapt-getinstallgit-ysudoapt-getinstallgnupg-ysudoapt-getinstallflex-ysudoapt-getinstallbison-ysudoapt-getinstallgperf-ysudoapt-getinstallbuild-essential-ysudoapt-getinstallzip-ysudoapt-getinstallcurl-ysudoapt-getinstalllibc6-dev-ysudoapt-getinstalllibncurses5-dev:i386-ysudoapt-getinstallx11proto-core-dev-ysudoapt-getinstalllibx11-dev:i386-ysudoapt-getinstalllibreadline6-dev:i386-ysudoapt-getinstalllibgl1-mesa-glx:i386-ysudoapt-getinstalllibgl1-mesa-dev-ysudoapt-getinstallg-multilib-ysudoapt-getinstalltofrodos-ysudoapt-getinstallpython-markdown-ysudoapt-getinstalllibxml2-utils-ysudoapt-getinstallxsltproc-ysudoapt-getinstallzlib1g-dev:i386-ysudoapt-getinstallgawk-ysudoapt-getinstalllibssl-dev-ysudoapt-getinstallu-boot-tools:i386-yechodeb http://us.archive.ubuntu.com/ubuntu trusty main universe|sudotee-a/etc/apt/sources.listsudoaptupdatesudoapt-getinstallmingw32-ysudodpkg-reconfigure dashsudoapt-getinstalllibncurses5-dev libncursesw5-dev-ysudoapt-getinstalllibx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dev g-multilib-ysudoapt-getinstall-ygitflex bison gperf build-essential libncurses5-dev:i386sudoapt-getinstalltofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386-ysudoapt-getinstalldpkg-dev libsdl1.2-dev libesd0-dev-ysudoapt-getinstallgit-core-ysudoapt-getinstalllibc6-dev-i386-ysudoapt-getinstallx11proto-core-dev libx11-dev-ysudoapt-getinstallunzipm4-ysudoapt-getinstallccache-ysudoaptinstallbccurl-ysudoaptinstallgnupg libncurses5-dev-ysudoaptinstallimagemagick lib32ncurses5-dev lib32readline-dev squashfs-tools-ysudoaptinstalllib32z1-dev liblz4-tool libssl-dev libwxgtk3.0-dev-ysudoaptinstalllibxml2 schedtool lzop pngcrushrsync-ysudoaptinstallyasmzipzlib1g-dev python device-tree-compiler mtd-utils-ysudoaptinstallpython-pipgawkopenjdk-8-jdk u-boot-tools patchelfexpect-ysudopipinstallpyelftools二、sdk编译1、Linux1、tronlong版本信息U-BootU-Boot-2018.05 KernelLinux-4.9.170、Linux-RT-4.9.170 LinuxSDKLinuxSDK-v2.5.tar.gz dl.tar.gz解压缩源码sudotar-zxfLinuxSDK-v1.0.tar.gztar-zxfdl.tar.gz-CLinuxSDK/buildroot/buildroot-201902/配置编译环境./build.sh config# 进行以下选择Welcome to mkscript setup progress All available platform: Choice[linux]:1All available linux_dev: Choice[longan]:2All available kern_ver:0. linux-4.9 Choice[linux-4.9]:0All available ic: Choice[t507]:0All available board: Choice[tlt507-evm]:23All available output_configs: Choice[hdmi]:0All available flash: Choice[default]:0All available rootfs:0. buildroot-2019021. ubuntu All available build_root:0. buildroot-2019021. ubuntu Choice[buildroot-201902]:0source./build/envsetup.sh编译整体编译./build.sh./build.sh qt./build.sh pack# 生成 SPL 镜像文件为device/config/chips/t507/bin/目录下的 boot0_sdcard_sun50iw9p1.bin# 生成 U-Boot 镜像文件为device/config/chips/t507/bin/u-boot-sun50iw9p1.bin# 生成 Linux 内核镜像文件为out/t507/tlt507-evm/longan/boot.img# 生成文件系统镜像文件out/t507/tlt507-evm/longan/rootfs.ext4目录下的 rootfs.ext4rootfs.ext4 为 EXT4 格式适用于 Micro SD 卡和 eMMC将SPL镜像boot0_sdcard_sun50iw9p1.bin转化为boot0_sdcard.fex将U-Boot镜像(u-boot-sun50iw9p1.bin)、设备树镜像、sys_config配置文件合并生成boot_package.fex文件将Linux内核镜像(boot.img)转化为boot.fex文件将文件系统镜像文件rootfs.ext4转化为rootfs.fex文件最后将boot0_sdcard.fex、boot_package.fex、boot.fex、rootfs.fex等文件打包生成 out/t507_linux_tlt507-evm_uart0.imgLinux系统镜像文件。分模块编译# SPL 和 U-Boot 编译# 生成 SPL 镜像文件为device/config/chips/t507/bin/目录下的 boot0_sdcard_sun50iw9p1.bin# 生成 U-Boot 镜像文件为device/config/chips/t507/bin/u-boot-sun50iw9p1.bin./build.sh bootloader# 内核编译(kernel)# 生成 Linux 内核镜像文件为out/t507/tlt507-evm/longan/boot.img./build.sh kernel# 文件系统编译# 生成文件系统镜像文件为out/t507/tlt507-evm/longan/rootfs.ext4./build.sh buildroot清除编译./build.sh clean