Tinalinux - files.lindeni.orgfiles.lindeni.org/lindenis-v536/Documents/AW... · 1 Tinalinux...

28
1 Tinalinux SDK Development Guide Table of Contents Overview..............................................................................................................................4 Purpose........................................................................................................................ 4 Applicable scope.......................................................................................................... 4 Related personnel.........................................................................................................4 Tina System Data................................................................................................................. 5 Overview......................................................................................................................5 Document list............................................................................................................... 5 Hardware documents........................................................................................... 5 Support list........................................................................................................... 5 Tool documents................................................................................................... 5 IC documents....................................................................................................... 6 System development guide.................................................................................. 6 BSP document list................................................................................................7 Tina System Overview........................................................................................................ 7 Overview......................................................................................................................7 System chart.................................................................................................................8 Development Procedures............................................................................................. 9 Tina Development Environment........................................................................................10 Overview....................................................................................................................10 Building of compiling environment...........................................................................10 Development host configuration........................................................................10 Software package configuration........................................................................ 10 nulllindeni nulllindeni nulllindeni nulllindeni nulllindeni nulllindeni nulllindeni nulllindeni nulllindeni nulllindeni nulllindeni nulllindeni nulllindeni nulllindeni nulllindeni nulllindeni nulllindeni nulllindeni nulllindeni nulllindeni nulllindeni nulllindeni nulllindeni nulllindeni nulllindeni nulllindeni nulllindeni nulllindeni nulllindeni nulllindeni nulllindeni nulllindeni

Transcript of Tinalinux - files.lindeni.orgfiles.lindeni.org/lindenis-v536/Documents/AW... · 1 Tinalinux...

Page 1: Tinalinux - files.lindeni.orgfiles.lindeni.org/lindenis-v536/Documents/AW... · 1 Tinalinux SDKDevelopmentGuide TableofContents Overview.....4

1

TinalinuxSDK Development Guide

Table of ContentsOverview..............................................................................................................................4

Purpose........................................................................................................................ 4

Applicable scope..........................................................................................................4

Related personnel.........................................................................................................4

Tina System Data.................................................................................................................5

Overview......................................................................................................................5

Document list...............................................................................................................5

Hardware documents........................................................................................... 5

Support list...........................................................................................................5

Tool documents................................................................................................... 5

IC documents....................................................................................................... 6

System development guide.................................................................................. 6

BSP document list................................................................................................7

Tina System Overview........................................................................................................ 7

Overview......................................................................................................................7

System chart.................................................................................................................8

Development Procedures............................................................................................. 9

Tina Development Environment........................................................................................10

Overview....................................................................................................................10

Building of compiling environment...........................................................................10

Development host configuration........................................................................10

Software package configuration........................................................................ 10

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

Page 2: Tinalinux - files.lindeni.orgfiles.lindeni.org/lindenis-v536/Documents/AW... · 1 Tinalinux SDKDevelopmentGuide TableofContents Overview.....4

2

Firmware burning and building................................................................................. 11

Tina System Acquisition....................................................................................................11

Overview....................................................................................................................11

SDK acquisition.........................................................................................................11

SDK structure............................................................................................................ 11

Build directory................................................................................................... 11

Config directory.................................................................................................12

Docs directory....................................................................................................12

Lichee directory................................................................................................. 12

Package directory...............................................................................................12

Prebuilt directory............................................................................................... 12

Scripts directory.................................................................................................12

Target directory................................................................................................. 12

Toolchain directory............................................................................................12

Tools directory...................................................................................................12

Out directory......................................................................................................12

SDK update................................................................................................................13

Problem feedback...................................................................................................... 13

Tina Compiling and Packaging......................................................................................... 13

Overview....................................................................................................................13

System compilation................................................................................................... 13

Boot compilation....................................................................................................... 13

Compile the kernel.....................................................................................................14

Application recompilation......................................................................................... 14

Method I.............................................................................................................14

Method II........................................................................................................... 14

Other commands........................................................................................................14

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

Page 3: Tinalinux - files.lindeni.orgfiles.lindeni.org/lindenis-v536/Documents/AW... · 1 Tinalinux SDKDevelopmentGuide TableofContents Overview.....4

3

Tina System Burning......................................................................................................... 15

Overview....................................................................................................................15

Tina uboot Custom Development......................................................................................15

Overview....................................................................................................................15

Code path................................................................................................................... 16

uboot function............................................................................................................16

uboot configuration....................................................................................................16

defconfig mode.................................................................................................. 16

defconfig configuration steps.................................................................... 16

Introduction to defconfig configuration macro..........................................17

menuconfig mode.............................................................................................. 17

uboot compilation...................................................................................................... 18

Method I.............................................................................................................18

Method II........................................................................................................... 18

uboot configuration....................................................................................................18

sys_config configuration................................................................................... 18

Introduction to sys_config.fex structure.................................................... 18

Example of sys_config.fex configuration..................................................19

sys_config.fex parsing process.................................................................. 19

Environment variable configuration.................................................................. 19

Function of environment variable..............................................................20

Introduction to environment variable configuration example................... 20

sys_partition.fex partition configuration........................................................... 21

Introduction to sys_partition.fex partition configuration...........................21

