<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-CN">
		<id>http://wiki.myzr.com.cn/index.php?action=history&amp;feed=atom&amp;title=MYZR-A40I-EK204_Linux-3.10.65_Build_Reference_Manual</id>
		<title>MYZR-A40I-EK204 Linux-3.10.65 Build Reference Manual - 版本历史</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.myzr.com.cn/index.php?action=history&amp;feed=atom&amp;title=MYZR-A40I-EK204_Linux-3.10.65_Build_Reference_Manual"/>
		<link rel="alternate" type="text/html" href="http://wiki.myzr.com.cn/index.php?title=MYZR-A40I-EK204_Linux-3.10.65_Build_Reference_Manual&amp;action=history"/>
		<updated>2026-05-25T03:10:28Z</updated>
		<subtitle>本wiki的该页面的版本历史</subtitle>
		<generator>MediaWiki 1.27.1</generator>

	<entry>
		<id>http://wiki.myzr.com.cn/index.php?title=MYZR-A40I-EK204_Linux-3.10.65_Build_Reference_Manual&amp;diff=4037&amp;oldid=prev</id>
		<title>Admin：创建页面，内容为“The download of the source code package needs to be downloaded from the network disk provided by us.&lt;br&gt; After downloading to the computer, it needs to be copied to...”</title>
		<link rel="alternate" type="text/html" href="http://wiki.myzr.com.cn/index.php?title=MYZR-A40I-EK204_Linux-3.10.65_Build_Reference_Manual&amp;diff=4037&amp;oldid=prev"/>
				<updated>2022-04-11T06:50:10Z</updated>
		
		<summary type="html">&lt;p&gt;创建页面，内容为“The download of the source code package needs to be downloaded from the network disk provided by us.&amp;lt;br&amp;gt; After downloading to the computer, it needs to be copied to...”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The download of the source code package needs to be downloaded from the network disk provided by us.&amp;lt;br&amp;gt;&lt;br /&gt;
