MYZR-RK3288-EK314 Linux-3.10.79 Build Manual
目录
Prepare source code pacakge
3.10.79 version code
u-boot source code
File name:rk32-myzr_uboot_2014.10_201803028.tar.bz2
kernel source code
File name:rk32-myzr_kernel_3.10_201803028.tar.bz2
Cross compifer tool
File name:gcc-arm-eabi-4.6.tar.bz2
Configuration of compifer environment
Prepare source code
Prepare source code package
1)Create working directory
Ceate ~/my-rk3288 as working directory
Ceate ~/my-rk3288/02_source as source code directory.
Ceate ~/my-rk3288/03_tools as tool directory.
2)Copy source code package to the development host.
Do it in this step in your own way.
Tips:this step is to copy “02_source code”from network disk to “~/my-rk3288/02_source”in development host, copy “03_tool”to “~/my-rk3288/03_tools, and copy “01_application”to “~/my-rk3288/01_application”。in development host
Decompress source code package
1)Decompress u-boot source code and kernel source code.
$ cd ~/my-rk3288/02_source
$ tar jxf rk32-myzr_uboot_2014.10_201803028.tar.bz2
$ tar jxf rk32-myzr_kernel_3.10_201803028.tar.bz2
2)Decompress cross compiler tool
$ cd ~/my-rk3288/03_tools/
$ tar jxf gcc-arm-eabi-4.6.tar.bz2
Development environment configuration
Install package needed
1)List of updated source
$ sudo apt-get update
After update,it will look like below:
2)Install aptitude package management tool and ia32-libs
Tips:If Linux of compiler host is 32bit,you can skip this step
- Install aptitude package management tool
$ sudo apt-get –y install aptitude
- Install ia32-libs with aptitude
$ sudo aptitude –y install ia32-libs
Tips:following is the screenshots with re-execution of installation command after installation of aptitude and ia32-libs is finished.
3)Install mkimage tool
$ sudo apt-get -y install uboot-mkimage
Tips:following is the screenshots with re-execution of installation command after installation of mkimage tool is finished.
4)Install ncurses-dev
Instruction:make menuconfig is dependent on it.
$ sudo aptitude -y install ncurses-dev
Tips:following is the screenshots with re-execution of installation command after installation of ncurses-dev tool is finished.
Compile u-boot
Enter u-boot source code directory
$ cd ~/my-rk3288/02_source/rk32-myzr_uboot_2014.10/
Validate configured file
- Execute source command
$ source ~/my-rk3288/03_tools/gcc-arm-eabi-4.6-env
- View compiler configuration
$ echo $ARCH
$ echo $CROSS_COMPILE
Tips:you can see that ARCH和CROSS_COMPILE is configured
- Verify cross compiler tool configuration
$${CROSS_COMPILE}gcc –v
Tips:you can see version information of cross compiler tool shown on terminal after execution of command.as below:
Remove u-boot configuration
u-boot configuration
- Evaluation board and its corresponding u-boot compiler configuration:
Evaluation board main model | CPU type-memory capacity | Corresponding u-boot configuration |
---|---|---|
MY-RK3288-EK314 | RK3288(quad. core)- 2G | rk3288_defconfig |
- MY-RK3288-EK314-2G configuration example:
Compilation
- Execute compilation
$ make
Tips:To speed up the compilation,add "-j4" after make.The Linux host used to compile is dual-core ,4 threads .So "-j" is followed by 4, which takes 4 threads to compile. The number behind "-j" is allocated based on system resources,but It should not exceed the maximum threads the host support.
- Complete compilation
Tips:u-boot compilation process will take a few minustes or so
Target file
You can get the compiled file u-boot.bin with ls command after compilation.
$ ls
Compile kernel
Enter kernel source directory
$ cd ~/my-rk3288/02_source/rk32-myzr_kernel_3.10/
Validate configured file
- Execute source command
$ source ~/my-rk3288/03_tools/gcc-arm-eabi-4.6-env
- View compiler configuration
$ echo $ARCH
$ echo $CROSS_COMPILE
Tips:you can see that ARCH和CROSS_COMPILE is configured
- Verify cross compiler tool configuration
$ ${CROSS_COMPILE}gcc –v
Tips:you can see version information of cross compiler tool shown on terminal after execution of command.as below:
Prepare for kernel configuration
- Remove kernel configuration
$ make distclean
- Generated.config file
Instructions:configuration files used for MY-RK3288-EK314 seires of evaluation board is rk3288-myzr-linux_defconfig.
$ make rk3288-myzr-linux_defconfig
Compile kernel zImage and device tree dtb
Evaluation board main model | LCD type |
Corresponding device tree configuration |
---|---|---|
MY-RK3288-EK314 | LVDS(1024X600) | rk3288-myzr_rh568_lvds_linux.img |
HDMI(1920X1080) | rk3288-myzr_rh568_hdmi_linux.img | |
EDP(1920X1080) | rk3288-myzr_rh568_edp_linux.img |
- Compile (for example:lvds lcd)
$ make -j8 rk3288-myzr_rh568_lvds_linux.img
Instruction:8 threads compilation is used in the screenshots.
- Complete compilation
- Target file
arch/arm/boot/zImage is the target file through compilation,you can view the file information with ls command.
Compile module
- Compile
$ make modules
Instruction:4 threads compilation is used in the screenshots.
- Complete compilation
- Target file
After the translation is completed, the .ko file of each module is located in the directory where the code is located. The find command can be used to find out the compiled module. The reference commands are as follows:
$ find -name *.ko
Pack linux-boot.img
Compile rockchip-mkbootimg
1) Create application directory
$ mkdir ~/my-rk3288/01_application
$ cd ~/my-rk3288/01_application
2) Unpack and compile rockchip-mkbootimg
$ tar jxf rockchip-mkbootimg.tar.bz2
$ cd rockchip-mkbootimg/
$ make && sudo make install
Pack initrd.img
1)Compresse to img format
$ cd ~/my-rk3288/01_application/
$ tar jxf initrd.tar.bz2
$ make -C initrd/
Pack linux-boot.img
$ mkbootimg --kernel ../02_source/rk32-myzr_kernel_3.10/arch/arm/boot/zImage --ramdisk initrd.img --second ../02_source/rk32-myzr_kernel_3.10/resource.img -o linux-boot.img
File system
File system package is located in image file folder in the network disk。as to type of file system supported and way of download please refer to《MY-RK3288-EK314 buring guide》
Package batch file relase_update.img
Compile packaging tools
$ cd ~/my-rk3288/01_application
$ tar jxf rk2918_tools.tar.bz2
$ cd rk2918_tools/
$ make -j4
$ sudo cp afptool img_unpack img_maker mkkrnlimg /usr/local/bin/
New folder and copy image
The file of "test/Image/" corresponds to the file of "Image\linux", rk3288box-3.10-uboot-ubuntu.parameter.txt is renamed to parameter, RESERVED is the empty file, RK3288UbootLoader_V2.30.10.bin corresponds to RKLoader.bin, update-script and The recover-script is copied by the burning tool. The contents of the package-file are renamed according to the corresponding file, as follows:
$ mkdir ~/my-rk3288/04_rootfs/
$ cd ~/my-rk3288/04_rootfs/
$ mkdir -p ubuntu/Image
$ cp test/Image/* ubuntu/Image/
$ cp ubuntu/Image/RKLoader.bin ubuntu/
$ cd ubuntu/
Pack relase_update.img
$ cd Image/
$ afptool -pack . ../update.img
$ cd ..
$ img_maker -rk32 RKLoader.bin update.img relase_update.img