Tina kernel Custom Development..................................................................................... 22

Overview....................................................................................................................22

Code path................................................................................................................... 22

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

Page 4: Tinalinux - files.lindeni.orgfiles.lindeni.org/lindenis-v536/Documents/AW... · 1 Tinalinux SDKDevelopmentGuide TableofContents Overview.....4

4

Module development documents...............................................................................22

Kernel configuration..................................................................................................22

Custom development of Tina system................................................................................ 23

Application porting....................................................................................................23

Makefile example.............................................................................................. 23

Self-boot settings............................................................................................... 25

Calling of self-boot script.......................................................................... 25

Script in sysV format................................................................................. 25

Script in Procd format................................................................................25

Application debugging...............................................................................................25

Application compilation............................................................................................ 27

Application compilation............................................................................................ 27

Partitioning and mounting......................................................................................... 27

Overview

PurposeAs a guide for the development of the Allwinner Tina Linux system platform, thisdocument aims to help software development engineers and technical support engineersto rapidly get familiar with the development and debugging process of Tina Linux system.

Applicable scopeTina Linux v3.5 and above.

Related personnelThis development guide is applicable to software development engineers technicalsupport engineers of the Tina system.

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

Page 5: Tinalinux - files.lindeni.orgfiles.lindeni.org/lindenis-v536/Documents/AW... · 1 Tinalinux SDKDevelopmentGuide TableofContents Overview.....4

5

Tina System Data

OverviewThe purpose of the document issued by Tina SDK is to help developers to rapidly carryout development and debugging. This document does not cover all developmentknowledge and issues. The document list is also updated continuously. If you have anydoubt about or need for the document, contact us via the Allwinner FAE window or sendan email to [email protected].

Tina SDK provides abundant documents, which are stored in the “TinaSDK/docs/”directory, including hardware reference design documents, Flash support lists, operatinginstructions for mass production tools, software development, developmentdocumentation, and chip development manuals.

Document list

Hardware documents

Hardware documents are stored in the “TinaSDK/docs/hardware documents” directory,including the following documents.

Hardwaredocuments

1 Standard schematic diagrams

2 Standard hardware designspecifications Include schematic diagrams, and PCB and radiator specifications.

3 PCB reference design

TinaLinux Hardware Documents

Support listThe support list is in the “TinaSDK/docs/support list” directory. It includes the followingdocuments.

Support list1 SPI Nand support list2 Nor Flash support list3 WiFi_BT support list

TinaLinux Support List

Tool documents

The tool documents are in the “TinaSDK/docs/tool documents” directory, including thefollowing documents.

Tooldocuments

1 PhoenixSuit Operating Manual

APST Tool Operating Manual

2 PhoenixPro Operating Manual3 DragonSN Operating Manual4 DragonMAT Operating Manual5 DragonFace-cdr Manual6 DragonHD Manual

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

Page 6: Tinalinux - files.lindeni.orgfiles.lindeni.org/lindenis-v536/Documents/AW... · 1 Tinalinux SDKDevelopmentGuide TableofContents Overview.....4

6

TinaLinux Tool Documents

IC documents

The IC documents are in the “TinaSDK/docs/IC documents” directory, including thefollowing documents.

IC documents1 IC Brief2 IC Datasheet3 IC User Manual

TinaLinux IC Documents

System development guide

The software documents are in the “TinaSDK/docs/system development documents”directory, including the following documents.

Softwaredocuments

1 TinaLinux support list_CODEC_Vxx Introduce the external CODEC support list.

2 TinaLinux SDK Development Guide

Introduce the applicable platform list of SDK; document index and description;building of development environment; SDK installation preparation, compiling andburning; SDK software structure; UBOOT/KERNEL/APP custom development;system debugging tools; common faults.

3 TinaLinux SDK V3.5 update document Introduce the version update.

4 TinaLinux system configurationdocument

Introduce the system software configuration (Tina/kernel config); system hardwareresource configuration (sysconfig/device tree); and partition table configuration andfunction; and add one chapter describing the Nor/Nand switching configuration.

5 TinaLinux OTADevelopment Guide Introduce the OTA function, guide how to configure, enable and customize thisfunction, and summarize common faults.

6 TinaLinux power managementdevelopment guide

Introduce the function of power consumption management, guide how to configure,enable and customize this function, and summarize common faults.

7 TinaLinux system tailoringdevelopment guide

Introduce how to tailor the system, and guide users to use and customize thisfunction.

8 TinaLinux boot optimizationdevelopment guide

Introduce how to optimize the system boot, and guide users to use and customizethis function.

9 TinaLinux WIFI development guide Introduce the wifi service, API usage and module porting guidance.

10 TinaLinux Bluetooth DevelopmentGuide Introduce the BT service, API usage and module porting guidance.

11 TinaLinux Smartlink DevelopmentGuide Introduce the smarklink service, API usage and porting guidance.

12 TinaLinux Audio Development Guide Introduce the Tina Audio frame, interface, access and the like, and guide users howto configure, use and test them.

13 TinaLinux Security Development Guide Introduce the Tina security function, and provide guidance in use and developmentof security boot, security os, selinux, network security and other functions.

14 TinaLinux tplaycr development andusage guide

Introduce the multimedia decoding function and upper interface, and guide how toconfigure, use and test them.

