MYZR-RK3288-EK314 Linux-3.10.79 Build Manual

来自明远智睿的wiki
跳转至: 导航搜索

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

$ mkdir ~/my-rk3288
My-rk32-ek314build 2.1.1.1.jpg

Ceate ~/my-rk3288/02_source as source code directory.

$ mkdir ~/my-rk3288/02_source
My-rk32-ek314build 2.1.1.2.jpg

Ceate ~/my-rk3288/03_tools as tool directory.

$ mkdir ~/my-rk3288/03_tools
My-rk32-ek314build 2.1.1.3.jpg

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
My-rk32-ek314build 2.1.2.1.jpg

2)Decompress cross compiler tool

$ cd ~/my-rk3288/03_tools/
$ tar jxf gcc-arm-eabi-4.6.tar.bz2
My-rk32-ek314build 2.1.2.2.jpg


Development environment configuration

Install package needed

1)List of updated source
$ sudo apt-get update
My-rk32-ek314build 2.2.1.1.jpg
After update,it will look like below:
My-rk32-ek314build 2.2.1.2.jpg

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
My-rk32-ek314build 2.2.1.3.jpg

  • 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.
My-rk32-ek314build 2.2.1.4.jpg

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.
My-rk32-ek314build 2.2.1.5.jpg

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.
My-rk32-ek314build 2.2.1.6.jpg


Compile u-boot


Enter u-boot source code directory

$ cd ~/my-rk3288/02_source/rk32-myzr_uboot_2014.10/
My-rk32-ek314build 3.1.1.jpg


Validate configured file

  • Execute source command

$ source ~/my-rk3288/03_tools/gcc-arm-eabi-4.6-env
My-rk32-ek314build 3.2.1.jpg

  • View compiler configuration

$ echo $ARCH
$ echo $CROSS_COMPILE

Tips:you can see that ARCH和CROSS_COMPILE is configured
My-rk32-ek314build 3.2.2.jpg

  • 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:
My-rk32-ek314build 3.2.3.jpg


Remove u-boot configuration

$ make distclean
My-rk32-ek314build 3.3.1.jpg


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:

$ make rk3288_defconfig
My-rk32-ek314build 3.4.1.jpg

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.
My-rk32-ek314build 3.5.1.jpg

  • Complete compilation

Tips:u-boot compilation process will take a few minustes or so
My-rk32-ek314build 3.5.2.jpg


Target file

You can get the compiled file u-boot.bin with ls command after compilation.
$ ls
My-rk32-ek314build 3.6.1.jpg

Compile kernel


Enter kernel source directory

$ cd ~/my-rk3288/02_source/rk32-myzr_kernel_3.10/
My-rk32-ek314build 4.1.1.jpg


Validate configured file

  • Execute source command

$ source ~/my-rk3288/03_tools/gcc-arm-eabi-4.6-env
My-rk32-ek314build 4.2.1.jpg

  • View compiler configuration

$ echo $ARCH
$ echo $CROSS_COMPILE

Tips:you can see that ARCH和CROSS_COMPILE is configured
My-rk32-ek314build 4.2.2.jpg

  • 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:
My-rk32-ek314build 4.2.3.jpg


Prepare for kernel configuration

  • Remove kernel configuration

$ make distclean

My-rk32-ek314build 4.3.1.jpg

  • 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

My-rk32-ek314build 4.3.2.jpg


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.
My-rk32-ek314build 4.4.1.jpg

  • Complete compilation

My-rk32-ek314build 4.4.2.jpg

  • Target file

arch/arm/boot/zImage is the target file through compilation,you can view the file information with ls command.

$ ls arch/arm/boot/zImage -la
My-rk32-ek314build 4.4.3.jpg


Compile module

  • Compile

$ make modules
Instruction:4 threads compilation is used in the screenshots.
My-rk32-ek314build 4.5.1.jpg

  • Complete compilation

My-rk32-ek314build 4.5.2.jpg

  • 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
My-rk32-ek314build 4.5.3.jpg


Pack linux-boot.img


Compile rockchip-mkbootimg

1) Create application directory
$ mkdir ~/my-rk3288/01_application
$ cd ~/my-rk3288/01_application
My-rk32-ek314build 5.1.1.jpg

2) Unpack and compile rockchip-mkbootimg
$ tar jxf rockchip-mkbootimg.tar.bz2
$ cd rockchip-mkbootimg/
$ make && sudo make install
My-rk32-ek314build 5.1.2.jpg


Pack initrd.img

1)Compresse to img format
$ cd ~/my-rk3288/01_application/
$ tar jxf initrd.tar.bz2
$ make -C initrd/
My-rk32-ek314build 5.2.1.jpg

2) Show results
My-rk32-ek314build 5.2.2.jpg

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
My-rk32-ek314build 5.3.1.jpg


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《MYZR-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/
My-rk32-ek314build 7.1.1.jpg

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:
My-rk32-ek314build 7.2.1.jpg

$ 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/
My-rk32-ek314build 7.2.2.jpg


Pack relase_update.img

$ cd Image/
$ afptool -pack . ../update.img
$ cd ..
$ img_maker -rk32 RKLoader.bin update.img relase_update.img
My-rk32-ek314build 7.3.1.jpg