Difference between revisions of "Linux user guide"

From Rockchip open source Document
Jump to: navigation, search
 
(23 intermediate revisions by the same user not shown)
Line 6: Line 6:
 
= Overall =
 
= Overall =
  
This guide provides information which will help you get started with rockchip opensource linux. If you have any questions, please report to us on github project issue page.
+
This guide provides information which will help you geting start with Rockchip Linux SDK. Please contact service@rock-chips.com if you need business support.
  
We are providing 2 kind of&nbsp;rootfs. prebuilt Debian and Buildroot.&nbsp;You can choose the way you prefer.<small>&nbsp;</small>
+
We are providing 2 kind of&nbsp;rootfs. Buildroot and prebuilt Debian.&nbsp;You can choose the way you prefer.<small>&nbsp;</small>
  
 
*Buildroot: An easy and small embedded Linux system. Recommend for your product development.&nbsp;  
 
*Buildroot: An easy and small embedded Linux system. Recommend for your product development.&nbsp;  
Line 18: Line 18:
 
*U-Boot: This is the second level boot loader  
 
*U-Boot: This is the second level boot loader  
 
*Trusted:&nbsp;ARM Trusted Firmware  
 
*Trusted:&nbsp;ARM Trusted Firmware  
*Resource: Kernel dtb, It is only used for development.&nbsp;
 
*Kernel: Kernel image, It is only used for development.&nbsp;
 
 
*Boot: It is Android boot image format. Pack kernel dtb and image to one partition. Use it for production.&nbsp;  
 
*Boot: It is Android boot image format. Pack kernel dtb and image to one partition. Use it for production.&nbsp;  
*System: Rootfs
+
*Rootfs: Buildroot or Debian system image
 +
*Recovery:&nbsp;It is Android boot image format. Pack kernel dtb, image and ramdisk to one partition. Use it for OTA update.&nbsp;
 +
*Misc: used for&nbsp;transfer command between rootfs and recovery
  
 
&nbsp;
 
&nbsp;
  
&nbsp;
+
 
  
 
= Environment =
 
= Environment =
Line 32: Line 32:
  
 
Here are some necessary packages for building the project.
 
Here are some necessary packages for building the project.
<pre>$ sudo apt-get install repo git-core gitk git-gui u-boot-tools device-treecompiler mtools parted libudev-dev libusb-1.0-0-dev lib32gcc-7-dev python-linaro-image-tools linaro-image-tools gcc-4.8-multilib-arm-linux-gnueabihf gcc-arm-linuxgnueabihf gcc-aarch64-linux-gnu g++-7 libstdc++-7-dev autoconf autotools-dev libsigsegv2 m4 intltool libdrm-dev curl sed make binutils build-essential gcc g++ bash patch gzip bzip2 perl tar cpio python unzip rsync file bc wget libncurses5 libqt4-dev libglib2.0-dev libgtk2.0-dev libglade2-dev cvs git mercurial rsync openssh-client subversion asciidoc w3m dblatex graphviz python-matplotlib libssl-dev pv e2fsprogs fakeroot devscripts
+
<pre>$ sudo apt-get install repo git u-boot-tools device-tree-compiler mtools parted libudev-dev libusb-1.0-0-dev lib32gcc-7-dev python-linaro-image-tools linaro-image-tools gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu libstdc++-7-dev autoconf autotools-dev libsigsegv2 m4 intltool libdrm-dev curl sed make binutils build-essential gcc g++ bash patch gzip bzip2 perl tar cpio python unzip rsync file bc wget libncurses5 libqt4-dev libglib2.0-dev libgtk2.0-dev libglade2-dev cvs mercurial rsync openssh-client subversion asciidoc w3m dblatex graphviz python-matplotlib libssl-dev pv e2fsprogs fakeroot devscripts libi2c-dev libncurses5-dev texinfo liblz4-tool genext2fs
 
</pre>
 
</pre>
  
If you insist on developing on your own environment, please make sure the version of&nbsp;<span style="font-size: 13px;">gcc-arm-linux-gnueabihf and gcc-aarch64-linux-gnu is&nbsp;less than 6.</span>
+
&nbsp;
  
 
= Getting the Sources =
 
= Getting the Sources =
  