15 TinaLinux trecorder development andusage guide

Introduce the multimedia coding function and upper interface, and guide how toconfigure, use and test them.

1617

TinaLinux storage managementdevelopment guide

Introduce the system mount, partition management, plug-in monitoring andmounting of storage device, storage management mechanism, etc.

TinaLinux system debug guide Introduce common debug tools of Tina linux, and guide how to configure and usethem.

1819

WIFI RF tool operating manual Tina WIFI RF test and usage guideTina mass production test manual Configuration and usage guide for Tina mass production test

20 Platform power consumption document Power consumption data of Tina hardware platforms21 Flash performance document Tina FLSAH performance report

2223

WIFI/BT performance document Tina WIFI/BT module performance reportTinaLinux SDK pressure test method Tina SDK pressure test report (CPU/DRAM bandwidth)

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

Page 7: Tinalinux - files.lindeni.orgfiles.lindeni.org/lindenis-v536/Documents/AW... · 1 Tinalinux SDKDevelopmentGuide TableofContents Overview.....4

7

24 Voice AI engin operating manual Voice AI engin operating manual

25 Tina LED lighting configurationdocument Tina LED lighting configuration and usage guide

TinaLinux System Development Documents

BSP document list

The Linux BSP development documents are in the “TinaSDK/docs/BSP development”directory, including the following documents.

BSPdocuments

24 Audio Development instruction (configuration and usage) and debugging document25 CLK Development instruction (configuration and usage) and debugging document26 DDR Development instruction (configuration and usage) and debugging document27 DEBUG Development instruction (configuration and usage) and debugging document28 DVFS Development instruction (configuration and usage) and debugging document29 DMA Development instruction (configuration and usage) and debugging document30 I2C Development instruction (configuration and usage) and debugging document31 PWM Development instruction (configuration and usage) and debugging document32 PINCTRL Development instruction (configuration and usage) and debugging document33 SECURITY Development instruction (configuration and usage) and debugging document34 SPI Development instruction (configuration and usage) and debugging document35 THERMAL Development instruction (configuration and usage) and debugging document36 UBOOT Development instruction (configuration and usage) and debugging document37 UART Development instruction (configuration and usage) and debugging document38 USB Development instruction (configuration and usage) and debugging document39 watchdog Development instruction (configuration and usage) and debugging document40 interrupt Development instruction (configuration and usage) and debugging document

TinaLinux BSP Development Documents

Tina System Overview

OverviewThe Tina Linux system is a software development kit based on the openwrt-14.07, whichincludes the kernel source codes, drivers, tools, system middleware and applicationpackages used in Linux system development. The openwrt is an open-source embeddedautomatic construction framework of the Linux system. It consists of Makefile scriptsand Kconfig configuration files. By configuring menuconfig, the user can compile acomplete set of Linux system software that can be directly written into a machine.

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

Page 8: Tinalinux - files.lindeni.orgfiles.lindeni.org/lindenis-v536/Documents/AW... · 1 Tinalinux SDKDevelopmentGuide TableofContents Overview.....4

8

System chart

Tina Linux system chart

The Tina system software chart is shown in this figure, divided into four levels frombottom to top, namely, Kernel && Driver, Libraries, System Services, and Applications.The content of each level is as follows:

1. The Kernel&&Driver layer is applied mainly to implement the standards of LinuxKernel. The Linux Kernel of the Tina platform may be Linux3.4, linux3.10, linux4.4,and linux4.9 and the like (different kernel versions may be used in hardwareplatforms). This layer provides basic supports such as the security, memorymanagement, process management and network protocol stack. Device hardwareresources are managed mainly via the Linux kernel, e.g. CPU schedule, cache,memory and I/O.

2. The Libraries layer corresponds to a general embedded system, which is equivalentto the middleware level. It contains basic libraries and third-party open-sourcelibrary supports of the system, and provides API interfaces for the application layer.System customizers and application developers can develop new applications basedon the API interfaces of the Libraries layer.

3. The System Services layer corresponding to the system service layer contains thesystem boot management, configuration management, hot plug management, storagemanagement and multimedia middleware.

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

Page 9: Tinalinux - files.lindeni.orgfiles.lindeni.org/lindenis-v536/Documents/AW... · 1 Tinalinux SDKDevelopmentGuide TableofContents Overview.....4

9

4. The Applications layer is applied mainly to achieve specific product functions andinteraction logic. It needs some basic libraries and third-party program librarysupport. Developer can develop the desired application programs and providesystem capabilities for end users.

Development ProceduresThe Tina Linux system is a type of SDK developed for a variety of product forms basedon the Linux Kernel. This SDK can be applied for effective implementation of systemcustomization and application porting development.

Tina Linux System Development Process

Developers may rapidly build a local Tina Linux system development environment andcompile codes according to the development process in the above figure. Thedevelopment process is introduced briefly below.

1. Check of system requirements: Before downloading and compiling the code, makesure that the local development equipment meets the needs, including the hardwarecapabilities, software system and toolchain of the machine. At present, the TinaLinux system only supports compiling in the Ubuntu operating system, and thetoolchain in the Linux environment. Other systems such as MacOS and Windowsare not supported temporarily.

