├── .gitignore ├── Build_OrangePi.sh ├── README.md └── lib ├── A64SDK_BuildEnvironment.sh ├── GetRoot.sh ├── H2SDK_BuildEnvironment.sh ├── H3SDK_BuildEnvironment.sh ├── H5SDK_BuildEnvironment.sh ├── PrepareTool.sh ├── RDASDK_BuildEnvironment.sh ├── i96SDK_BuildEnvironment.sh └── main.sh /.gitignore: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE! Don't add files that are generated in specific 3 | # subdirectories here. Add them in the ".gitignore" file 4 | # in that subdirectory instead. 5 | # 6 | # NOTE! Please use 'git ls-files -i --exclude-standard' 7 | # command after changing this file, to see if there are 8 | # any tracked files which get ignored after the change. 9 | # 10 | # Normal rules 11 | # 12 | .* 13 | *.o 14 | *.o.* 15 | *.a 16 | *.s 17 | *.ko 18 | *.so 19 | *.so.dbg 20 | *.mod.c 21 | *.i 22 | *.lst 23 | *.symtypes 24 | *.order 25 | *.map 26 | *.elf 27 | *.bin 28 | *.gz 29 | *.bz2 30 | *.lzma 31 | *.xz 32 | *.lzo 33 | *.patch 34 | *.gcno 35 | standby.code 36 | resume1.code 37 | 38 | # 39 | # Gcov files 40 | # 41 | *.gcda 42 | *.gcno 43 | *.gcov 44 | 45 | # 46 | # Top-level generic files 47 | # 48 | /tags 49 | /TAGS 50 | # 51 | # git files that we don't want to ignore even it they are dot-files 52 | # 53 | !.gitignore 54 | 55 | *.orig 56 | *~ 57 | \#*# 58 | 59 | 60 | # OrangePi external 61 | OrangePiH5/ 62 | OrangePiA64/ 63 | OrangePiH3/ 64 | OrangePiH2/ 65 | -------------------------------------------------------------------------------- /Build_OrangePi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # 5 | # This script is used to build different OrangePi system. 6 | # 7 | TOP_ROOT=`pwd` 8 | 9 | # Get root first 10 | cd $TOP_ROOT/lib 11 | clear 12 | ./GetRoot.sh 13 | 14 | # Prepare running-tools 15 | if [ ! -f $TOP_ROOT/lib/.tmp_tools ]; then 16 | sudo ./PrepareTool.sh 17 | echo "Install Toolchain" > $TOP_ROOT/lib/.tmp_tools 18 | fi 19 | 20 | # Execute Main program 21 | ./main.sh 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | OrangePi Build System 2 | --------------------------------------- 3 | 4 | Welcome to OrangePi Build System, Good start Linux World with OrangePi! 5 | 6 | Funny with your idear and build your owner Linux system. 7 | 8 | #### OrangePi Build System support list: 9 | 10 | * OrangePi PC2 11 | 12 | * OrangePi Prima 13 | 14 | * OrangePi Win 15 | 16 | * OrangePi Win plus 17 | 18 | * OrangePi Zero 19 | 20 | * OrangePi Zero plus 21 | 22 | * OrangePi Zero plus 2 23 | 24 | * OrangePi PC plus 25 | 26 | * OrangePi Plus 2E 27 | 28 | * OrangePi Lite 29 | 30 | * OrangePi One 31 | 32 | * OrangePi Mini2 33 | 34 | * OrangePi 2 35 | 36 | * OrangePi Plus 2 37 | 38 | * OrangePi 2G-IOT 39 | 40 | * OrangePi i96 41 | 42 | ----------------------------------------------------------------- 43 | 44 | #### Using OrangePi Build System 45 | 46 | It's easy to build owner Linux distro in OrangePi Build System, you need follow 47 | thoese steps: 48 | 49 | 1. Download source code for your OrangePi Board. 50 | 51 | You need clone this repertory, and run build scripts to download 52 | source code for your OrangePi Board. such as: 53 | 54 | ``` 55 | git clone https://github.com/OrangePiLibra/OrangePi.git 56 | ``` 57 | 58 | This scripts is a simple entry that build different OrangePi distro, 59 | After finishing to download this repertory, you need change dirent into 60 | "OrangePi", and run build scripts: 61 | 62 | ``` 63 | ./Build_OrangePi.sh 64 | ``` 65 | 66 | 67 | Choose correct OrangePi version that you want, and scripts will download 68 | source code that contain kernel, uboot and build scripts. 69 | 70 | It will cost some time, so please wait a mintue. After this finish, you 71 | will get a new dirent and change your dirent into new dirent. 72 | 73 | If you use "OrangePi PC2/Prima/Zero plus2", please change your dirent into "OrangePiH5" 74 | 75 | If you use "OrangePi Win/Win plus", please change your dirent into "OrangePiA64" 76 | 77 | If you use "OrangePi Zero", please change your dirent into "OrangePiH2" 78 | 79 | If you use another board, please change your dirent into "OrangePiH3" 80 | 81 | 82 | 2. Build owner distro OrangePi system 83 | 84 | Then, you only need run a scripts and you can build your owner system easily. 85 | Note, please don't run this scripts as root. Last, you need run scripts, 86 | such as: 87 | 88 | ``` 89 | ./build.sh 90 | ``` 91 | 92 | ------------------------------------------------------------------ 93 | 94 | ### Maintain OrangePi 95 | 96 | We offer different repertory to maintain OrangePi, you can also push your patch 97 | into OrangePi build system, more detail: 98 | 99 | * OrangePi 2G-IOT/i96 100 | 101 | OrangePi 2G-IOT/i96 build on Allwinner RDA8810 Soc, the offfical maintain 102 | repertory as follow: 103 | 104 | kernel: 105 | 106 | ``` 107 | https://github.com/OrangePiLibra/OrangePiRDA_kernel.git 108 | ``` 109 | 110 | scripts: 111 | 112 | ``` 113 | https://github.com/OrangePiLibra/OrangePiRDA_scripts.git 114 | ``` 115 | 116 | * OrangePi PC2/Prima/Zero plus2 117 | 118 | OrangePi PC2/Prima/Zero plus build on Allwinner H5 Soc, the offfical maintain 119 | repertory as follow: 120 | 121 | kernel: 122 | 123 | ``` 124 | https://github.com/OrangePiLibra/OrangePiH5_kernel.git 125 | ``` 126 | 127 | u-boot: 128 | 129 | ``` 130 | https://github.com/OrangePiLibra/OrangePiH5_uboot.git 131 | ``` 132 | 133 | build scripts 134 | 135 | ``` 136 | https://github.com/OrangePiLibra/OrangePiH5_scripts.git 137 | ``` 138 | 139 | external binary file 140 | 141 | ``` 142 | https://github.com/OrangePiLibra/OrangePiH5_external.git 143 | ``` 144 | 145 | toolchain 146 | ``` 147 | https://github.com/OrangePiLibra/OrangePiH5_toolchain.git 148 | ``` 149 | 150 | * OrangePi Win/Win plus 151 | 152 | OrangePi Win/Win plus build on Allwinner A64 Soc, the offfical maintain 153 | repertory as follow: 154 | 155 | kernel: 156 | 157 | ``` 158 | https://github.com/OrangePiLibra/OrangePiA64_kernel.git 159 | ``` 160 | 161 | u-boot: 162 | 163 | ``` 164 | https://github.com/OrangePiLibra/OrangePiA64_uboot.git 165 | ``` 166 | 167 | build scripts 168 | 169 | ``` 170 | https://github.com/OrangePiLibra/OrangePiA64_scripts.git 171 | ``` 172 | 173 | external binary file 174 | ``` 175 | https://github.com/OrangePiLibra/OrangePiA64_external.git 176 | ``` 177 | 178 | toolchain 179 | ``` 180 | https://github.com/OrangePiLibra/OrangePiA64_toolchain.git 181 | ``` 182 | 183 | 184 | * OrangePi Zero 185 | 186 | OrangePi Zero plus build on Allwinner H2+ Soc, the offfical maintain 187 | repertory as follow: 188 | 189 | kernel: 190 | 191 | ``` 192 | https://github.com/OrangePiLibra/OrangePiH2_kernel.git 193 | ``` 194 | 195 | u-boot: 196 | 197 | ``` 198 | https://github.com/OrangePiLibra/OrangePiH3_uboot.git 199 | ``` 200 | 201 | build scripts 202 | 203 | ``` 204 | https://github.com/OrangePiLibra/OrangePiH2_scripts.git 205 | ``` 206 | 207 | external binary file 208 | 209 | ``` 210 | https://github.com/OrangePiLibra/OrangePiH2_external.git 211 | ``` 212 | 213 | toolchain 214 | ``` 215 | https://github.com/OrangePiLibra/OrangePiH3_toolchain.git 216 | ``` 217 | 218 | * OrangePi Plus2/Plus 2E/One/PC/2/Lite/PC Plus/Mini2 219 | 220 | OrangePi Plus2/Plus 2E/One/PC/2/Lite/PC Plus/Mini2 plus build on Allwinner H3 Soc, 221 | the offfical maintain repertory as follow: 222 | 223 | kernel: 224 | 225 | ``` 226 | https://github.com/OrangePiLibra/OrangePiH3_kernel.git 227 | ``` 228 | 229 | u-boot: 230 | 231 | ``` 232 | https://github.com/OrangePiLibra/OrangePiH3_uboot.git 233 | ``` 234 | 235 | build scripts 236 | 237 | ``` 238 | https://github.com/OrangePiLibra/OrangePiH3_scripts.git 239 | ``` 240 | 241 | external binary file 242 | 243 | ``` 244 | https://github.com/OrangePiLibra/OrangePiH3_external.git 245 | ``` 246 | 247 | toolchain 248 | 249 | ``` 250 | https://github.com/OrangePiLibra/OrangePiH3_toolchain.git 251 | ``` 252 | -------------------------------------------------------------------------------- /lib/A64SDK_BuildEnvironment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script is used to build OrangePi A64 environment. 4 | # Write by: Buddy 5 | # Date: 2017-01-06 6 | 7 | if [ -z $TOP_ROOT ]; then 8 | TOP_ROOT=`cd .. && pwd` 9 | fi 10 | 11 | # Github 12 | kernel_GITHUB="https://github.com/OrangePiLibra/OrangePiA64_kernel.git" 13 | uboot_GITHUB="https://github.com/OrangePiLibra/OrangePiA64_uboot.git" 14 | scripts_GITHUB="https://github.com/OrangePiLibra/OrangePiA64_scripts.git" 15 | external_GITHUB="https://github.com/OrangePiLibra/OrangePiA64_external.git" 16 | toolchain="https://codeload.github.com/OrangePiLibra/OrangePiA64_toolchain/zip/master" 17 | 18 | # Prepare dirent 19 | Prepare_dirent=( 20 | kernel 21 | uboot 22 | scripts 23 | external 24 | ) 25 | 26 | # Change to TOP dirent 27 | cd $TOP_ROOT/.. 28 | TOP_ROOT="`pwd`" 29 | 30 | if [ ! -d $TOP_ROOT/OrangePiA64 ]; then 31 | mkdir $TOP_ROOT/OrangePiA64 32 | fi 33 | # Download Source Code from Github 34 | function download_Code() 35 | { 36 | for dirent in ${Prepare_dirent[@]}; do 37 | echo -e "\e[1;31m Download $dirent from Github \e[0m" 38 | if [ ! -d $TOP_ROOT/OrangePiA64/$dirent ]; then 39 | cd $TOP_ROOT/OrangePiA64 40 | GIT="${dirent}_GITHUB" 41 | echo -e "\e[1;31m Github: ${!GIT} \e[0m" 42 | git clone --depth=1 ${!GIT} 43 | mv $TOP_ROOT/OrangePiA64/OrangePiA64_${dirent} $TOP_ROOT/OrangePiA64/${dirent} 44 | else 45 | cd $TOP_ROOT/OrangePiA64/${dirent} 46 | git pull 47 | fi 48 | done 49 | } 50 | 51 | function dirent_check() 52 | { 53 | for ((i = 0; i < 100; i++)); do 54 | 55 | if [ $i = "99" ]; then 56 | whiptail --title "Note Box" --msgbox "Please ckeck your network" 10 40 0 57 | exit 0 58 | fi 59 | 60 | m="none" 61 | for dirent in ${Prepare_dirent[@]}; do 62 | if [ ! -d $TOP_ROOT/OrangePiA64/$dirent ]; then 63 | cd $TOP_ROOT/OrangePiA64 64 | GIT="${dirent}_GITHUB" 65 | git clone --depth=1 ${!GIT} 66 | mv $TOP_ROOT/OrangePiA64/OrangePiA64_${dirent} $TOP_ROOT/OrangePiA64/${dirent} 67 | m="retry" 68 | fi 69 | done 70 | if [ $m = "none" ]; then 71 | i=200 72 | fi 73 | done 74 | } 75 | 76 | function end_op() 77 | { 78 | if [ ! -f $TOP_ROOT/OrangePiA64/build.sh ]; then 79 | ln -s $TOP_ROOT/OrangePiA64/scripts/build.sh $TOP_ROOT/OrangePiA64/build.sh 80 | fi 81 | } 82 | 83 | function git_configure() 84 | { 85 | export GIT_CURL_VERBOSE=1 86 | export GIT_TRACE_PACKET=1 87 | export GIT_TRACE=1 88 | } 89 | 90 | function install_toolchain() 91 | { 92 | if [ ! -d $TOP_ROOT/OrangePiA64/toolchain/gcc-linaro-aarch ]; then 93 | mkdir -p $TOP_ROOT/OrangePiA64/.tmp_toolchain 94 | cd $TOP_ROOT/OrangePiA64/.tmp_toolchain 95 | curl -C - -o ./toolchain $toolchain 96 | unzip $TOP_ROOT/OrangePiA64/.tmp_toolchain/toolchain 97 | mkdir -p $TOP_ROOT/OrangePiA64/toolchain 98 | mv $TOP_ROOT/OrangePiA64/.tmp_toolchain/OrangePiA64_toolchain-master $TOP_ROOT/OrangePiA64/toolchain/toolchain_tar 99 | rm -rf $TOP_ROOT/OrangePiA64/.tmp_toolchain 100 | cd - 101 | fi 102 | } 103 | 104 | git_configure 105 | download_Code 106 | dirent_check 107 | install_toolchain 108 | end_op 109 | 110 | whiptail --title "OrangePi Build System" --msgbox \ 111 | "`figlet OrangePi` Succeed to Create OrangePi Build System! Path:$TOP_ROOT/OrangePiA64" \ 112 | 15 50 0 113 | clear 114 | -------------------------------------------------------------------------------- /lib/GetRoot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # This script is used to root 5 | 6 | for ((i = 0; i < 5; i++)); do 7 | PASSWD=$(whiptail --title "OrangePi Build System" \ 8 | --passwordbox "Enter your root password. Note! Don't use root to run this scripts" \ 9 | 10 60 3>&1 1>&2 2>&3) 10 | 11 | if [ $i = "4" ]; then 12 | whiptail --title "Note Box" --msgbox "Error, Invalid password" 10 40 0 13 | exit 0 14 | fi 15 | 16 | sudo -k 17 | if sudo -lS &> /dev/null << EOF 18 | $PASSWD 19 | EOF 20 | then 21 | i=10 22 | else 23 | whiptail --title "OrangePi Build System" --msgbox "Invalid password, Pls input corrent password" \ 24 | 10 40 0 --cancel-button Exit --ok-button Retry 25 | fi 26 | done 27 | 28 | echo $PASSWD | sudo ls &> /dev/null 2>&1 29 | -------------------------------------------------------------------------------- /lib/H2SDK_BuildEnvironment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script is used to build OrangePi H2 environment. 4 | # Write by: Buddy 5 | # Date: 2017-01-06 6 | 7 | if [ -z $TOP_ROOT ]; then 8 | TOP_ROOT=`cd .. && pwd` 9 | fi 10 | 11 | # Github 12 | kernel_GITHUB="https://github.com/OrangePiLibra/OrangePiH2_kernel.git" 13 | uboot_GITHUB="https://github.com/OrangePiLibra/OrangePiH3_uboot.git" 14 | scripts_GITHUB="https://github.com/OrangePiLibra/OrangePiH2_scripts.git" 15 | external_GITHUB="https://github.com/OrangePiLibra/OrangePiH2_external.git" 16 | toolchain="https://codeload.github.com/OrangePiLibra/OrangePiH3_toolchain/zip/master" 17 | 18 | # Prepare dirent 19 | Prepare_dirent=( 20 | kernel 21 | uboot 22 | scripts 23 | external 24 | ) 25 | 26 | # Change to TOP dirent 27 | cd $TOP_ROOT/.. 28 | TOP_ROOT="`pwd`" 29 | 30 | if [ ! -d $TOP_ROOT/OrangePiH2 ]; then 31 | mkdir $TOP_ROOT/OrangePiH2 32 | fi 33 | # Download Source Code from Github 34 | function download_Code() 35 | { 36 | for dirent in ${Prepare_dirent[@]}; do 37 | echo -e "\e[1;31m Download $dirent from Github \e[0m" 38 | if [ ! -d $TOP_ROOT/OrangePiH2/$dirent ]; then 39 | cd $TOP_ROOT/OrangePiH2 40 | GIT="${dirent}_GITHUB" 41 | echo -e "\e[1;31m Github: ${!GIT} \e[0m" 42 | git clone --depth=1 ${!GIT} 43 | if [ $dirent = "uboot" ]; then 44 | mv $TOP_ROOT/OrangePiH2/OrangePiH3_${dirent} $TOP_ROOT/OrangePiH2/${dirent} 45 | else 46 | mv $TOP_ROOT/OrangePiH2/OrangePiH2_${dirent} $TOP_ROOT/OrangePiH2/${dirent} 47 | fi 48 | else 49 | cd $TOP_ROOT/OrangePiH2/${dirent} 50 | git pull 51 | fi 52 | done 53 | } 54 | 55 | function dirent_check() 56 | { 57 | for ((i = 0; i < 100; i++)); do 58 | 59 | if [ $i = "99" ]; then 60 | whiptail --title "Note Box" --msgbox "Please ckeck your network" 10 40 0 61 | exit 0 62 | fi 63 | 64 | m="none" 65 | for dirent in ${Prepare_dirent[@]}; do 66 | if [ ! -d $TOP_ROOT/OrangePiH2/$dirent ]; then 67 | cd $TOP_ROOT/OrangePiH2 68 | GIT="${dirent}_GITHUB" 69 | git clone --depth=1 ${!GIT} 70 | mv $TOP_ROOT/OrangePiH2/OrangePiH2_${dirent} $TOP_ROOT/OrangePiH2/${dirent} 71 | m="retry" 72 | fi 73 | done 74 | if [ $m = "none" ]; then 75 | i=200 76 | fi 77 | done 78 | } 79 | 80 | function end_op() 81 | { 82 | if [ ! -f $TOP_ROOT/OrangePiH2/build.sh ]; then 83 | ln -s $TOP_ROOT/OrangePiH2/scripts/build.sh $TOP_ROOT/OrangePiH2/build.sh 84 | fi 85 | } 86 | 87 | function git_configure() 88 | { 89 | export GIT_CURL_VERBOSE=1 90 | export GIT_TRACE_PACKET=1 91 | export GIT_TRACE=1 92 | } 93 | 94 | function install_toolchain() 95 | { 96 | if [ ! -d $TOP_ROOT/OrangePiH2/toolchain/arm-linux-gnueabi ]; then 97 | mkdir -p $TOP_ROOT/OrangePiH2/.tmp_toolchain 98 | cd $TOP_ROOT/OrangePiH2/.tmp_toolchain 99 | curl -C - -o ./toolchain $toolchain 100 | unzip $TOP_ROOT/OrangePiH2/.tmp_toolchain/toolchain 101 | mkdir -p $TOP_ROOT/OrangePiH2/toolchain 102 | mv $TOP_ROOT/OrangePiH2/.tmp_toolchain/OrangePiH3_toolchain-master/* $TOP_ROOT/OrangePiH2/toolchain/ 103 | sudo chmod 755 $TOP_ROOT/OrangePiH2/toolchain -R 104 | rm -rf $TOP_ROOT/OrangePiH2/.tmp_toolchain 105 | cd - 106 | fi 107 | } 108 | 109 | git_configure 110 | download_Code 111 | dirent_check 112 | install_toolchain 113 | end_op 114 | 115 | whiptail --title "OrangePi Build System" --msgbox \ 116 | "`figlet OrangePi` Succeed to Create OrangePi Build System! Path:$TOP_ROOT/OrangePiH2" \ 117 | 15 50 0 118 | clear 119 | -------------------------------------------------------------------------------- /lib/H3SDK_BuildEnvironment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script is used to build OrangePi H3 environment. 4 | # Write by: Buddy 5 | # Date: 2017-01-06 6 | 7 | if [ -z $TOP_ROOT ]; then 8 | TOP_ROOT=`cd .. && pwd` 9 | fi 10 | 11 | # Github 12 | kernel_GITHUB="https://github.com/OrangePiLibra/OrangePiH3_kernel.git" 13 | uboot_GITHUB="https://github.com/OrangePiLibra/OrangePiH3_uboot.git" 14 | scripts_GITHUB="https://github.com/OrangePiLibra/OrangePiH3_scripts.git" 15 | external_GITHUB="https://github.com/OrangePiLibra/OrangePiH3_external.git" 16 | toolchain="https://codeload.github.com/OrangePiLibra/OrangePiH3_toolchain/zip/master" 17 | 18 | # Prepare dirent 19 | Prepare_dirent=( 20 | kernel 21 | uboot 22 | scripts 23 | external 24 | ) 25 | 26 | # Change to TOP dirent 27 | cd $TOP_ROOT/.. 28 | TOP_ROOT="`pwd`" 29 | 30 | if [ ! -d $TOP_ROOT/OrangePiH3 ]; then 31 | mkdir $TOP_ROOT/OrangePiH3 32 | fi 33 | # Download Source Code from Github 34 | function download_Code() 35 | { 36 | for dirent in ${Prepare_dirent[@]}; do 37 | echo -e "\e[1;31m Download $dirent from Github \e[0m" 38 | if [ ! -d $TOP_ROOT/OrangePiH3/$dirent ]; then 39 | cd $TOP_ROOT/OrangePiH3 40 | GIT="${dirent}_GITHUB" 41 | echo -e "\e[1;31m Github: ${!GIT} \e[0m" 42 | git clone --depth=1 ${!GIT} 43 | mv $TOP_ROOT/OrangePiH3/OrangePiH3_${dirent} $TOP_ROOT/OrangePiH3/${dirent} 44 | else 45 | cd $TOP_ROOT/OrangePiH3/${dirent} 46 | git pull 47 | fi 48 | done 49 | } 50 | 51 | function dirent_check() 52 | { 53 | for ((i = 0; i < 100; i++)); do 54 | 55 | if [ $i = "99" ]; then 56 | whiptail --title "Note Box" --msgbox "Please ckeck your network" 10 40 0 57 | exit 0 58 | fi 59 | 60 | m="none" 61 | for dirent in ${Prepare_dirent[@]}; do 62 | if [ ! -d $TOP_ROOT/OrangePiH3/$dirent ]; then 63 | cd $TOP_ROOT/OrangePiH3 64 | GIT="${dirent}_GITHUB" 65 | git clone --depth=1 ${!GIT} 66 | mv $TOP_ROOT/OrangePiH3/OrangePiH3_${dirent} $TOP_ROOT/OrangePiH3/${dirent} 67 | m="retry" 68 | fi 69 | done 70 | if [ $m = "none" ]; then 71 | i=200 72 | fi 73 | done 74 | } 75 | 76 | function end_op() 77 | { 78 | if [ ! -f $TOP_ROOT/OrangePiH3/build.sh ]; then 79 | ln -s $TOP_ROOT/OrangePiH3/scripts/build.sh $TOP_ROOT/OrangePiH3/build.sh 80 | fi 81 | } 82 | 83 | function git_configure() 84 | { 85 | export GIT_CURL_VERBOSE=1 86 | export GIT_TRACE_PACKET=1 87 | export GIT_TRACE=1 88 | } 89 | 90 | function install_toolchain() 91 | { 92 | if [ ! -d $TOP_ROOT/OrangePiH3/toolchain/arm-linux-gnueabi ]; then 93 | mkdir -p $TOP_ROOT/OrangePiH3/.tmp_toolchain 94 | cd $TOP_ROOT/OrangePiH3/.tmp_toolchain 95 | curl -C - -o ./toolchain $toolchain 96 | unzip $TOP_ROOT/OrangePiH3/.tmp_toolchain/toolchain 97 | mkdir -p $TOP_ROOT/OrangePiH3/toolchain 98 | mv $TOP_ROOT/OrangePiH3/.tmp_toolchain/OrangePiH3_toolchain-master/* $TOP_ROOT/OrangePiH3/toolchain/ 99 | sudo chmod 755 $TOP_ROOT/OrangePiH3/toolchain -R 100 | rm -rf $TOP_ROOT/OrangePiH3/.tmp_toolchain 101 | cd - 102 | fi 103 | } 104 | 105 | git_configure 106 | download_Code 107 | dirent_check 108 | install_toolchain 109 | end_op 110 | 111 | whiptail --title "OrangePi Build System" --msgbox \ 112 | "`figlet OrangePi` Succeed to Create OrangePi Build System! Path:$TOP_ROOT/OrangePiH3" \ 113 | 15 50 0 114 | clear 115 | -------------------------------------------------------------------------------- /lib/H5SDK_BuildEnvironment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script is used to build OrangePi H5 environment. 4 | # Write by: Buddy 5 | # Date: 2017-01-06 6 | 7 | if [ -z $TOP_ROOT ]; then 8 | TOP_ROOT=`cd .. && pwd` 9 | fi 10 | 11 | # Github 12 | kernel_GITHUB="https://github.com/OrangePiLibra/OrangePiH5_kernel.git" 13 | uboot_GITHUB="https://github.com/OrangePiLibra/OrangePiH5_uboot.git" 14 | scripts_GITHUB="https://github.com/OrangePiLibra/OrangePiH5_scripts.git" 15 | external_GITHUB="https://github.com/OrangePiLibra/OrangePiH5_external.git" 16 | toolchain="https://codeload.github.com/OrangePiLibra/OrangePiH5_toolchain/zip/master" 17 | 18 | # Prepare dirent 19 | Prepare_dirent=( 20 | kernel 21 | uboot 22 | scripts 23 | external 24 | ) 25 | 26 | # Change to TOP dirent 27 | cd $TOP_ROOT/.. 28 | TOP_ROOT="`pwd`" 29 | 30 | if [ ! -d $TOP_ROOT/OrangePiH5 ]; then 31 | mkdir $TOP_ROOT/OrangePiH5 32 | fi 33 | # Download Source Code from Github 34 | function download_Code() 35 | { 36 | for dirent in ${Prepare_dirent[@]}; do 37 | echo -e "\e[1;31m Download $dirent from Github \e[0m" 38 | if [ ! -d $TOP_ROOT/OrangePiH5/$dirent ]; then 39 | cd $TOP_ROOT/OrangePiH5 40 | GIT="${dirent}_GITHUB" 41 | echo -e "\e[1;31m Github: ${!GIT} \e[0m" 42 | git clone --depth=1 ${!GIT} 43 | mv $TOP_ROOT/OrangePiH5/OrangePiH5_${dirent} $TOP_ROOT/OrangePiH5/${dirent} 44 | else 45 | cd $TOP_ROOT/OrangePiH5/${dirent} 46 | git pull 47 | fi 48 | done 49 | } 50 | 51 | function dirent_check() 52 | { 53 | for ((i = 0; i < 100; i++)); do 54 | 55 | if [ $i = "99" ]; then 56 | whiptail --title "Note Box" --msgbox "Please ckeck your network" 10 40 0 57 | exit 0 58 | fi 59 | 60 | m="none" 61 | for dirent in ${Prepare_dirent[@]}; do 62 | if [ ! -d $TOP_ROOT/OrangePiH5/$dirent ]; then 63 | cd $TOP_ROOT/OrangePiH5 64 | GIT="${dirent}_GITHUB" 65 | git clone --depth=1 ${!GIT} 66 | mv $TOP_ROOT/OrangePiH5/OrangePiH5_${dirent} $TOP_ROOT/OrangePiH5/${dirent} 67 | m="retry" 68 | fi 69 | done 70 | if [ $m = "none" ]; then 71 | i=200 72 | fi 73 | done 74 | } 75 | 76 | function end_op() 77 | { 78 | if [ ! -f $TOP_ROOT/OrangePiH5/build.sh ]; then 79 | ln -s $TOP_ROOT/OrangePiH5/scripts/build.sh $TOP_ROOT/OrangePiH5/build.sh 80 | fi 81 | } 82 | 83 | function git_configure() 84 | { 85 | export GIT_CURL_VERBOSE=1 86 | export GIT_TRACE_PACKET=1 87 | export GIT_TRACE=1 88 | } 89 | 90 | function install_toolchain() 91 | { 92 | if [ ! -d $TOP_ROOT/OrangePiH5/toolchain/gcc-linaro-aarch ]; then 93 | mkdir -p $TOP_ROOT/OrangePiH5/.tmp_toolchain 94 | cd $TOP_ROOT/OrangePiH5/.tmp_toolchain 95 | curl -C - -o ./toolchain $toolchain 96 | unzip $TOP_ROOT/OrangePiH5/.tmp_toolchain/toolchain 97 | mkdir -p $TOP_ROOT/OrangePiH5/toolchain 98 | mv $TOP_ROOT/OrangePiH5/.tmp_toolchain/OrangePiH5_toolchain-master $TOP_ROOT/OrangePiH5/toolchain/toolchain_tar 99 | rm -rf $TOP_ROOT/OrangePiH5/.tmp_toolchain 100 | cd - 101 | fi 102 | } 103 | 104 | git_configure 105 | download_Code 106 | dirent_check 107 | install_toolchain 108 | end_op 109 | 110 | whiptail --title "OrangePi Build System" --msgbox \ 111 | "`figlet OrangePi` Succeed to Create OrangePi Build System! Path:$TOP_ROOT/OrangePiH5" \ 112 | 15 50 0 113 | clear 114 | -------------------------------------------------------------------------------- /lib/PrepareTool.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | if ! hash apt-get 2>/dev/null; then 6 | whiptail --title "Orangepi Build System" --msgbox "This scripts requires a Debian based distrbution. If you not use Debian/Ubunut, pls install:[ bsdtar mtools u-boot-tools pv bc sunxi-tools gcc automake make qemu dosfstools ]" 7 | exit 1 8 | fi 9 | 10 | apt-get -y --no-install-recommends --fix-missing install \ 11 | bsdtar mtools u-boot-tools pv bc \ 12 | gcc automake make \ 13 | lib32z1 lib32z1-dev qemu-user-static \ 14 | dosfstools figlet device-tree-compiler debootstrap 15 | -------------------------------------------------------------------------------- /lib/RDASDK_BuildEnvironment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script is used to build OrangePi RDA environment. 4 | # Write by: Buddy 5 | # Date: 2017-01-06 6 | 7 | if [ -z $TOP_ROOT ]; then 8 | TOP_ROOT=`cd .. && pwd` 9 | fi 10 | 11 | # Github 12 | kernel_GITHUB="https://github.com/OrangePiLibra/OrangePiRDA_kernel.git" 13 | uboot_GITHUB="https://github.com/OrangePiLibra/OrangePiRDA_uboot.git" 14 | scripts_GITHUB="https://github.com/OrangePiLibra/OrangePiRDA_scripts.git" 15 | external_GITHUB="https://github.com/OrangePiLibra/OrangePiRDA_external.git" 16 | toolchain="https://codeload.github.com/OrangePiLibra/OrangePiH3_toolchain/zip/master" 17 | 18 | # Prepare dirent 19 | Prepare_dirent=( 20 | kernel 21 | uboot 22 | external 23 | scripts 24 | ) 25 | 26 | # Change to TOP dirent 27 | cd $TOP_ROOT/.. 28 | TOP_ROOT="`pwd`" 29 | 30 | if [ ! -d $TOP_ROOT/OrangePiRDA ]; then 31 | mkdir $TOP_ROOT/OrangePiRDA 32 | fi 33 | # Download Source Code from Github 34 | function download_Code() 35 | { 36 | for dirent in ${Prepare_dirent[@]}; do 37 | echo -e "\e[1;31m Download $dirent from Github \e[0m" 38 | if [ ! -d $TOP_ROOT/OrangePiRDA/$dirent ]; then 39 | cd $TOP_ROOT/OrangePiRDA 40 | GIT="${dirent}_GITHUB" 41 | echo -e "\e[1;31m Github: ${!GIT} \e[0m" 42 | git clone --depth=1 ${!GIT} 43 | mv $TOP_ROOT/OrangePiRDA/OrangePiRDA_${dirent} $TOP_ROOT/OrangePiRDA/${dirent} 44 | else 45 | cd $TOP_ROOT/OrangePiRDA/${dirent} 46 | git pull 47 | fi 48 | done 49 | } 50 | 51 | function dirent_check() 52 | { 53 | for ((i = 0; i < 100; i++)); do 54 | 55 | if [ $i = "99" ]; then 56 | whiptail --title "Note Box" --msgbox "Please ckeck your network" 10 40 0 57 | exit 0 58 | fi 59 | 60 | m="none" 61 | for dirent in ${Prepare_dirent[@]}; do 62 | if [ ! -d $TOP_ROOT/OrangePiRDA/$dirent ]; then 63 | cd $TOP_ROOT/OrangePiRDA 64 | GIT="${dirent}_GITHUB" 65 | git clone --depth=1 ${!GIT} 66 | mv $TOP_ROOT/OrangePiRDA/OrangePiRDA_${dirent} $TOP_ROOT/OrangePiRDA/${dirent} 67 | m="retry" 68 | fi 69 | done 70 | if [ $m = "none" ]; then 71 | i=200 72 | fi 73 | done 74 | } 75 | 76 | function end_op() 77 | { 78 | if [ ! -f $TOP_ROOT/OrangePiRDA/build.sh ]; then 79 | ln -s $TOP_ROOT/OrangePiRDA/scripts/build.sh $TOP_ROOT/OrangePiRDA/build.sh 80 | fi 81 | } 82 | 83 | function git_configure() 84 | { 85 | export GIT_CURL_VERBOSE=1 86 | export GIT_TRACE_PACKET=1 87 | export GIT_TRACE=1 88 | } 89 | 90 | function install_toolchain() 91 | { 92 | if [ ! -d $TOP_ROOT/OrangePiRDA/toolchain/arm-linux-gnueabi ]; then 93 | mkdir -p $TOP_ROOT/OrangePiRDA/.tmp_toolchain 94 | cd $TOP_ROOT/OrangePiRDA/.tmp_toolchain 95 | curl -C - -o ./toolchain $toolchain 96 | unzip $TOP_ROOT/OrangePiRDA/.tmp_toolchain/toolchain 97 | mkdir -p $TOP_ROOT/OrangePiRDA/toolchain 98 | mv $TOP_ROOT/OrangePiRDA/.tmp_toolchain/OrangePiH3_toolchain-master/* $TOP_ROOT/OrangePiRDA/toolchain/ 99 | sudo chmod 755 $TOP_ROOT/OrangePiRDA/toolchain -R 100 | rm -rf $TOP_ROOT/OrangePiRDA/.tmp_toolchain 101 | cd - 102 | fi 103 | } 104 | 105 | git_configure 106 | download_Code 107 | dirent_check 108 | install_toolchain 109 | end_op 110 | 111 | whiptail --title "OrangePi Build System" --msgbox \ 112 | "`figlet OrangePi` Succeed to Create OrangePi Build System! Path:$TOP_ROOT/OrangePiRDA" \ 113 | 15 50 0 114 | clear 115 | -------------------------------------------------------------------------------- /lib/i96SDK_BuildEnvironment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script is used to build OrangePi i96 environment. 4 | # Write by: Buddy 5 | # Date: 2017-01-06 6 | 7 | if [ -z $TOP_ROOT ]; then 8 | TOP_ROOT=`cd .. && pwd` 9 | fi 10 | 11 | # Github 12 | kernel_GITHUB="https://github.com/OrangePiLibra/OrangePi_i96_kernel.git" 13 | uboot_GITHUB="https://github.com/OrangePiLibra/OrangePi_i96_uboot.git" 14 | scripts_GITHUB="https://github.com/OrangePiLibra/OrangePi_i96_scripts.git" 15 | external_GITHUB="https://github.com/OrangePiLibra/OrangePi_i96_external.git" 16 | toolchain="https://codeload.github.com/OrangePiLibra/OrangePiH3_toolchain/zip/master" 17 | 18 | # Prepare dirent 19 | Prepare_dirent=( 20 | kernel 21 | uboot 22 | external 23 | scripts 24 | ) 25 | 26 | # Change to TOP dirent 27 | cd $TOP_ROOT/.. 28 | TOP_ROOT="`pwd`" 29 | 30 | if [ ! -d $TOP_ROOT/OrangePi_i96 ]; then 31 | mkdir $TOP_ROOT/OrangePi_i96 32 | fi 33 | # Download Source Code from Github 34 | function download_Code() 35 | { 36 | for dirent in ${Prepare_dirent[@]}; do 37 | echo -e "\e[1;31m Download $dirent from Github \e[0m" 38 | if [ ! -d $TOP_ROOT/OrangePi_i96/$dirent ]; then 39 | cd $TOP_ROOT/OrangePi_i96 40 | GIT="${dirent}_GITHUB" 41 | echo -e "\e[1;31m Github: ${!GIT} \e[0m" 42 | git clone --depth=1 ${!GIT} 43 | mv $TOP_ROOT/OrangePi_i96/OrangePi_i96_${dirent} $TOP_ROOT/OrangePi_i96/${dirent} 44 | else 45 | cd $TOP_ROOT/OrangePi_i96/${dirent} 46 | git pull 47 | fi 48 | done 49 | } 50 | 51 | function dirent_check() 52 | { 53 | for ((i = 0; i < 100; i++)); do 54 | 55 | if [ $i = "99" ]; then 56 | whiptail --title "Note Box" --msgbox "Please ckeck your network" 10 40 0 57 | exit 0 58 | fi 59 | 60 | m="none" 61 | for dirent in ${Prepare_dirent[@]}; do 62 | if [ ! -d $TOP_ROOT/OrangePi_i96/$dirent ]; then 63 | cd $TOP_ROOT/OrangePi_i96 64 | GIT="${dirent}_GITHUB" 65 | git clone --depth=1 ${!GIT} 66 | mv $TOP_ROOT/OrangePi_i96/OrangePi_i96_${dirent} $TOP_ROOT/OrangePi_i96/${dirent} 67 | m="retry" 68 | fi 69 | done 70 | if [ $m = "none" ]; then 71 | i=200 72 | fi 73 | done 74 | } 75 | 76 | function end_op() 77 | { 78 | if [ ! -f $TOP_ROOT/OrangePi_i96/build.sh ]; then 79 | ln -s $TOP_ROOT/OrangePi_i96/scripts/build.sh $TOP_ROOT/OrangePi_i96/build.sh 80 | fi 81 | } 82 | 83 | function git_configure() 84 | { 85 | export GIT_CURL_VERBOSE=1 86 | export GIT_TRACE_PACKET=1 87 | export GIT_TRACE=1 88 | } 89 | 90 | function install_toolchain() 91 | { 92 | if [ ! -d $TOP_ROOT/OrangePi_i96/toolchain/arm-linux-gnueabi ]; then 93 | mkdir -p $TOP_ROOT/OrangePi_i96/.tmp_toolchain 94 | cd $TOP_ROOT/OrangePi_i96/.tmp_toolchain 95 | curl -C - -o ./toolchain $toolchain 96 | unzip $TOP_ROOT/OrangePi_i96/.tmp_toolchain/toolchain 97 | mkdir -p $TOP_ROOT/OrangePi_i96/toolchain 98 | mv $TOP_ROOT/OrangePi_i96/.tmp_toolchain/OrangePiH3_toolchain-master/* $TOP_ROOT/OrangePi_i96/toolchain/ 99 | sudo chmod 755 $TOP_ROOT/OrangePi_i96/toolchain -R 100 | rm -rf $TOP_ROOT/OrangePi_i96/.tmp_toolchain 101 | cd - 102 | fi 103 | } 104 | 105 | git_configure 106 | download_Code 107 | dirent_check 108 | install_toolchain 109 | end_op 110 | 111 | whiptail --title "OrangePi Build System" --msgbox \ 112 | "`figlet OrangePi` Succeed to Create OrangePi Build System! Path:$TOP_ROOT/OrangePi_i96" \ 113 | 15 50 0 114 | clear 115 | -------------------------------------------------------------------------------- /lib/main.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # This script is used to build OrangePi system 5 | # Write: Buddy 6 | # Date: 2017-01-05 7 | 8 | # Support List 9 | # Board Name || Platform 10 | # OrangePi PC2 Allwinner H5 11 | # OrangePi Prime Allwinner H5 12 | # OrangePi Win Allwinner A64 13 | # OrangePi Win Plus Allwinner A64 14 | # OrangePi Zeroplus2 Allwinner H5/H3 15 | # OrangePi Zero Allwinner H2+ 16 | # OrangePi Plus2 Allwinner H3 17 | # OrangePi Plus2E Allwinner H3 18 | # OrangePi One Allwinner H3 19 | # OrangePi PC Allwinner H3 20 | # OrangePi 2 Allwinner H3 21 | # OrangePi Lite Allwinner H3 22 | # OrangePi PC Plus Allwinner H3 23 | # OrangePi Mini2 Allwinner H3 24 | # OrangePi 2G-IOT RDA8810 25 | # OrangePi i96 RDA8810 26 | 27 | whiptail --title "OrangePi Build System" --msgbox \ 28 | "`figlet OrangePi` It's funny to build owner Linux system! Let's go to Linux World with OrangePi" \ 29 | 15 50 0 30 | 31 | MENUSTR="Plase select build option" 32 | 33 | OPTION=$(whiptail --title "OrangePi Build System" \ 34 | --menu "$MENUSTR" 10 50 3 --cancel-button Finish --ok-button Select \ 35 | "0" "Build system with kernel/uboot/rootfs" \ 36 | "1" "Update source code" \ 37 | "2" "Download full distro Image" \ 38 | 3>&1 1>&2 2>&3) 39 | 40 | DISTRO=$(whiptail --title "OrangePi Build System" \ 41 | --menu "$MENUSTR" 25 60 17 --cancel-button Finish --ok-button Select \ 42 | "0" "orangepi PC2" \ 43 | "1" "orangepi Zero" \ 44 | "2" "orangepi PC Plus" \ 45 | "3" "orangepi Plus2e" \ 46 | "4" "orangepi Lite" \ 47 | "5" "orangepi Plus2(H5)" \ 48 | "6" "orangepi Plus2(H3)" \ 49 | "7" "orangepi Plus" \ 50 | "8" "orangepi PC" \ 51 | "9" "orangepi One" \ 52 | "10" "orangepi 2" \ 53 | "11" "orangepi Mini2" \ 54 | "12" "orangepi Win" \ 55 | "13" "orangepi Win plus" \ 56 | "14" "orangepi Prime" \ 57 | "15" "orangepi 2G-IOT" \ 58 | "16" "orangepi i96" \ 59 | 3>&1 1>&2 2>&3) 60 | 61 | if [ $OPTION = "0" -o $OPTION = "1" ]; then 62 | # OrangePi H5 63 | if [ $DISTRO = "0" -o $DISTRO = "5" -o $DISTRO = "14" ]; then 64 | ./H5SDK_BuildEnvironment.sh 65 | # OrangePi A64 66 | elif [ $DISTRO = "12" -o $DISTRO = "13" ]; then 67 | ./A64SDK_BuildEnvironment.sh 68 | # OrangePi RDA 69 | elif [ $DISTRO = "15" ]; then 70 | ./RDASDK_BuildEnvironment.sh 71 | # OrangePi RDA 72 | elif [ $DISTRO = "16" ]; then 73 | ./i96SDK_BuildEnvironment.sh 74 | # OrangePi H2 75 | elif [ $DISTRO = "1" ]; then 76 | ./H2SDK_BuildEnvironment.sh 77 | # OrangePi H3 78 | else 79 | ./H3SDK_BuildEnvironment.sh 80 | fi 81 | elif [ $OPTION = "2" ]; then 82 | echo "Download Image" 83 | else 84 | echo "Bad Operation" 85 | fi 86 | --------------------------------------------------------------------------------