Difference between revisions of "SDK Download and Build"
Csjamesdeng (talk | contribs) (Created page with "== System requirements == == Downloading == == Linux host setup == == Building == == Installation ==") |
(→Toolchain) |
||
(27 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
+ | [[zh:SDK下载和编译]] | ||
== System requirements == | == System requirements == | ||
+ | |||
+ | Listed below are the recommended requirements for downloading and building the SDK: | ||
+ | * CPU: x86_64 or better family processor | ||
+ | * Memory: 8GB or higher | ||
+ | * Disk: 10GB free hard disk space | ||
+ | * OS: Ubuntu 14.04 (tested) or higher | ||
+ | * Network: internet connection | ||
+ | |||
+ | == Linux host setup == | ||
+ | |||
+ | === Ubuntu 14.04 === | ||
+ | |||
+ | ''HINT: later version should also work.'' | ||
+ | |||
+ | ==== Install prerequisites ==== | ||
+ | |||
+ | <pre> | ||
+ | $ sudo dpkg --add-architecture i386 | ||
+ | $ sudo apt-get update | ||
+ | $ sudo apt-get install git git-core u-boot-tools qemu qemu-user-static debootstrap lib32z1 lib32ncurses5 libc6:i386 libstdc++6:i386 gawk | ||
+ | </pre> | ||
+ | |||
+ | * dpkg --add-architecture i386: support 32bit architecture | ||
+ | * apt-get update: retrieve new lists of packages | ||
+ | * git git-core: manage source code | ||
+ | * u-boot-tools: build kernel image | ||
+ | * qemu qemu-user-static: emulator for arm on host CPU | ||
+ | * debootstrap: for installing a Debian base system | ||
+ | * lib32z1 lib32ncurses5 libc6:i386 libstdc++6:i386: for running 32bit tools | ||
+ | * gawk: GNU Awk | ||
+ | |||
+ | ==== Sudo without password ==== | ||
+ | |||
+ | <pre> | ||
+ | $ sudo visudo | ||
+ | </pre> | ||
+ | |||
+ | Add this line at the end (change “james” to your username): | ||
+ | <pre>james ALL=(ALL) NOPASSWD: ALL</pre> | ||
+ | Ctrl-X to leave, save your changes, and you're done! | ||
== Downloading == | == Downloading == | ||
− | == | + | === SDK === |
+ | |||
+ | The SDK is available on [https://github.com/lindenis-org github]. | ||
+ | |||
+ | We use Repo manage Git repositories. Clone Repo from [https://android.googlesource.com/tools/repo android Git repositories] or other mirrors and install it. | ||
+ | <br>Chinese developers can install Repo follow these steps: | ||
+ | <pre> | ||
+ | $ git clone http://mirrors.ustc.edu.cn/aosp/git-repo.git ~/.bin/repo | ||
+ | $ echo "export PATH=~/.bin/repo:$PATH" >> ~/.bashrc | ||
+ | $ source ~/.bashrc | ||
+ | </pre> | ||
+ | |||
+ | For Lindenis V5, download the SDK via: | ||
+ | <pre> | ||
+ | $ repo init -u https://github.com/lindenis-org/manifest.git -b v5 | ||
+ | $ repo sync | ||
+ | </pre> | ||
+ | The Download time depends on your network connection speed. After finish the download, you should get below directories: | ||
+ | <pre> | ||
+ | build build.sh debian device kernel tools u-boot | ||
+ | </pre> | ||
+ | |||
+ | Start a branch for local workspace: | ||
+ | <pre> | ||
+ | $ repo start v5 --all | ||
+ | </pre> | ||
+ | |||
+ | Before building the source, you have to download a basic rootfs and toolchains. | ||
+ | |||
+ | === Basic rootfs === | ||
+ | |||
+ | Download the basic rootfs from [ftp://13.57.226.143/alip/ FTP server] with user 'ftp' (password: lindeni) and store to debian directory. | ||
+ | * [ftp://13.57.226.143/alip/stretch-alip.tar.gz stretch-alip.tar.gz] | ||
+ | |||
+ | === Toolchain === | ||
+ | |||
+ | Download the toolchain from [ftp://13.57.226.143/toolchain/ FTP server] with user 'ftp' (password: lindeni) and store to tools/build/toolchain directory (create directory if not exist). | ||
+ | * [ftp://13.57.226.143/toolchain/gcc-linaro-5.3.1-2016.05-x86_64_arm-linux-gnueabi.tar.xz gcc-linaro-5.3.1-2016.05-x86_64_arm-linux-gnueabi.tar.xz] | ||
+ | * [ftp://13.57.226.143/toolchain/gcc-linaro-arm.tar.xz gcc-linaro-arm.tar.xz] | ||
== Building == | == Building == | ||
+ | |||
+ | === Setup env === | ||
+ | |||
+ | For Lindenis V5 SBC: | ||
+ | <pre> | ||
+ | $ source build/envsetup.sh | ||
+ | All available platforms: | ||
+ | 0. eagle(Allwinner-V5,sun8iw12p1,arm) | ||
+ | 1. petrel(Allwinner-H3,sun8iw7p1,arm) | ||
+ | 2. cuckoo(Allwinner-V3,sun8iw8p1,arm) | ||
+ | Choice: 0 | ||
+ | All available OS: | ||
+ | 0. buildroot | ||
+ | 1. debian | ||
+ | Choice: 1 | ||
+ | 0. allwinner-dvb | ||
+ | 1. lindeni-v5 | ||
+ | Choice: 1 | ||
+ | </pre> | ||
+ | |||
+ | === Build source === | ||
+ | |||
+ | * Build kernel and rootfs | ||
+ | <pre> | ||
+ | $ ./build.sh | ||
+ | </pre> | ||
+ | |||
+ | Now you can build the OS image. You can also build component separately for debugging as follow. | ||
+ | |||
+ | * Build kernel only | ||
+ | <pre> | ||
+ | $ ./build/mk-kernel.sh | ||
+ | </pre> | ||
+ | |||
+ | * Build rootfs only (debian) | ||
+ | <pre> | ||
+ | $ ./build/mk-debian.sh | ||
+ | </pre> | ||
+ | |||
+ | * Build U-Boot | ||
+ | <pre> | ||
+ | $ ./build/mk-u-boot.sh | ||
+ | </pre> | ||
+ | |||
+ | === Build image === | ||
+ | |||
+ | For MicroSD Card image: | ||
+ | <pre> | ||
+ | $ ./build.sh flat-fw | ||
+ | </pre> | ||
+ | |||
+ | For eMMC image: | ||
+ | <pre> | ||
+ | $ ./build.sh pack | ||
+ | </pre> | ||
== Installation == | == Installation == | ||
+ | |||
+ | * [[Linbian_Setup#Writing_an_image_to_the_SD_card | Writing an image to the SD card]] | ||
+ | * [[Writing_an_image_to_the_eMMC | Writing_an_image_to_the_eMMC]] |
Latest revision as of 07:54, 8 August 2019
Contents
System requirements
Listed below are the recommended requirements for downloading and building the SDK:
- CPU: x86_64 or better family processor
- Memory: 8GB or higher
- Disk: 10GB free hard disk space
- OS: Ubuntu 14.04 (tested) or higher
- Network: internet connection
Linux host setup
Ubuntu 14.04
HINT: later version should also work.
Install prerequisites
$ sudo dpkg --add-architecture i386 $ sudo apt-get update $ sudo apt-get install git git-core u-boot-tools qemu qemu-user-static debootstrap lib32z1 lib32ncurses5 libc6:i386 libstdc++6:i386 gawk
- dpkg --add-architecture i386: support 32bit architecture
- apt-get update: retrieve new lists of packages
- git git-core: manage source code
- u-boot-tools: build kernel image
- qemu qemu-user-static: emulator for arm on host CPU
- debootstrap: for installing a Debian base system
- lib32z1 lib32ncurses5 libc6:i386 libstdc++6:i386: for running 32bit tools
- gawk: GNU Awk
Sudo without password
$ sudo visudo
Add this line at the end (change “james” to your username):
james ALL=(ALL) NOPASSWD: ALL
Ctrl-X to leave, save your changes, and you're done!
Downloading
SDK
The SDK is available on github.
We use Repo manage Git repositories. Clone Repo from android Git repositories or other mirrors and install it.
Chinese developers can install Repo follow these steps:
$ git clone http://mirrors.ustc.edu.cn/aosp/git-repo.git ~/.bin/repo $ echo "export PATH=~/.bin/repo:$PATH" >> ~/.bashrc $ source ~/.bashrc
For Lindenis V5, download the SDK via:
$ repo init -u https://github.com/lindenis-org/manifest.git -b v5 $ repo sync
The Download time depends on your network connection speed. After finish the download, you should get below directories:
build build.sh debian device kernel tools u-boot
Start a branch for local workspace:
$ repo start v5 --all
Before building the source, you have to download a basic rootfs and toolchains.
Basic rootfs
Download the basic rootfs from FTP server with user 'ftp' (password: lindeni) and store to debian directory.
Toolchain
Download the toolchain from FTP server with user 'ftp' (password: lindeni) and store to tools/build/toolchain directory (create directory if not exist).
Building
Setup env
For Lindenis V5 SBC:
$ source build/envsetup.sh All available platforms: 0. eagle(Allwinner-V5,sun8iw12p1,arm) 1. petrel(Allwinner-H3,sun8iw7p1,arm) 2. cuckoo(Allwinner-V3,sun8iw8p1,arm) Choice: 0 All available OS: 0. buildroot 1. debian Choice: 1 0. allwinner-dvb 1. lindeni-v5 Choice: 1
Build source
- Build kernel and rootfs
$ ./build.sh
Now you can build the OS image. You can also build component separately for debugging as follow.
- Build kernel only
$ ./build/mk-kernel.sh
- Build rootfs only (debian)
$ ./build/mk-debian.sh
- Build U-Boot
$ ./build/mk-u-boot.sh
Build image
For MicroSD Card image:
$ ./build.sh flat-fw
For eMMC image:
$ ./build.sh pack