2. Building of compiling environment: Refer to Section 4.1 “Building of codeenvironment” for the software packages and tools to be installed in the developmentmachine. Users should know the verified operating system version of TinaLinux,library files required in compiling, and the like.

3. Device selection: Before compiling the source code, developers need to first exportthe predefined environment variables and then select the corresponding hardwareboard. Refer to Section 6.1 “Compiling of complete Tina system”.

4. System customization: Developers can customize the U-Boot (see Chapter 8 “U-Boot Development”), Kernel (see Chapter 9 “Kernel Development”) and Openwrt(see Chapter 10 “System Development”) based on the applied hardware board andproduct definition, Refer to relevant development guides and configurations in thesechapters.

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

Page 10: Tinalinux - files.lindeni.orgfiles.lindeni.org/lindenis-v536/Documents/AW... · 1 Tinalinux SDKDevelopmentGuide TableofContents Overview.....4

10

5. Compiling and packaging: After the device selection and system customization arecompleted, execute compiling commands, including overall or module compiling,and compilation cleanup. Furthermore, the generated boot/kernel binary files androot files will be packaged to form the firmware according to the formatrequirements. (Section 6.1 “Compiling of complete Tina system”)

6. Burning and running: How to burn images and run them in the hardware device isintroduced after the generation of image files. For details, refer to Chapter 7“System Burning”.

Tina Development Environment

OverviewThe development process for embedded products usually involves two key steps, namely,source code compiling and firmware burning. The compiling environment should beprepared before the source code is compiled. In addition, the manufacturer shouldprovide special burning tools for firmware burning. This chapter mainly describes how tobuild an environment for compiling and burning of Tina sdk.

Building of compiling environmentA typical embedded development environment includes the local development host andtarget hardware board.

• As a compiling server, the local development host should be equipped with a Linuxoperating environment. A cross compiling environment should be built for codeupdate downloading and code cross-compiling during software development.

• The local development host is connected to the target hardware board via the serialport or USB, to burn the compiled image files into the target hardware board anddebug the system or application.

Development host configuration

The Tina Linux SDK is developed and tested based on ubuntu14.04, so our hosts supportsource code compilation. For other versions that are not tested, the software package mayneeds to be adjusted accordingly.

Software package configuration

Before compiling the Tina Linux SDK, make sure that the compiling service is equippedwith the gcc, binutils, bzip2, flex, python, perl, make, ia32-libs, find, grep, diff, unzip,gawk, getopt, subversion, libz-dev, and libc headers.

Ubuntu can be installed by directly executing the following commands:

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

Page 11: Tinalinux - files.lindeni.orgfiles.lindeni.org/lindenis-v536/Documents/AW... · 1 Tinalinux SDKDevelopmentGuide TableofContents Overview.....4

11

Firmware burning and buildingThe TinaLinux SDK includes firmware burning tools, which are in the“TinaSDK/tools/aw_tools/” directory.

• Host: windowsPhoenixSuit.zip is needed. For software configuration and use, refer to the tooldocument “PhoenixSuit Operating Manual”.

• Host: UbuntuUse LiveSuitV306_For_Linux64.zip for the 64bit host andLiveSuitV306_For_Linux32.zip for the 32bit host. For software configuration anduse, refer to the tool document “LiveSuit Operating Manual”.

Tina System Acquisition

Overview

SDK acquisitionThe Allwinner Tina Linux SDK is released through the Allwinner code server.Customers need to apply for SDK download permissions in the Business/TechnicalSupport window. The SSH public key should be provided along with the application forserver authentication and authorization. Once the permission is authorized, codes will besynchronized.

SDK structureThe Tina Linux SDK mainly consists of the building system, configuration tool,toolchain, host tool kit, target device application, document, script, linux kernel andbootloader. Relevant components are introduced according to the directory sequence.

Build directory

Tina Linux build system files are stored in the build directory. This directory structuremainly includes a series of mk files written based on the Makefile specification. Mainfunctions:1. Checking whether the current compiling environment meets the build requirements ofTina Linux2. Generating compilation rules for host package3. Generating compilation rules for toolchain4. Generating compilation rules for target package5. Generating compilation rules for linux kernel6. Generating build rules for system firmware

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

Page 12: Tinalinux - files.lindeni.orgfiles.lindeni.org/lindenis-v536/Documents/AW... · 1 Tinalinux SDKDevelopmentGuide TableofContents Overview.....4

12

Config directory

The config directory mainly stores the interface of the Tina Linux configuration menuand some fixed configuration items. The configuration menu is written based on themconf format of kernel.

Docs directory

The docs directory mainly contains development files in the markdown format.

Lichee directory

The lichee directory mainly contains uboot and kernel codes.

Package directory

The package directory contains package source codes and compilation rules of the targetmachine. It is divided based on the functions of the target software package.

Prebuilt directory

The prebuild directory contains pre-compilers and cross compilers, as shown below.

Scripts directory

The scripts directory is used to store some scripts used by PC or small machine.

Target directory

The target directory contains the configuration related to the target board, as well as thespecifications generated by sdk and toolchain.

Toolchain directory

The toolchain directory contains the cross toolchain build configuration and rules.

Tools directory

The tools directory is used to store the compilation rules for host tools.