After downloading to the computer, it needs to be copied to the virtual machine via Samba or other methods.&amp;lt;br&amp;gt;&lt;br /&gt;
​We can create an A40I-specific directory to store related source code, compilation tools and some things that will be used later.&amp;lt;br&amp;gt;&lt;br /&gt;
For example, my directory is: **/home/liangyh/my-work/A40I**, in this directory I created 4 subdirectories:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
=====&amp;gt; Input:&lt;br /&gt;
liangyh@FS12:~/my-work/A40I$ ls&lt;br /&gt;
01_image 02_sources 03_toolchain 04_app&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
​	​Directory 01 can be used to place our compiled image (will be explained later)&lt;br /&gt;
&lt;br /&gt;
​	​Directory 02 is used to place source code&lt;br /&gt;
&lt;br /&gt;
​	​Directory 03 is to place the cross-compilation tool configuration script&lt;br /&gt;
&lt;br /&gt;
​	​Directory 04 we can use to place our own applications (assigned by the user)&lt;br /&gt;
&lt;br /&gt;
​	Copy the source package to the ~/my-work/A40I/02_sources directory in the virtual machine using Samba or other methods&lt;br /&gt;
&lt;br /&gt;
​	And then unzip the source package to the current directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
=====&amp;gt; Input:&lt;br /&gt;
~/my-work/A40I/02_sources$ cat repo_A40I.tar.bz2a* | tar xjv&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a cross-compiler tool configuration script&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
=====&amp;gt; Input command：&lt;br /&gt;
cat &amp;lt;&amp;lt; EOF &amp;gt; ~/my-work/A40I/03_toolchain/arm-openwrt-linux-muslgnueabi.sh&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
export PATH=${HOME}/my-work/A40I/02_sources/repo_A40I/prebuilt/gcc/linux-x86/arm/toolchain-sunxi-musl/toolchain/bin/:${PATH}&lt;br /&gt;
export ARCH=arm&lt;br /&gt;
export CROSS_COMPILE=${HOME}/my-work/A40I/02_sources/repo_A40I/prebuilt/gcc/linux-x86/arm/toolchain-sunxi-musl/toolchain/bin/arm-openwrt-linux-muslgnueabi-&lt;br /&gt;
export CC=${HOME}/my-work/A40I/02_sources/repo_A40I/prebuilt/gcc/linux-x86/arm/toolchain-sunxi-musl/toolchain/bin/arm-openwrt-linux-muslgnueabi-gcc&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get executable permission&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
chmod +x ~/my-work/A40I/03_toolchain/arm-openwrt-linux-muslgnueabi.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
## **tina source code compilation**&lt;br /&gt;
&lt;br /&gt;
**The source code is compiled using the script, the cross-compilation tool is automatically configured, the source code is compiled, and finally the board image file is packaged and generated.**&lt;br /&gt;
&lt;br /&gt;
**1. Setting up the environment**&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
=====&amp;gt; Input:&lt;br /&gt;
$ sudo apt-get install libssl-dev&lt;br /&gt;
$ sudo apt-get install gperf&lt;br /&gt;
$ sudo apt-get install lib32stdc++6&lt;br /&gt;
&lt;br /&gt;
=====&amp;gt; Input:&lt;br /&gt;
$ source build/envsetup.sh&lt;br /&gt;
&lt;br /&gt;
=====&amp;gt; Output:&lt;br /&gt;
Setup env done! Please run lunch next.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
**2. Set the build platform**&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
=====&amp;gt; Input:&lt;br /&gt;
$ lunch r40_m2ultra-tina&lt;br /&gt;
&lt;br /&gt;
=====&amp;gt; Output:&lt;br /&gt;
============================================&lt;br /&gt;
TINA_BUILD_TOP=/home/liangyh/my-work/A40I/02_sources/repo_A40I&lt;br /&gt;
TINA_TARGET_ARCH=arm&lt;br /&gt;
TARGET_PRODUCT=r40_m2ultra&lt;br /&gt;
TARGET_PLATFORM=r40&lt;br /&gt;
TARGET_BOARD=r40-m2ultra&lt;br /&gt;
TARGET_PLAN=m2ultra&lt;br /&gt;
TARGET_BUILD_VARIANT=tina&lt;br /&gt;
TARGET_BUILD_TYPE=release&lt;br /&gt;
TARGET_KERNEL_VERSION=3.10&lt;br /&gt;
TARGET_UBOOT=u-boot-2014.07&lt;br /&gt;
TARGET_CHIP=sun8iw11p1&lt;br /&gt;
============================================&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
**3. Compile uboot**&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
=====&amp;gt; Input:&lt;br /&gt;
$ muboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
**4. Compile kernel**&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
=====&amp;gt; Input:&lt;br /&gt;
$ make &lt;br /&gt;
&lt;br /&gt;
=====&amp;gt; Output:&lt;br /&gt;
Checking 'working-make'... ok.&lt;br /&gt;
Checking 'case-sensitive-fs'... ok.&lt;br /&gt;
Checking 'gcc'... ok.&lt;br /&gt;
Checking 'working-gcc'... ok.&lt;br /&gt;
&lt;br /&gt;
......&lt;br /&gt;
&lt;br /&gt;
#### make completed successfully (23:30 (mm:ss)) ####&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
**5. Package firmware**&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
=====&amp;gt; Input:&lt;br /&gt;
$ pack&lt;br /&gt;
&lt;br /&gt;
=====&amp;gt; Output:&lt;br /&gt;
No kernel param, parse it from r40&lt;br /&gt;
copying tools file&lt;br /&gt;
copying configs file&lt;br /&gt;
&lt;br /&gt;
......&lt;br /&gt;
&lt;br /&gt;
/home/liangyh/my-work/A40I/02_sources/repo_A40I/out/r40-m2ultra/tina_r40-m2ultra_uart0.img&lt;br /&gt;
&lt;br /&gt;
pack finish&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generate firmware address:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
repo_A40I/out/r40-m2ultra/tina_r40-m2ultra_uart0.img&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
## **Application programming example**&lt;br /&gt;
&lt;br /&gt;
Copy the source package to the ~/my-work/A40I/04_app directory in the virtual machine using Samba or other methods.&lt;br /&gt;
&lt;br /&gt;
 **1. Configure the cross-compilation tool**&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