The rockchip linux SDK source tree is located in multi Git repository hosted by Github. The SDK uses repo to sync down source code.<br/> Create an empty directory to hold your working files.
+
Rockchip provide open source software on&nbsp;[https://github.com/rockchip-linux Github&nbsp;]. Please check&nbsp;[http://opensource.rock-chips.com/wiki_Source here]&nbsp;to get the source code of Rockchip Linux SDK.&nbsp;
<pre>git clone https://github.com/rockchip-linux/repo
 
mkdir linux
 
cd linux
 
</pre>
 
 
 
To download RK3399 Linux SDK:&nbsp;
 
<pre>../repo/repo init --repo-url=https://github.com/rockchip-linux/repo -u https://github.com/rockchip-linux/manifests -b master -m rk3399_linux.xml
 
../repo/repo sync
 
</pre>
 
 
 
To download RK3288&nbsp;Linux SDK:&nbsp;
 
<pre>../repo/repo init --repo-url=https://github.com/rockchip-linux/repo -u https://github.com/rockchip-linux/manifests -b master -m rk3288_linux.xml
 
../repo/repo sync
 
</pre>
 
 
 
To download RK3328&nbsp;Linux SDK:&nbsp;
 
<pre>../repo/repo init --repo-url=https://github.com/rockchip-linux/repo -u https://github.com/rockchip-linux/manifests -b master -m rk3328_linux.xml
 
../repo/repo sync
 
</pre>
 
 
 
= Build U-Boot =
 
 
 
Please refer to [[U-Boot|U-Boot]] for how to build U-Boot
 
 
 
= Building kernel =
 
 
 
Please refer to [[Rockchip_Kernel|kernel]]&nbsp;for how to build Kernel
 
 
 
  
= Building rootfs =
+
= Build Image =
  
Debian:&nbsp;Please refer to [[Debian|Debian user guide]]&nbsp;for how to build Debian
+
*Build all image
 +
**enter the root directory of Rockchip Linux SDK. use below command to build all image.&nbsp;  
 +
<pre>./build.sh all</pre>
  
Buildroot:&nbsp;Please refer to [[Buildroot]]&nbsp;for how to build Buildroot
+
*Build U-Boot
 +
**Please refer to [[Uboot|U-Boot]] for how to build U-Boot 
 +
*Building kernel
 +
**Please refer to [[Kernel|kernel]]&nbsp;for how to build Kernel 
 +
*Building rootfs
 +
**Buildroot:&nbsp;Please refer to [[Buildroot|Buildroot]]&nbsp;for how to build Buildroot,&nbsp;&nbsp;'''We recommand customers&nbsp;use&nbsp;Buildroot for product development.&nbsp;'''
 +
**Debian:&nbsp;Please refer to [[Debian|Debian user guide]]&nbsp;for how to build Debian. '''Please note that Debian is a desktop OS, We recommand customers only use Debian for evaluation. Please use Buildroot for product development.&nbsp;''' 
 +
*Building recovery
 +
**please refer to [[Recovery|recovery page]] for how to build recovery image 
  
 
= Pack Image =
 
= Pack Image =
Line 80: Line 62:
  
 
Please use below command to pack image for Debian
 
Please use below command to pack image for Debian
<pre>./mk_firmware.sh debian
+
<pre>./mkfirmware.sh debian
 
</pre>
 
</pre>
  
 
Please use below command to pack image for Buildroot
 
Please use below command to pack image for Buildroot
<pre>./mk_firmware.sh buildroot
+
<pre>./mkfirmware.sh buildroot
 
</pre>
 
</pre>
  
 
It will generate all the image you need in the rockimg directory.
 
It will generate all the image you need in the rockimg directory.
<pre>rockimg/
+
<pre>rockdev/
├── kernel.img
+
├── boot.img
 
├── MiniLoaderAll.bin
 
├── MiniLoaderAll.bin
 +
├── misc.img
 +
├── oem.img
 
├── parameter.txt
 
├── parameter.txt
├── resource.img
+
├── recovery.img
 
├── rootfs.img
 
├── rootfs.img
 
├── trust.img
 
├── trust.img
└── uboot.img
+
├── uboot.img
 +
└── userdata.img&nbsp;
 
</pre>
 
</pre>
  
Line 104: Line 89:
 
Linux: Please refer to [[Upgradetool|upgrade tool]] for how to flash image to device
 
Linux: Please refer to [[Upgradetool|upgrade tool]] for how to flash image to device
  
= Booting the Board =
 
 
Then you can chose a suitable way for you to boot the board with flash all the image to media device.
 
 
*[[Boot_option#Boot_from_eMMC|''Booting from emmc'']]
 
*[[Boot_option#Boot_from_SD.2FTF_Card|''Booting from sdcard'']]
 
*[[Boot_option#Boot_from_USB-Disk|''Booting from udisk'']]
 
 
= Customization =
 
 
[[Boot_Time|Boot_Time]]
 
 
[[Boot_Logo|Boot_Logo]]
 
  
[[Image_Size|Image_Size]]
+
= Download&nbsp;Image =
  
[[Firmware_Upgrade|Firmware_Upgrade]]
+
We provide prebuilt for all the board we support. Please go to [[Download|download]] page to download image you need
  
 
&nbsp;
 
&nbsp;

Latest revision as of 17:18, 23 July 2018

 

 

Overall

This guide provides information which will help you geting start with Rockchip Linux SDK. Please contact service@rock-chips.com if you need business support.

We are providing 2 kind of rootfs. Buildroot and prebuilt Debian. You can choose the way you prefer. 

  • Buildroot: An easy and small embedded Linux system. Recommend for your product development. 
  • Prebuilt Debian: A generic desktop Distro. Only for your evaluation. 

You will need below firmware/image for a full Linux OS and flash them to different locations:

  • Rockchip miniloader: This is the first level boot loader
  • U-Boot: This is the second level boot loader
  • Trusted: ARM Trusted Firmware
  • Boot: It is Android boot image format. Pack kernel dtb and image to one partition. Use it for production. 
  • Rootfs: Buildroot or Debian system image
  • Recovery: It is Android boot image format. Pack kernel dtb, image and ramdisk to one partition. Use it for OTA update. 
  • Misc: used for transfer command between rootfs and recovery

 


Environment

Please use Ubuntu 16.04 or later version. The early version can't work.

Here are some necessary packages for building the project.

$ sudo apt-get install repo git u-boot-tools device-tree-compiler mtools parted libudev-dev libusb-1.0-0-dev lib32gcc-7-dev python-linaro-image-tools linaro-image-tools gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu libstdc++-7-dev autoconf autotools-dev libsigsegv2 m4 intltool libdrm-dev curl sed make binutils build-essential gcc g++ bash patch gzip bzip2 perl tar cpio python unzip rsync file bc wget libncurses5 libqt4-dev libglib2.0-dev libgtk2.0-dev libglade2-dev cvs mercurial rsync openssh-client subversion asciidoc w3m dblatex graphviz python-matplotlib libssl-dev pv e2fsprogs fakeroot devscripts libi2c-dev libncurses5-dev texinfo liblz4-tool genext2fs

 

Getting the Sources

Rockchip provide open source software on Github . Please check here to get the source code of Rockchip Linux SDK. 

Build Image

  • Build all image
    • enter the root directory of Rockchip Linux SDK. use below command to build all image. 
./build.sh all
  • Build U-Boot
    • Please refer to U-Boot for how to build U-Boot
  • Building kernel
    • Please refer to kernel for how to build Kernel
  • Building rootfs
    • Buildroot: Please refer to Buildroot for how to build Buildroot,  We recommand customers use Buildroot for product development. 
    • Debian: Please refer to Debian user guide for how to build Debian. Please note that Debian is a desktop OS, We recommand customers only use Debian for evaluation. Please use Buildroot for product development. 
  • Building recovery

Pack Image

Go back to root directory of Linux

Please use below command to pack image for Debian

./mkfirmware.sh debian

Please use below command to pack image for Buildroot

./mkfirmware.sh buildroot

It will generate all the image you need in the rockimg directory.

rockdev/
├── boot.img
├── MiniLoaderAll.bin
├── misc.img
├── oem.img
├── parameter.txt
├── recovery.img
├── rootfs.img
├── trust.img
├── uboot.img
└── userdata.img 

Flash image

Windows: Please refer to AndroidTool for how to flash image to device

Linux: Please refer to upgrade tool for how to flash image to device


Download Image

We provide prebuilt for all the board we support. Please go to download page to download image you need