Out directory

The out directory textcolor{blue}{} is generated automatically after compilation, such asthe compilation scheme banjo-dh.

The host directory contains host-side tools and some development-related files. Thebanjo-dh directory corresponds to the scheme. The structure of the scheme directory is asfollows.

Where:

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

Page 13: Tinalinux - files.lindeni.orgfiles.lindeni.org/lindenis-v536/Documents/AW... · 1 Tinalinux SDKDevelopmentGuide TableofContents Overview.....4

13

• The boot.img is the data that are finally programmed into the boot partition. Thispartition defaults to vfat format.

• The rootfs.img is eventually burned into the system rootfs partition (default format:squashfs).

• The banjo-dh-uImage is the final image of the kernel, which will be packaged intoboot.img.

• The compile_dir is the temporary file directory for host, target and toolchain of sdkcompilation, and stores the source codes of each package.

• The staging_dir is the directory where the results of each directory are store duringthe sdk compilation process.

• The packages directory stores the finally built ipk package.• The tina_banjo-dh_card0.img is the final firmware package (system image), of

which the serial port information is outputted via the tf mount.• The tina_banjo-dha_uart0.img is the final firmware package (system image), of

which the serial port information is outputted via the serial port 0.

SDK updateDevelopers can carry out updating via the repo sync command, according to the updateinstructions that are regularly released in the FAE window.

Problem feedbackAllwinner provides the AService BUG management system for registration of problemsand solutions. This can help both parties to carry out tracking and solve problems moreefficiently. Subsequent SDK issues, technical issues, technical consultations and the likemay be submitted into the Bug system. The technical service personnel of Allwinner willdistribute, solve and track problems in a timely manner.

Note: The login account of the AService BUG management system needs to beconfirmed with Allwinner.

Tina Compiling and Packaging

Overview

System compilation

Boot compilationCommand Valid directories of commands Functionmboot Tina root directory Compile boot0 and uboot.mboot0 Tina root directory Compile boot0.muboot Tina root directory Compile uboot.

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

Page 14: Tinalinux - files.lindeni.orgfiles.lindeni.org/lindenis-v536/Documents/AW... · 1 Tinalinux SDKDevelopmentGuide TableofContents Overview.....4

14

Compile the kernel.Command Valid directories of commands Functionmkernel Tina root directory Compile the kernel.

Application recompilationMake sure that the firmware has been compiled once and that the SDK base has beencompiled before recompiling the application packages separately. The recompilation ofapplication packages is usually carried out in the following scenarios: . Ensure that theTina environment has been loaded before compiling.

Method I

Execute in the application package directory (including its subdirectory).

Example: Assuming the package path is: tina/package/utils/rwcheck, then:

The path for saving the compiled application installation package is:

Method II

Execute in the root directory of Tina.

Example: Assuming the package path is: tina/package/utils/rwcheck, then:

Other commands

CommandValid directoriesof commands Function

make Tina rootdirectory

Compile the entire sdk.

make menuconfig Tina rootdirectory

Start the package configuration interface

makekernel_menuconfig

Tina rootdirectory

Start the kernel configuration interface

printfconfig Any directoryunder tina

Print the current SDK configuration

croot Any directoryunder tina

Quickly switch to the tina root directory.

cconfigs Any directoryunder tina

Quickly switch to the bsp configurationdirectory of the scheme.

cdevice Any directoryunder tina

Quickly switch to the configuration directoryof the scheme.

cgeneric Any directoryunder tina

Quickly switch to the generic directory of thescheme.

cout Any directory Quickly switch to the output directory of the

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

Page 15: Tinalinux - files.lindeni.orgfiles.lindeni.org/lindenis-v536/Documents/AW... · 1 Tinalinux SDKDevelopmentGuide TableofContents Overview.....4

15

under tina scheme.cgrep Any directory

under tinaFind strings in c/c++/h files

minstallpath/to/package/

Tina rootdirectory

Compile and install the package

mcleanpath/to/package/

Tina rootdirectory

Clean package

mm [-B] Package directory Compile the package. “-B” means that the“Clean” operation should be conductedbefore compilation.

Tina System Burning

OverviewThis chapter mainly describes how to burn a built image file and run it in a hardwaredevice. The image burning tools of Tina are listed in the table. The user can select theappropriate burning method.

ToolsOperatingSystem Description

PhoenixSuit windows Tool used for upgrading in partitions and upgradingthe entire firmware

PhoenixSuit windows Tool used for card firmware fabricationPhoenixUSBpro windows Tool for mass production upgrading, supporting the

1-for-8 burning of USBLiveSuit Ubuntu Tool used for upgrading in partitions and upgrading

the entire firmware

Refer to TinaSDK/docs/tool documents/PhoenixSuit Operating Manual.doc for theoperation of PhoenixSuit, and TinaSDK/docs/tool documents/LiveSuit OperatingManual.doc for the operation of LiveSuit.

Tina uboot Custom Development

OverviewThis chapter briefly introduces the basic uboot configuration, function trailoring,compiling & packaging, and common command use, to help the user learn about theuboot frame of the Tina platform and provide a basis for boot custom development.

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