=====&amp;gt; Input:&lt;br /&gt;
$ source ~/my-work/A40I/03_toolchain/arm-openwrt-linux-muslgnueabi.sh &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 **2. Verify cross-compiler configuration**&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
=====&amp;gt; Input:&lt;br /&gt;
$CC -v&lt;br /&gt;
&lt;br /&gt;
=====&amp;gt; Output:&lt;br /&gt;
Reading specs from /home/liangyh/my-work/A40I/02_sources/repo_A40I/prebuilt/gcc/linux-x86/arm/toolchain-sunxi-musl/toolchain/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/6.4.1/specs&lt;br /&gt;
COLLECT_GCC=arm-openwrt-linux-muslgnueabi-gcc.bin&lt;br /&gt;
COLLECT_LTO_WRAPPER=/home/liangyh/my-work/A40I/02_sources/repo_A40I/prebuilt/gcc/linux-x86/arm/toolchain-sunxi-musl/toolchain/bin/../libexec/gcc/arm-openwrt-linux-muslgnueabi/6.4.1/lto-wrapper&lt;br /&gt;
Target: arm-openwrt-linux-muslgnueabi&lt;br /&gt;
Configured with: /home/caiyongheng/tina/out/astar-parrot/compile_dir/toolchain/gcc-linaro-6.4-2017.11/configure --with-bugurl=https://dev.openwrt.org/ --with-pkgversion='OpenWrt/Linaro GCC 6.4-2017.11 2017-11' --prefix=/home/caiyongheng/tina/out/astar-parrot/staging_dir/toolchain --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=arm-openwrt-linux-muslgnueabi --with-gnu-ld --enable-target-optspace --enable-libgomp --disable-libmudflap --disable-multilib --disable-nls --without-isl --without-cloog --with-host-libstdcxx=-lstdc++ --with-gmp=/home/caiyongheng/tina/out/host --with-mpfr=/home/caiyongheng/tina/out/host --with-mpc=/home/caiyongheng/tina/out/host --disable-decimal-float --with-diagnostics-color=auto-if-env --disable-libssp --enable-__cxa_atexit --with-arch=armv7-a --with-float=hard --with-headers=/home/caiyongheng/tina/out/astar-parrot/staging_dir/toolchain/include --disable-libsanitizer --enable-languages=c,c++ --enable-shared --enable-threads --with-slibdir=/home/caiyongheng/tina/out/astar-parrot/staging_dir/toolchain/lib --enable-lto --with-libelf=/home/caiyongheng/tina/out/host&lt;br /&gt;
Thread model: posix&lt;br /&gt;
gcc version 6.4.1 (OpenWrt/Linaro GCC 6.4-2017.11 2017-11)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 **3. Start compiling**&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
=====&amp;gt; Input:&lt;br /&gt;
${CC} hello_world.c -o hello_world&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 **4. Execute**&lt;br /&gt;
&lt;br /&gt;
Move the compiled binary file hello_world to the development board (for the moving method, refer to the file transfer in the previous experience).&lt;br /&gt;
&lt;br /&gt;
give executable permission and execute the file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
=====&amp;gt; Input:&lt;br /&gt;
# chmod +x hello_world&lt;br /&gt;
# ./hello_world&lt;br /&gt;
&lt;br /&gt;
=====&amp;gt; Output:&lt;br /&gt;
hello world!!!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the successful operation, the information of **hello world** is successfully output.&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>