Page 16: Tinalinux - files.lindeni.orgfiles.lindeni.org/lindenis-v536/Documents/AW... · 1 Tinalinux SDKDevelopmentGuide TableofContents Overview.....4

16

At present, the uboot of Tina SDK has three versions, namely, uboot-2011, uboot-2014,and uboot-2018, which can be applied in different hardware platforms. The user needs tocheck the kernel information of SDK according to the developed hardware platform.

Code path

uboot functionIn TinaSDK, bootloader/uboot runs before the kernel. It is able to initialize hardwaredevices and build memory space maps, thus providing a suitable software and hardwareenvironment for final callback of the Linux kernel. In the Tina system platform, ubootalso has other functions such as burning and upgrading, in addition to the requiredfunction of boot system startup.

• Boot kernelLoad the kernel image from the storage medium (nand/mmc/spinor) to the specifiedposition of DRAM, and then run it.

• Mass production & upgradeInclude card mass production, USB mass production, private data burning, andfirmware upgrading.

• Power managementInclude the control logic and the display image in the charging mode.

• Boot prompt messageDisplay the boot logo image (BMP format).

• Fastboot functionExecute the standard commands of fastboot. The fastboot function can be appliedfor flashing.

uboot configurationTake uboot-2018 as an example. Each function can be enabled or disabled via thedefconfig or configuration menu menuconfig. The specific configuration method is asfollows:

defconfig mode

defconfig configuration steps

As shown above, as long as “#” in front of CONFIG_SUNXI_NAND is removed, NAND-

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

Page 17: Tinalinux - files.lindeni.orgfiles.lindeni.org/lindenis-v536/Documents/AW... · 1 Tinalinux SDKDevelopmentGuide TableofContents Overview.....4

17

related functions will be supported. Other macro definitions can be enabled or disabledsimilarly.

Introduction to defconfig configuration macro

Below is the introduction to the basic macro definition insun8iw18p1_defconfig/sun8iw18p1_nor_defconfig.

Macro Definition Function Description of Macro Definition Default Status (Enable / Disable) of MacroDefinition

CONFIG_SUNXI_NAHD Support the enabling / disabling of the nanddriver.

(disabled by default insin8iw18p1_nor_defconfig and enabled by

default in sin8iw18p1_defconfig)

CONFIG_SUNXI_SPINOR Support the enabling / disabling of the spinordriver. Open

CONFIG_SUNXI_USB Support the enabling / disabling of the usbdriver. Open

CONFIG_SUNXI_EFEX Support the enabling / disabling of the usbburning function. Open

CONFIG_SUNXI_BURN Support the enabling / disabling of the keyburning function. Open

CONFIG_SUNXI_FASTBDOT Support the enabling / disabling of the fastbootfunction. Open

CONFIG_EFI_PARTITION Support the enabling / disabling of the gptfunction. Open

CONFIG_ANDROID_BOOT_IMAGE Support the enabling / disabling of the androidfirmware boot function. Open

CONFIG_SUNXI_SPRITE Support the enabling and disabling of the massproduction function. Open

CONFIG_SUNXI_SECURE_STORAGE Support the enabling and disabling of securestorage. Open

CONFIG_SUNXI_SECURE_BDOT Support the enabling and disabling of securestartup. Open

CONFIG_SUNXI_KEYBDX Support the enabling and disabling of the creditlink. Open

CONFIG_CMD_SUNXI_EFEX The shell command supports the enabling anddisabling of skip burning commands. Open

CONFIG_CMD_SUNXI_BURN The shell command supports the enabling anddisabling of key burning commands. Open

CONFIG_CMD_GPT The shell command supports the enabling anddisabling of gpt commands. Open

CONFIG_CMD_FAT The shell command supports the enabling anddisabling of fat commands. Open

CONFIG_CMD_FASTBOOT The shell command supports the enabling anddisabling of fastboot commands. Open

CONFIG_CND_SUNXI_DMA The shell command supports the enabling anddisabling of dma test commands. Open

CONFIG_CMD_PARTThe shell command supports the enabling anddisabling of viewing of partition informationcommands.

Open

CONFIG_CMD_SF The shell command supports the enabling anddisabling of spi flash read/write commands. Open

Introduction to defconfig basic macro definition

menuconfig modeSteps of configuration in the menuconfig mode:

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

Page 18: Tinalinux - files.lindeni.orgfiles.lindeni.org/lindenis-v536/Documents/AW... · 1 Tinalinux SDKDevelopmentGuide TableofContents Overview.....4

18

When the above commands are executed, the menuconfig configuration menu will popup, as shown below. In this case, the function of each module can be configured. Theconfiguration method is described in the menuconfig configuration menu window.

Diagram of menuconfig configuration menu

uboot compilation

Method I

The uboot can be compiled in the tina directory.

Method II

uboot configuration

sys_config configurationThe sys_config.fex is an important file for configuration of module parameters, whichprovides great convenience for modification and updating of important parameters ofeach module. The file storage path is:/TinaSDK/target/allwinner/$(BOARD)/configs/sys_config.fex.

Introduction to sys_config.fex structure

The sys_config.fes mainly consists of main keys and sub-keys. Main keys are the mainidentifiers of one function or module, and indicated by “[]”. Sub-keys are theconfiguration items of each parameters of the function or module. In the figure below,dram_para is the main key, and dram_clk, dram_type, and dram_zp are sub-keys.

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

Page 19: Tinalinux - files.lindeni.orgfiles.lindeni.org/lindenis-v536/Documents/AW... · 1 Tinalinux SDKDevelopmentGuide TableofContents Overview.....4

19

Basic structure diagram of sysconfig.fex

Example of sys_config.fex configuration

[platform]: platform-related configuration item

For example, debug_mode =1 means that the debug mode of uboot is enabled and thecorresponding debug inforamtion will be printed in the log. next_work=2 indicates nextstep after burning (0x1: normal start; 0x2: restart; 0x3: OFF). For other configurations,refer to the prompts in front of the [platform].

Inthe above figure, the frequency of cpu can be configured by setting boot_clock.

Inthe above figure, uart_debug_port=0 indicates that uart0 is used. The gpio port(PA04/PA05) of uart_debug_tx/uart_debug_rx can be configured according to thecorresponding GPIO DATASHEET.

sys_config.fex parsing process

In uboot4014/2018, sys_config.fex will eventually be converted into dtb (device treebinary, i.e. linux kernel configuration), while dtb will eventually be packaged and burnedinto the flash, and loaded into the memory in the startup process. The parametersconfigured in sys_config.fex have been converted into dtb nodes, which will be parsed bythe fdt_getprop_32() function.

Environment variable configuration

The environment variables of uboot are key-value pairs. The operation interfaces are:getenv(), setenv(), and saveenv(). Types of environment variable:

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

Page 20: Tinalinux - files.lindeni.orgfiles.lindeni.org/lindenis-v536/Documents/AW... · 1 Tinalinux SDKDevelopmentGuide TableofContents Overview.....4

20

Function of environment variable

Some parameters or command sequences can be defined in environment variables. Todefine the UBOOT command sequence in an environment variable, the function modulesof UBOOT can be combined according to the sequence during execution of oneimportant function.

Example: If the command corresponding to the environment variable boot_normal isexecuted, Uboot will first call the sunxi_flash command to load the kernel from the bootpartition of the storage medium to the 0x40007800 position of DRAM, and then call theboota command to complete the kernel boot.

The environment variable is called during uboot startup, as shown below.

Mode of calling environment variable in uboot startup

Introduction to environment variable configuration example

In TinaSDK, the environment variable configuration file is saved in theTinaSDK/target/allwinner/$(BOARD)/configs/env.cfg file. When using this file, the usermay see env-4.4.cfg, env-4.9.cfg and the like. The suffix number in “env-xxx” indicatesthe configuration in different kernel versions. Below is an example of an opened file:

• bootdelay=0: change the value of the environment variable bootdelay (i.e. thecountdown delay time in the log after booting). For easy debugging, the variablevalue is usually not set to 0, so that the “uboot shell” can be enabled by pressing anykey after the sub-unit is powered on.

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

Page 21: Tinalinux - files.lindeni.orgfiles.lindeni.org/lindenis-v536/Documents/AW... · 1 Tinalinux SDKDevelopmentGuide TableofContents Overview.....4

21

• boot_normal=sunxi_flash read 40007800 boot; boota 4000780: set the boot kernelcommand, i.e. read the boot partition to the memory address 0x40007800, and startthe kernel at the memory address 0x40007800.

• Setargs_nand=setenv bootargs earlyprintk=${earlyprink}…: Setargs_nand=setenvbootargs earlyprintk=${earlyprink}…: set the kernel-related environment variable.This variable will be printed after booting into the kernel log, i.e. cmdline as shownbelow:

kernel cmdline diagram• loglevel=8: set the printing level of the kernel log.

sys_partition.fex partition configuration

The partition configuration file is used for planning of disk partitions. In the burningprocess, the data of each partition will be burnt into the flash based on this partitionconfiguration file.

In TinaSDK, the path of the partition configuration file isTinaSDK/target/allwinner/$(BOARD)/configs/sys_partition.fex. In some schemes,sys_partition.fex and sys_partition_nor.fex may be seen. The configuration filesys_partition_linux.fex will be used during packaging of Tina non-nor firmware; andsys_partition_nor.fex will be used during packaging of nor firmware.

Introduction to sys_partition.fex partition configuration

The properties of one partition include the name, size, download file and user type.Below are the properties of one partition in the file:

• name: user-defined partition name. The user may set the desired character string, butits length should not exceed 16 bytes.

• size: define the partition size in sectors (1 sector = 512 bytes. In the above figure,32,768 sectors are assigned to the env partition, i.e. 32,768*512/1,024/1,024 = 16M). Note: For byte alignment, the number of assigned sectors should be exactlydivisible by 128.

• downloadfile: path and name of the download file. A relative path (relative to thepartition where the file image.cfg is located). An absolute path may be used.

• user_type: an attribute provided for the operating system. At present, while readingthis partition, each operating system will check whether the current partition issuitable according to the user type. When multiple systems are applied, this designcan avoid failure of the operating system B caused by misreading or miswriting ofits partitions by the operating system A.

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

Page 22: Tinalinux - files.lindeni.orgfiles.lindeni.org/lindenis-v536/Documents/AW... · 1 Tinalinux SDKDevelopmentGuide TableofContents Overview.....4

22

Tina kernel Custom Development

OverviewThis chapter briefly introduces the basic kernel configuration function tailoring andcommon command use, to help users learn about the Linux kernel of Tina platform andprovide a basis for custom development of the kernel.

At present, the Linux kernel of Tina SDK has 4 versions, namely, linux-3.4, linux-3.10,linux-4.4 and linux-4.9, which are used in different hardware platforms. Users need tocheck the kernel information of SDK based on the developed hardware platform.

Code path

Module development documentsRefer to the BSP development documents, including the manuals for usage anddevelopment of common kernel modules.

Kernel configurationThe Linux kernel configuration needs to be changed during product customization. InTinaSDK, the kernel configuration can be enabled as follows:

After execution, the configuration menu will pop up on the shell console. As shownbelow,

TinaLinux kernel configuration menu

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

Page 23: Tinalinux - files.lindeni.orgfiles.lindeni.org/lindenis-v536/Documents/AW... · 1 Tinalinux SDKDevelopmentGuide TableofContents Overview.....4

23

Custom development of Tina system

Application portingIn the Tina Linux SDK, a package directory generally contains the following twodirectories and one file:

Makefile example

The software compilation logic is dependent on the Makefile of software. In theory, thereis no substantive relationship with the Makefile (Makefile is only for execution of makecommands and related parameters).

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

Page 24: Tinalinux - files.lindeni.orgfiles.lindeni.org/lindenis-v536/Documents/AW... · 1 Tinalinux SDKDevelopmentGuide TableofContents Overview.....4

24

Note:

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

Page 25: Tinalinux - files.lindeni.orgfiles.lindeni.org/lindenis-v536/Documents/AW... · 1 Tinalinux SDKDevelopmentGuide TableofContents Overview.....4

25

Self-boot settings

Tina Linux supports two formats of initialization scripts: busybox-type or sysVinitialization scripts and procd initialization scripts. Usually, initialization scripts areprogrammed with the shell script. The shell script as basic knowledge is not explainedhere.

Under normal circumstances, the source codes of initialization scripts are saved in thefiles directory of software, with the suffix “.init”, such as:

In “install” of Makefile, initialization scripts are installed in the sub-unit, such as:

Calling of self-boot script• A number of logs are generated if the self-boot script is called manually during

startup, and the log information is collected by the logd daemon, which is notconducive to debugging of initialization scripts. In this case, debugging can becarried out by manually calling command lines of the sub-unit, such as:

Script in sysV format

The initialization scripts in the sysV format are saved in the /etc/init.d/ directory of thesub-unit and used for self-booting. The initialization script with minimum content istaken as an example below. Its core is the start / stop function:

A function template of init script is provided in rc.common, which consists of thefollowing parts.

Name Attribute Functionstart Required Start a service.stop Required Stop a service.reload Optional Restart a service.enable Optional Reload a service.disable Optional Disable a service.

In the shell, relevant services can be operated by the following commands.

Script in Procd format

In the following example of initialization script, the main function is: start_service.

For details, refer to https://wiki.openwrt.org/inbox/procd-init-scripts.

Application debuggingThe newly added software is disabled by default, so the Enable package needs to beconfigured manually. Execute “make menuconfig” in the root directory of Tina to enterthe package configuration interface:

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

Page 26: Tinalinux - files.lindeni.orgfiles.lindeni.org/lindenis-v536/Documents/AW... · 1 Tinalinux SDKDevelopmentGuide TableofContents Overview.....4

26

Main interface of application configuration

The package path is associated with the definition in Makefile of the package. Takefstools as an example. Its definition in Makefile is:

The fstools package can be found by entering the Basy system from the menuconfiginterface.

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

Page 27: Tinalinux - files.lindeni.orgfiles.lindeni.org/lindenis-v536/Documents/AW... · 1 Tinalinux SDKDevelopmentGuide TableofContents Overview.....4

27

Package interface

Meaning of the prefix:

Supported operation:

Application compilationSee Section 6.5 “Application recompilation”.

Application compilation1. Get the installation package.

The installation package is usually located in the directory:

Format of the installation package name:

2. Install the application package.

Push the installation package to sub-unit via adb.

Install the application package.

Partitioning and mounting• Partition upgradeSubarea Functionboot partition Store the kernel image.rootfs partition Basic system image partition, including /lib, /bin, /etc, etc.recovery partition Store recovery system images [only for large-capacity schemes].• No partition upgrade

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

Page 28: Tinalinux - files.lindeni.orgfiles.lindeni.org/lindenis-v536/Documents/AW... · 1 Tinalinux SDKDevelopmentGuide TableofContents Overview.....4

28

Subarea Functionprivate partition SN storage partitionmisc partition System and flash status partitionUDISK partition User data partition (/mnt/UDISK)overlayfs partition Store overlayfs data.• Default mount pointSubarea Mount point Remarks/dev/by-name/boot /boot

/dev/by-name/boot-res /boot-res

/dev/by-name/UDISK /mnt/UDISK User data partition/dev/mmcblk0或 /dev/mmcblk0p1 /mnt/SDCARD Tf card mount point/dev/by-name/rootfs_data /overlay Store overlayfs data.

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni

nulllindeni