android lichee编译脚本解析

<code class="hljs vala has-numbering"><span class="hljs-preprocessor">#编译流程</span>
<span class="hljs-preprocessor">#lichee 目录下
</span> ./build.sh -p sun7i_android -k <span class="hljs-number">3.4
</span></code><code class="hljs bash has-numbering"><span class="hljs-comment"></span>
</code><code class="hljs vala has-numbering"><span class="hljs-number"></span></code>
<code class="hljs bash has-numbering"><span class="hljs-comment">#build.sh 解析</span>

<span class="hljs-shebang">#!/bin/bash
</span>
<span style="color:#FF0000;"><strong><span class="hljs-keyword">set</span> <span class="hljs-operator">-e</span>  </strong></span> <span class="hljs-comment">#"Exit immediately if a simple command exits with a non-zero status."</span>
       <span class="hljs-comment">#也就是说,在"set -e"之后出现的代码,一旦出现了返回值非零,整个脚本就会立即退出</span>

<span style="color:#FF0000;"><strong>buildroot/scripts/mkcommon.sh <span class="hljs-variable">$@</span></strong></span>  <span class="hljs-comment">#$@  为参数 <strong>-p sun7i_android -k 3.4</strong></span><strong>
</strong></code>

<code class="hljs bash has-numbering"><span class="hljs-comment">#mkcommon.sh</span>
<span class="hljs-shebang">#!/bin/bash</span>
<span class="hljs-comment">#</span>
<span class="hljs-comment"># scripts/mkcommon.sh</span>
<span class="hljs-comment"># (c) Copyright 2013</span>
<span class="hljs-comment"># Allwinner Technology Co., Ltd. <www.allwinnertech.com></span>
<span class="hljs-comment"># James Deng <csjamesdeng@allwinnertech.com></span>
<span class="hljs-comment">#</span>
<span class="hljs-comment"># This program is free software; you can redistribute it and/or modify</span>
<span class="hljs-comment"># it under the terms of the GNU General Public License as published by</span>
<span class="hljs-comment"># the Free Software Foundation; either version 2 of the License, or</span>
<span class="hljs-comment"># (at your option) any later version.</span>

<span style="color:#FF0000;"><strong>BR_SCRIPTS_DIR=`dirname <span class="hljs-variable">$0</span>`</strong></span> <span class="hljs-comment">#提取出运行目录  <strong>./buildroot/scripts/</strong></span>

<span class="hljs-keyword">if</span> [ <span class="hljs-string">"<span class="hljs-variable">$1</span>"</span> = <span class="hljs-string">"pack"</span> ] ; <span class="hljs-keyword">then</span>  <span class="hljs-comment">#如果是运行打包动作</span>
    <span class="hljs-variable">${BR_SCRIPTS_DIR}</span>/build_pack.sh  <span class="hljs-comment">#运行打包脚本</span>
    <span class="hljs-keyword">exit</span> <span class="hljs-number">0</span>
<span class="hljs-keyword">fi</span>

<span class="hljs-comment"># source shflags</span>
<span style="color:#FF0000;"><strong>. <span class="hljs-variable">${BR_SCRIPTS_DIR}</span>/shflags/shflags</strong></span>  <span class="hljs-comment">#加载命令行工具</span>

<span style="color:#FF0000;"><strong>. <span class="hljs-variable">${BR_SCRIPTS_DIR}</span>/mkcmd.sh </strong></span>      <span class="hljs-comment">#加载shell编译脚本</span>

<span class="hljs-comment"># define option, format:</span>
<span class="hljs-comment">#   'long option' 'default value' 'help message' 'short option'</span>
<span class="hljs-comment">#命令行工具shflags使用</span>
<span class="hljs-comment">#三个参数含义分别为命令行参数名,参数默认值,以及参数的帮助信息</span>

<strong>DEFINE_string <span class="hljs-string">'platform'</span> <span class="hljs-string">'sun7i'</span> <span class="hljs-string">'platform to build, e.g. sun7i'</span> <span class="hljs-string">'p'</span>
DEFINE_string <span class="hljs-string">'kernel'</span> <span class="hljs-string">'3.4'</span> <span class="hljs-string">'kernel to build, e.g. 3.3'</span> <span class="hljs-string">'k'</span>
DEFINE_string <span class="hljs-string">'board'</span> <span class="hljs-string">''</span> <span class="hljs-string">'board to build, e.g. evb'</span> <span class="hljs-string">'b'</span>
DEFINE_string <span class="hljs-string">'module'</span> <span class="hljs-string">''</span> <span class="hljs-string">'module to build, e.g. buildroot, kernel, uboot, clean'</span> <span class="hljs-string">'m'</span>
DEFINE_boolean <span class="hljs-string">'independent'</span> <span class="hljs-literal">false</span> <span class="hljs-string">'output build to independent directory'</span> <span class="hljs-string">'i'</span></strong>

<span class="hljs-comment"># parse the command-line</span>
<span class="hljs-comment"># 解析传进来的参数</span>
<strong>FLAGS <span class="hljs-string">"<span class="hljs-variable">$@</span>"</span> || <span class="hljs-keyword">exit</span> $?</strong>
<span class="hljs-comment">#语法:eval cmdLine</span>
<span class="hljs-comment">#eval会对后面的cmdLine进行两遍扫描,如果第一遍扫描后,cmdLine是个普通命令,则执行此命令;</span>
<span class="hljs-comment">#如果cmdLine中含有变量的间接引用,则保证间接引用的语义。</span>

<strong><span class="hljs-built_in">eval</span> <span class="hljs-keyword">set</span> -- <span class="hljs-string">"<span class="hljs-variable">${FLAGS_ARGV}</span>"</span>
                               <span class="hljs-comment">#参数是: -p sun7i_android -k 3.4</span>
chip=<span class="hljs-variable">${FLAGS_platform%%_*}</span>     <span class="hljs-comment">#提取出chip    sun7i</span>
platform=<span class="hljs-variable">${FLAGS_platform##*_}</span> <span class="hljs-comment">#提取出平台    android</span>
kernel=<span class="hljs-variable">${FLAGS_kernel}</span>        <span class="hljs-comment">#提取出内核     3.4   </span>
board=<span class="hljs-variable">${FLAGS_board}</span>           <span class="hljs-comment">#提取出板子     这里空</span>
module=<span class="hljs-variable">${FLAGS_module}</span>         <span class="hljs-comment">#提取出模块     这里空</span>

<span class="hljs-keyword">if</span> [ <span class="hljs-string">"<span class="hljs-variable">${platform}</span>"</span> = <span class="hljs-string">"<span class="hljs-variable">${chip}</span>"</span> ] ; <span class="hljs-keyword">then</span>  <span class="hljs-comment">#如果未指定平台,默认为linux</span>
    platform=<span class="hljs-string">"linux"</span>
<span class="hljs-keyword">fi</span>

<span class="hljs-keyword">if</span> [ -z <span class="hljs-string">"<span class="hljs-variable">${module}</span>"</span> ] ; <span class="hljs-keyword">then</span>    <span class="hljs-comment">#如果未指定模块,默认编译所有</span>
    module=<span class="hljs-string">"all"</span>
<span class="hljs-keyword">fi</span>

<span class="hljs-keyword">if</span> ! init_chips <span class="hljs-variable">${chip}</span> || \               <span class="hljs-comment">#初始化芯片参数: sun7i</span>
            <span class="hljs-comment">#查询该目录下{LICHEE_TOOLS_DIR}/pack/chips/是否有 以该芯片命名的目录</span>
            <span class="hljs-comment">#并导出该变量  export LICHEE_CHIP=${chip}</span>
   ! init_platforms <span class="hljs-variable">${chip}</span> <span class="hljs-variable">${platform}</span> ; <span class="hljs-keyword">then</span>
            <span class="hljs-comment">#检查是否支持该平台 </span>
            <span class="hljs-comment">#并导出  export LICHEE_PLATFORM=${platform}</span>
    mk_error <span class="hljs-string">"invalid platform '<span class="hljs-variable">${FLAGS_platform}</span>'"</span>
    <span class="hljs-keyword">exit</span> <span class="hljs-number">1</span>
<span class="hljs-keyword">fi</span>

<span class="hljs-keyword">if</span> [ <span class="hljs-variable">${FLAGS_board}</span> ] && \  <span class="hljs-comment">#如果指定了板子,检查是否支持该板子</span>
   ! init_boards <span class="hljs-variable">${chip}</span> <span class="hljs-variable">${platform}</span> <span class="hljs-variable">${board}</span> ; <span class="hljs-keyword">then</span>
    mk_error <span class="hljs-string">"invalid board '<span class="hljs-variable">${FLAGS_board}</span>'"</span>
    <span class="hljs-keyword">exit</span> <span class="hljs-number">1</span>
<span class="hljs-keyword">fi</span>

<span class="hljs-keyword">if</span> [ <span class="hljs-string">"<span class="hljs-variable">${kernel}</span>"</span> = <span class="hljs-string">"3.3"</span> ] ; <span class="hljs-keyword">then</span> <span class="hljs-comment">#如果指定了内核3.3 ,判断该目录是否存在</span>
                                 <span class="hljs-comment"># 3.4 就不检查了?</span>
    LICHEE_KERN_DIR=<span class="hljs-variable">${LICHEE_TOP_DIR}</span>/linux-<span class="hljs-number">3.3</span>
    <span class="hljs-keyword">if</span> [ ! <span class="hljs-operator">-d</span> <span class="hljs-variable">${LICHEE_KERN_DIR}</span> ] ; <span class="hljs-keyword">then</span>
        mk_error <span class="hljs-string">"invalid kernel '<span class="hljs-variable">${kernel}</span>'"</span>
        <span class="hljs-keyword">exit</span> <span class="hljs-number">1</span>
    <span class="hljs-keyword">fi</span>
<span class="hljs-keyword">fi</span></strong>

<span class="hljs-comment"># init output directory</span>
<strong>init_outdir </strong> <span class="hljs-comment">#初始化输出目录,检查配置是否存在</span>
             <span class="hljs-comment">#这里默认配置:sun7ismp_android_defconfig,配置组成在check_kern_defconf 函数中</span>
             <span class="hljs-comment">#请自己查看</span>
             <span class="hljs-comment">#设置了导出目录:</span>
             <span class="hljs-comment"># export LICHEE_PLAT_OUT="${LICHEE_OUT_DIR}/${LICHEE_PLATFORM}/common" </span>
             <span class="hljs-comment">#导出plat 目录 .../lichee/out/android/common</span>
             <span class="hljs-comment">#export LICHEE_BR_OUT="${LICHEE_PLAT_OUT}/buildroot"</span>
             <span class="hljs-comment">#导出 br  目录 ../lichee/out/android/common/buildroot</span>

<strong><span class="hljs-keyword">if</span> [ <span class="hljs-variable">${module}</span> = <span class="hljs-string">"all"</span> ]; <span class="hljs-keyword">then</span>
    mklichee
<span class="hljs-keyword">elif</span> [ <span class="hljs-variable">${module}</span> = <span class="hljs-string">"boot"</span> ] ; <span class="hljs-keyword">then</span>
    mkboot
<span class="hljs-keyword">elif</span> [ <span class="hljs-variable">${module}</span> = <span class="hljs-string">"buildroot"</span> ] ; <span class="hljs-keyword">then</span>
    mkbr
<span class="hljs-keyword">elif</span> [ <span class="hljs-variable">${module}</span> = <span class="hljs-string">"kernel"</span> ] ; <span class="hljs-keyword">then</span>
    mkkernel
<span class="hljs-keyword">elif</span> [ <span class="hljs-variable">${module}</span> = <span class="hljs-string">"uboot"</span> ] ; <span class="hljs-keyword">then</span>
    mkuboot
<span class="hljs-keyword">elif</span> [ <span class="hljs-variable">${module}</span> = <span class="hljs-string">"clean"</span> ] ; <span class="hljs-keyword">then</span>
    mkclean
<span class="hljs-keyword">elif</span> [ <span class="hljs-variable">${module}</span> = <span class="hljs-string">"mrproer"</span> ] ; <span class="hljs-keyword">then</span>
    mkmrproer
<span class="hljs-keyword">elif</span> [ <span class="hljs-variable">${module}</span> = <span class="hljs-string">"distclean"</span> ] ; <span class="hljs-keyword">then</span>
    mkdistclean
<span class="hljs-keyword">else</span>
    mk_error <span class="hljs-string">"invalid module '<span class="hljs-variable">${module}</span>'"</span>
    <span class="hljs-keyword">exit</span> <span class="hljs-number">1</span>
<span class="hljs-keyword">fi</span>

<span class="hljs-keyword">exit</span> $?
</strong>#在 /home/work/CubieBoard2_SDK/lichee/buildroot/scripts
</code><pre name="code" class="prettyprint"><code class="hljs bash has-numbering"><span style="color:#FF0000;"><strong>mkcmd.sh 中</strong></span></code>
 
  
<code class="hljs php has-numbering"><span class="hljs-comment">#编译all</span>
<strong><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">mklichee</span><span class="hljs-params">()</span>
{</span>
    mksetting  <span class="hljs-comment">#打印编译信息</span>

    mk_info <span class="hljs-string">"build lichee ..."</span>  <span class="hljs-comment">#显示编译,带颜色显示</span></strong>

    <span class="hljs-comment">#编译交叉编译工具 ----这里就不分析了</span>
    <span class="hljs-comment">#编译内核 </span>
    <span class="hljs-comment">#编译uboot</span>
    <span class="hljs-comment">#编译文件系统</span>
<strong>    mkbr && mkkernel && mkuboot && mkrootfs
    [ $? -ne <span class="hljs-number">0</span> ] && <span class="hljs-keyword">return</span> <span class="hljs-number">1</span>

    mk_info <span class="hljs-string">"build lichee OK."</span>
}</strong></code>

编译内核所做的事情:
#,根据平台配置,编译内核 ,把编译好的内核,模块 以及.config 拷到了output 目录下
#把output 目录下的所有内容,LICHEE_PLAT_OUT
#也就是 …/lichee/out/android/common
编译uboot 所做的事情
# 根据平台选择编译脚本 —–其实这一步没起作用,最终用的build.sh
# 先make distclean ,再根据芯片 sun7i进行编译,生成u-boot.bin
#所有这里可以选择把distclean 去掉,节约编译时间
# 把u-boot.bin拷贝到了 lichee/out/android/common 目录下
编译rootfs所做的事情:
#根据linux 或者dragonboard 做相应的操作
# 而这 do nothing ,skip

//———————————-other ————————————

<code class="hljs bash has-numbering">function <span class="hljs-function"><span class="hljs-title">mkrootfs</span></span>()
{
    mk_info <span class="hljs-string">"build rootfs ..."</span>

    <span class="hljs-keyword">if</span> [ <span class="hljs-variable">${LICHEE_PLATFORM}</span> = <span class="hljs-string">"linux"</span> ] ; <span class="hljs-keyword">then</span>
        make O=<span class="hljs-variable">${LICHEE_BR_OUT}</span> -C <span class="hljs-variable">${LICHEE_BR_DIR}</span> target-generic-getty-busybox
        [ $? <span class="hljs-operator">-ne</span> <span class="hljs-number">0</span> ] && mk_error <span class="hljs-string">"build rootfs Failed"</span> && <span class="hljs-keyword">return</span> <span class="hljs-number">1</span>
        make O=<span class="hljs-variable">${LICHEE_BR_OUT}</span> -C <span class="hljs-variable">${LICHEE_BR_DIR}</span> target-finalize
        [ $? <span class="hljs-operator">-ne</span> <span class="hljs-number">0</span> ] && mk_error <span class="hljs-string">"build rootfs Failed"</span> && <span class="hljs-keyword">return</span> <span class="hljs-number">1</span>
        make O=<span class="hljs-variable">${LICHEE_BR_OUT}</span> -C <span class="hljs-variable">${LICHEE_BR_DIR}</span> LICHEE_GEN_ROOTFS=y rootfs-ext4
        [ $? <span class="hljs-operator">-ne</span> <span class="hljs-number">0</span> ] && mk_error <span class="hljs-string">"build rootfs Failed"</span> && <span class="hljs-keyword">return</span> <span class="hljs-number">1</span>
        cp <span class="hljs-variable">${LICHEE_BR_OUT}</span>/images/rootfs.ext4 <span class="hljs-variable">${LICHEE_PLAT_OUT}</span>
    <span class="hljs-keyword">elif</span> [ <span class="hljs-variable">${LICHEE_PLATFORM}</span> = <span class="hljs-string">"dragonboard"</span> ] ; <span class="hljs-keyword">then</span>
        <span class="hljs-built_in">echo</span> <span class="hljs-string">"Regenerating dragonboard Rootfs..."</span>
        (<span class="hljs-built_in">cd</span> <span class="hljs-variable">${LICHEE_BR_DIR}</span>/target/dragonboard; \
            <span class="hljs-keyword">if</span> [ ! <span class="hljs-operator">-d</span> <span class="hljs-string">"./rootfs"</span> ]; <span class="hljs-keyword">then</span> \
            <span class="hljs-built_in">echo</span> <span class="hljs-string">"extract dragonboard rootfs.tar.gz"</span>; \
            tar zxf rootfs.tar.gz; \
            <span class="hljs-keyword">fi</span> \
        )
        mkdir -p <span class="hljs-variable">${LICHEE_BR_DIR}</span>/target/dragonboard/rootfs/lib/modules
        rm -rf <span class="hljs-variable">${LICHEE_BR_DIR}</span>/target/dragonboard/rootfs/lib/modules/*
        cp -rf <span class="hljs-variable">${LICHEE_KERN_DIR}</span>/output/lib/modules/* <span class="hljs-variable">${LICHEE_BR_DIR}</span>/target/dragonboard/rootfs/lib/modules/
        (<span class="hljs-built_in">cd</span> <span class="hljs-variable">${LICHEE_BR_DIR}</span>/target/dragonboard; ./build.sh)
        cp <span class="hljs-variable">${LICHEE_BR_DIR}</span>/target/dragonboard/rootfs.ext4 <span class="hljs-variable">${LICHEE_PLAT_OUT}</span>
    <span class="hljs-keyword">else</span>
        mk_info <span class="hljs-string">"skip make rootfs for <span class="hljs-variable">${LICHEE_PLATFORM}</span>"</span>
    <span class="hljs-keyword">fi</span>

    mk_info <span class="hljs-string">"build rootfs OK."</span>
}</code>
<code class="hljs bash has-numbering"><span class="hljs-comment"># return true if used default config</span>
function <span class="hljs-function"><span class="hljs-title">check_uboot_defconf</span></span>()
{
    local defconf
    local ret=<span class="hljs-number">1</span>

    defconf=<span class="hljs-string">"<span class="hljs-variable">${LICHEE_CHIP}</span>_<span class="hljs-variable">${LICHEE_PLATFORM}</span>_<span class="hljs-variable">${LICHEE_BOARD}</span>"</span>
                     <span class="hljs-comment">#编译 sun7i_android</span>
                     <span class="hljs-comment">#这里少了一个.sh,脚本有问题:sun7i_android.sh</span>
    <span class="hljs-keyword">if</span> [ ! <span class="hljs-operator">-f</span> <span class="hljs-variable">${LICHEE_UBOOT_DIR}</span>/include/configs/<span class="hljs-variable">${defconf}</span> ] ; <span class="hljs-keyword">then</span>
        ret=<span class="hljs-number">0</span>
        defconf=<span class="hljs-string">"<span class="hljs-variable">${LICHEE_CHIP}</span>"</span>  <span class="hljs-comment">#这里少了一个.sh 应该为:sun7i.sh</span>
    <span class="hljs-keyword">fi</span>
    <span class="hljs-keyword">export</span> LICHEE_UBOOT_DEFCONF=<span class="hljs-variable">${defconf}</span>

    <span class="hljs-keyword">return</span> <span class="hljs-variable">${ret}</span>
}
function <span class="hljs-function"><span class="hljs-title">mkuboot</span></span>()
{
    mk_info <span class="hljs-string">"build u-boot ..."</span>

    local build_script

    <span class="hljs-keyword">if</span> check_uboot_defconf ; <span class="hljs-keyword">then</span> <span class="hljs-comment">#查看配置是是否存在,指定编译脚本</span>
        build_script=<span class="hljs-string">"build.sh"</span>  <span class="hljs-comment">#运行此编译脚本</span>
    <span class="hljs-keyword">else</span>
        build_script=<span class="hljs-string">"build_<span class="hljs-variable">${LICHEE_CHIP}</span>_<span class="hljs-variable">${LICHEE_PLATFORM}</span>_<span class="hljs-variable">${LICHEE_BOARD}</span>.sh"</span>
    <span class="hljs-keyword">fi</span>

    prepare_toolchain
    //运行编译脚本
    (<span class="hljs-built_in">cd</span> <span class="hljs-variable">${LICHEE_UBOOT_DIR}</span> && [ -x <span class="hljs-variable">${build_script}</span> ] && ./<span class="hljs-variable">${build_script}</span>)
    [ $? <span class="hljs-operator">-ne</span> <span class="hljs-number">0</span> ] && mk_error <span class="hljs-string">"build u-boot Failed"</span> && <span class="hljs-keyword">return</span> <span class="hljs-number">1</span>

    mk_info <span class="hljs-string">"build u-boot OK."</span>
}


<span class="hljs-comment">#关键的编译函数:</span>
function <span class="hljs-function"><span class="hljs-title">build_uboot</span></span>()
{
    <span class="hljs-keyword">case</span> <span class="hljs-string">"<span class="hljs-variable">$1</span>"</span> <span class="hljs-keyword">in</span>
        clean)
            make distclean CROSS_COMPILE=arm-linux-gnueabi-
            ;;
        *)
            make distclean CROSS_COMPILE=arm-linux-gnueabi-  <span class="hljs-comment">#清楚所有配置</span>
            make -j<span class="hljs-variable">${jobs}</span> <span class="hljs-variable">${LICHEE_CHIP}</span> CROSS_COMPILE=arm-linux-gnueabi-
                <span class="hljs-comment">#根据芯片 编译   这里是sun7i</span>
            [ $? <span class="hljs-operator">-ne</span> <span class="hljs-number">0</span> ] && <span class="hljs-keyword">exit</span> <span class="hljs-number">1</span>
            <span class="hljs-comment">#拷贝u-boot.bin 到输出目录</span>
            cp <span class="hljs-operator">-f</span> u-boot.bin ../out/<span class="hljs-variable">${LICHEE_PLATFORM}</span>/common/
            ;;
    <span class="hljs-keyword">esac</span>
}
</code>
<code class="hljs bash has-numbering">function mksetting()    <span class="hljs-comment">#打印要编译的信息</span>
{
    <span class="hljs-built_in">printf</span> <span class="hljs-string">"\n"</span>
    <span class="hljs-built_in">printf</span> <span class="hljs-string">"mkscript current setting:\n"</span>
    <span class="hljs-built_in">printf</span> <span class="hljs-string">"        Chip: <span class="hljs-variable">${LICHEE_CHIP}</span>\n"</span>
    <span class="hljs-built_in">printf</span> <span class="hljs-string">"    Platform: <span class="hljs-variable">${LICHEE_PLATFORM}</span>\n"</span>
    <span class="hljs-built_in">printf</span> <span class="hljs-string">"       Board: <span class="hljs-variable">${LICHEE_BOARD}</span>\n"</span>
    <span class="hljs-built_in">printf</span> <span class="hljs-string">"  Output Dir: <span class="hljs-variable">${LICHEE_PLAT_OUT}</span>\n"</span>
    <span class="hljs-built_in">printf</span> <span class="hljs-string">"\n"</span>
}
</code>

编译内核函数

<code class="hljs bash has-numbering">function <span class="hljs-function"><span class="hljs-title">mkkernel</span></span>()
{
    mk_info <span class="hljs-string">"build kernel ..."</span>
    local build_script
    <span class="hljs-keyword">if</span> check_kern_defconf ; <span class="hljs-keyword">then</span> <span class="hljs-comment">#检查设置,编译配置文件</span>
        <span class="hljs-keyword">if</span> [ <span class="hljs-variable">${LICHEE_PLATFORM}</span> = <span class="hljs-string">"linux"</span> ] ; <span class="hljs-keyword">then</span>
            build_script=<span class="hljs-string">"scripts/build_<span class="hljs-variable">${LICHEE_CHIP}</span>.sh"</span>
        <span class="hljs-keyword">else</span>
            build_script=<span class="hljs-string">"scripts/build_<span class="hljs-variable">${LICHEE_CHIP}</span>_<span class="hljs-variable">${LICHEE_PLATFORM}</span>.sh"</span>
            <span class="hljs-comment">#指定编译脚本 scripts/build_sun7i_android.sh</span>
        <span class="hljs-keyword">fi</span>
    <span class="hljs-keyword">else</span>
        build_script=<span class="hljs-string">"scripts/build_<span class="hljs-variable">${LICHEE_CHIP}</span>_<span class="hljs-variable">${LICHEE_PLATFORM}</span>_<span class="hljs-variable">${LICHEE_BOARD}</span>.sh"</span>
    <span class="hljs-keyword">fi</span>

    prepare_toolchain <span class="hljs-comment">#准备交叉编译工具,就是导出环境变量</span>
                      <span class="hljs-comment">#lichee/out/android/common/buildroot/external-toolchain</span>

    <span class="hljs-comment"># mark kernel .config belong to which platform</span>
    local config_mark=<span class="hljs-string">"<span class="hljs-variable">${LICHEE_KERN_DIR}</span>/.config.mark"</span> <span class="hljs-comment">#标记编译平台  android</span>
    <span class="hljs-keyword">if</span> [ <span class="hljs-operator">-f</span> <span class="hljs-variable">${config_mark}</span> ] ; <span class="hljs-keyword">then</span>
        <span class="hljs-keyword">if</span> ! grep -q <span class="hljs-string">"<span class="hljs-variable">${LICHEE_PLATFORM}</span>"</span> <span class="hljs-variable">${config_mark}</span> ; <span class="hljs-keyword">then</span>
            mk_info <span class="hljs-string">"clean last time build for different platform"</span>
            (<span class="hljs-built_in">cd</span> <span class="hljs-variable">${LICHEE_KERN_DIR}</span> && [ -x <span class="hljs-variable">${build_script}</span> ] && ./<span class="hljs-variable">${build_script}</span> <span class="hljs-string">"clean"</span>)
            <span class="hljs-built_in">echo</span> <span class="hljs-string">"<span class="hljs-variable">${LICHEE_PLATFORM}</span>"</span> > <span class="hljs-variable">${config_mark}</span>
        <span class="hljs-keyword">fi</span>
    <span class="hljs-keyword">else</span>
        <span class="hljs-built_in">echo</span> <span class="hljs-string">"<span class="hljs-variable">${LICHEE_PLATFORM}</span>"</span> > <span class="hljs-variable">${config_mark}</span>
    <span class="hljs-keyword">fi</span>
    <span class="hljs-comment">#进入内核目录 ,检查编译脚本是否可执行,执行该脚本</span>
    <span class="hljs-comment">#./scripts/build_sun7i_android.sh</span>
    (<span class="hljs-built_in">cd</span> <span class="hljs-variable">${LICHEE_KERN_DIR}</span> && [ -x <span class="hljs-variable">${build_script}</span> ] && ./<span class="hljs-variable">${build_script}</span>)
    [ $? <span class="hljs-operator">-ne</span> <span class="hljs-number">0</span> ] && mk_error <span class="hljs-string">"build kernel Failed"</span> && <span class="hljs-keyword">return</span> <span class="hljs-number">1</span>

    mk_info <span class="hljs-string">"build kernel OK."</span>
}
</code>脚本#build_sun7i_android.sh 如下
<code class="hljs bash has-numbering"><span class="hljs-shebang">#!/bin/bash</span>
<span class="hljs-comment">#</span>
<span class="hljs-comment"># scripts/build_sun7i_android.h</span>
<span class="hljs-comment">#</span>
<span class="hljs-comment"># (c) Copyright 2013</span>
<span class="hljs-comment"># Allwinner Technology Co., Ltd. <www.allwinnertech.com></span>
<span class="hljs-comment"># James Deng <csjamesdeng@allwinnertech.com></span>
<span class="hljs-comment">#</span>
<span class="hljs-comment"># This program is free software; you can redistribute it and/or modify</span>
<span class="hljs-comment"># it under the terms of the GNU General Public License as published by</span>
<span class="hljs-comment"># the Free Software Foundation; either version 2 of the License, or</span>
<span class="hljs-comment"># (at your option) any later version.</span>

<span class="hljs-keyword">set</span> <span class="hljs-operator">-e</span>

cpu_cores=`cat /proc/cpuinfo | grep <span class="hljs-string">"processor"</span> | wc <span class="hljs-operator">-l</span>`
<span class="hljs-keyword">if</span> [ <span class="hljs-variable">${cpu_cores}</span> -le <span class="hljs-number">8</span> ] ; <span class="hljs-keyword">then</span>
    jobs=<span class="hljs-variable">${cpu_cores}</span>
<span class="hljs-keyword">else</span>
    jobs=`expr <span class="hljs-variable">${cpu_cores}</span> / <span class="hljs-number">2</span>`
<span class="hljs-keyword">fi</span>

<span class="hljs-comment"># Setup common variables</span>
<span class="hljs-keyword">export</span> ARCH=arm
<span class="hljs-keyword">export</span> CROSS_COMPILE=arm-linux-gnueabi-
<span class="hljs-keyword">export</span> AS=<span class="hljs-variable">${CROSS_COMPILE}</span>as
<span class="hljs-keyword">export</span> LD=<span class="hljs-variable">${CROSS_COMPILE}</span>ld
<span class="hljs-keyword">export</span> CC=<span class="hljs-variable">${CROSS_COMPILE}</span>gcc
<span class="hljs-keyword">export</span> AR=<span class="hljs-variable">${CROSS_COMPILE}</span>ar
<span class="hljs-keyword">export</span> NM=<span class="hljs-variable">${CROSS_COMPILE}</span>nm
<span class="hljs-keyword">export</span> STRIP=<span class="hljs-variable">${CROSS_COMPILE}</span>strip
<span class="hljs-keyword">export</span> OBJCOPY=<span class="hljs-variable">${CROSS_COMPILE}</span>objcopy
<span class="hljs-keyword">export</span> OBJDUMP=<span class="hljs-variable">${CROSS_COMPILE}</span>objdump

KERNEL_VERSION=<span class="hljs-string">"3.4"</span>
LICHEE_KDIR=`<span class="hljs-built_in">pwd</span>`
LICHEE_MOD_DIR=<span class="hljs-variable">${LICHEE_KDIR}</span>/output/lib/modules/<span class="hljs-variable">${KERNEL_VERSION}</span>
<span class="hljs-keyword">export</span> LICHEE_KDIR

<span class="hljs-function"><span class="hljs-title">build_standby</span></span>()
{
    <span class="hljs-built_in">echo</span> <span class="hljs-string">"build standby"</span>

    <span class="hljs-comment"># If .config is newer than include/config/auto.conf, someone tinkered</span>
    <span class="hljs-comment"># with it and forgot to run make oldconfig.</span>
    <span class="hljs-comment"># if auto.conf.cmd is missing then we are probably in a cleaned tree so</span>
    <span class="hljs-comment"># we execute the config step to be sure to catch updated Kconfig files</span>
    <span class="hljs-keyword">if</span> [ .config -nt include/config/auto.conf -o \
        ! <span class="hljs-operator">-f</span> include/config/auto.conf.cmd ] ; <span class="hljs-keyword">then</span>
        <span class="hljs-built_in">echo</span> <span class="hljs-string">"Generating autoconf.h for standby"</span>
        make <span class="hljs-operator">-f</span> Makefile ARCH=arm CROSS_COMPILE=<span class="hljs-variable">${CROSS_COMPILE}</span> \
            silentoldconfig
    <span class="hljs-keyword">fi</span>
    make ARCH=<span class="hljs-variable">${ARCH}</span> CROSS_COMPILE=<span class="hljs-variable">${CROSS_COMPILE}</span> KDIR=<span class="hljs-variable">${LICHEE_KDIR}</span> \
        -C <span class="hljs-variable">${LICHEE_KDIR}</span>/arch/arm/mach-sun7i/pm/standby all
}

NAND_ROOT=<span class="hljs-variable">${LICHEE_KDIR}</span>/modules/nand

<span class="hljs-function"><span class="hljs-title">build_nand_lib</span></span>()
{
    <span class="hljs-built_in">echo</span> <span class="hljs-string">"build nand library <span class="hljs-variable">${NAND_ROOT}</span>/lib"</span>
    <span class="hljs-keyword">if</span> [ <span class="hljs-operator">-d</span> <span class="hljs-variable">${NAND_ROOT}</span>/lib ]; <span class="hljs-keyword">then</span>
        <span class="hljs-built_in">echo</span> <span class="hljs-string">"build nand library now"</span>
        make -C modules/nand/lib clean <span class="hljs-number">2</span>> /dev/null 
        make -C modules/nand/lib lib install
    <span class="hljs-keyword">else</span>
        <span class="hljs-built_in">echo</span> <span class="hljs-string">"build nand with existing library"</span>
    <span class="hljs-keyword">fi</span>
}

HDMI_ROOT=<span class="hljs-variable">${LICHEE_KDIR}</span>/drivers/video/sun7i/hdmi/aw
<span class="hljs-function"><span class="hljs-title">build_hdmi_lib</span></span>()
{
    <span class="hljs-built_in">echo</span> <span class="hljs-string">"build hdcp library <span class="hljs-variable">${HDMI_ROOT}</span>/hdcp"</span>
    <span class="hljs-keyword">if</span> [ <span class="hljs-operator">-d</span> <span class="hljs-variable">${HDMI_ROOT}</span>/hdcp ]; <span class="hljs-keyword">then</span>
        <span class="hljs-built_in">echo</span> <span class="hljs-string">"build hdcp library now"</span>
<span class="hljs-comment">#       make -C ${HDMI_ROOT}/hdcp clean  2>/dev/null</span>
        make -C <span class="hljs-variable">${HDMI_ROOT}</span>/hdcp install
    <span class="hljs-keyword">else</span>
        <span class="hljs-built_in">echo</span> <span class="hljs-string">"build hdcp with existing library"</span>
    <span class="hljs-keyword">fi</span>
}

<span class="hljs-function"><span class="hljs-title">build_kernel</span></span>()
{
    <span class="hljs-built_in">echo</span> <span class="hljs-string">"Building kernel"</span>

    <span class="hljs-keyword">if</span> [ ! <span class="hljs-operator">-f</span> .config ] ; <span class="hljs-keyword">then</span> <span class="hljs-comment">#如果配置文件不存在,则拷贝编译脚本</span>
        <span class="hljs-built_in">printf</span> <span class="hljs-string">"\n\033[0;31;1mUsing default config ...\033[0m\n\n"</span>
        cp arch/arm/configs/<span class="hljs-variable">${LICHEE_KERN_DEFCONF}</span> .config
    <span class="hljs-keyword">fi</span>

    build_standby
    <span class="hljs-comment">#编译内核</span>
    make ARCH=arm CROSS_COMPILE=<span class="hljs-variable">${CROSS_COMPILE}</span> -j<span class="hljs-variable">${jobs}</span> uImage modules

    <span class="hljs-comment">#二进制拷贝</span>
    <span class="hljs-variable">${OBJCOPY}</span> -R .note.gnu.build-id -S -O binary vmlinux bImage

    <span class="hljs-comment">#删除原来的输出目录</span>
    rm -rf output
    <span class="hljs-comment">#创建模块输出目录</span>
    mkdir -p <span class="hljs-variable">${LICHEE_MOD_DIR}</span>

    <span class="hljs-comment">#拷贝内核文件</span>
    cp bImage output/
    <span class="hljs-comment">#把配置文件也拷贝到了输出目录</span>
    cp .config output/

    <span class="hljs-comment">#把所有 模块拷贝到了 output/lib/modules/3.4/</span>
    <span class="hljs-keyword">for</span> file <span class="hljs-keyword">in</span> $(find drivers sound crypto block fs security net -name <span class="hljs-string">"*.ko"</span>); <span class="hljs-keyword">do</span>
        cp <span class="hljs-variable">$file</span> <span class="hljs-variable">${LICHEE_MOD_DIR}</span>
    <span class="hljs-keyword">done</span>
    cp <span class="hljs-operator">-f</span> Module.symvers <span class="hljs-variable">${LICHEE_MOD_DIR}</span>

    <span class="hljs-comment">#cp drivers/net/wireless/bcm4330/firmware/bcm4330.bin ${LICHEE_MOD_DIR}</span>
    <span class="hljs-comment">#cp drivers/net/wireless/bcm4330/firmware/bcm4330.hcd ${LICHEE_MOD_DIR}</span>
    <span class="hljs-comment">#cp drivers/net/wireless/bcm4330/firmware/nvram.txt ${LICHEE_MOD_DIR}/bcm4330_nvram.txt</span>
}

<span class="hljs-function"><span class="hljs-title">build_modules</span></span>()
{
    <span class="hljs-built_in">echo</span> <span class="hljs-string">"Building modules"</span>

    <span class="hljs-keyword">if</span> [ ! <span class="hljs-operator">-f</span> include/generated/utsrelease.h ]; <span class="hljs-keyword">then</span>
        <span class="hljs-built_in">printf</span> <span class="hljs-string">"Please build kernel first\n"</span>
        <span class="hljs-keyword">exit</span> <span class="hljs-number">1</span>
    <span class="hljs-keyword">fi</span>

    make -C modules/example LICHEE_MOD_DIR=<span class="hljs-variable">${LICHEE_MOD_DIR}</span> LICHEE_KDIR=<span class="hljs-variable">${LICHEE_KDIR}</span> \
        install

    build_nand_lib
    make -C modules/nand LICHEE_MOD_DIR=<span class="hljs-variable">${LICHEE_MOD_DIR}</span> LICHEE_KDIR=<span class="hljs-variable">${LICHEE_KDIR}</span> \
        install

    build_hdmi_lib
    make -C drivers/video/sun7i/hdmi/aw LICHEE_MOD_DIR=<span class="hljs-variable">${LICHEE_MOD_DIR}</span> LICHEE_KDIR=<span class="hljs-variable">${LICHEE_KDIR}</span> \
        install

    (
    <span class="hljs-keyword">export</span> LANG=en_US.UTF-<span class="hljs-number">8</span>
    <span class="hljs-built_in">unset</span> LANGUAGE
    make -C modules/mali LICHEE_MOD_DIR=<span class="hljs-variable">${LICHEE_MOD_DIR}</span> LICHEE_KDIR=<span class="hljs-variable">${LICHEE_KDIR}</span> \
        install
    )

    <span class="hljs-comment">##build ar6302 sdio wifi module</span>
    <span class="hljs-comment">#make -C modules/wifi/ar6302/AR6K_SDK_ISC.build_3.1_RC.329/host CROSS_COMPILE=${CROSS_COMPILE} \</span>
    <span class="hljs-comment">#    ARCH=arm KERNEL_DIR=${LICHEE_KDIR} INSTALL_DIR=${LICHEE_MOD_DIR} \</span>
    <span class="hljs-comment">#    all install</span>
    <span class="hljs-comment">##build ar6003 sdio wifi module</span>
    <span class="hljs-comment">#make -C modules/wifi/ar6003/AR6kSDK.build_3.1_RC.514/host CROSS_COMPILE=${CROSS_COMPILE} \</span>
    <span class="hljs-comment">#    ARCH=arm KERNEL_DIR=${LICHEE_KDIR} INSTALL_DIR=${LICHEE_MOD_DIR} \</span>
    <span class="hljs-comment">#    all</span>
    <span class="hljs-comment">##build usi-bmc4329 sdio wifi module</span>
    <span class="hljs-comment">#make -C modules/wifi/usi-bcm4329/v4.218.248.15/open-src/src/dhd/linux \</span>
    <span class="hljs-comment">#    CROSS_COMPILE=${CROSS_COMPILE} ARCH=arm LINUXVER=${KERNEL_VERSION} \</span>
    <span class="hljs-comment">#    LICHEE_MOD_DIR=${LICHEE_MOD_DIR} LINUXDIR=${LICHEE_KDIR} \</span>
    <span class="hljs-comment">#    INSTALL_DIR=${LICHEE_MOD_DIR} dhd-cdc-sdmmc-gpl</span>
    <span class="hljs-comment">##build bcm40181 sdio wifi module 5.90.125.69.2</span>
    <span class="hljs-comment">#make -C modules/wifi/bcm40181/5.90.125.69.2/open-src/src/dhd/linux \</span>
    <span class="hljs-comment">#    CROSS_COMPILE=${CROSS_COMPILE} ARCH=arm LINUXVER=${KERNEL_VERSION} \</span>
    <span class="hljs-comment">#    LICHEE_MOD_DIR=${LICHEE_MOD_DIR} LINUXDIR=${LICHEE_KDIR} \</span>
    <span class="hljs-comment">#    INSTALL_DIR=${LICHEE_MOD_DIR} OEM_ANDROID=1 dhd-cdc-sdmmc-gpl</span>
    <span class="hljs-comment">##build bcm40183 sdio wifi module</span>
    <span class="hljs-comment">#make -C modules/wifi/bcm40183/5.90.125.95.3/open-src/src/dhd/linux \</span>
    <span class="hljs-comment">#    CROSS_COMPILE=${CROSS_COMPILE} ARCH=arm LINUXVER=${KERNEL_VERSION} \</span>
    <span class="hljs-comment">#    LICHEE_MOD_DIR=${LICHEE_MOD_DIR} LINUXDIR=${LICHEE_KDIR} \</span>
    <span class="hljs-comment">#    INSTALL_DIR=${LICHEE_MOD_DIR} OEM_ANDROID=1 dhd-cdc-sdmmc-gpl</span>
}

<span class="hljs-function"><span class="hljs-title">gen_output</span></span>()
{
    <span class="hljs-built_in">echo</span> <span class="hljs-string">"Copy output to target ..."</span>
    rm -rf <span class="hljs-variable">${LICHEE_PLAT_OUT}</span>/lib
    cp -rf <span class="hljs-variable">${LICHEE_KDIR}</span>/output/* <span class="hljs-variable">${LICHEE_PLAT_OUT}</span>
}

<span class="hljs-function"><span class="hljs-title">clean_kernel</span></span>()
{
    <span class="hljs-built_in">echo</span> <span class="hljs-string">"Cleaning kernel"</span>
    make distclean
    rm -rf output/*
}

<span class="hljs-function"><span class="hljs-title">clean_modules</span></span>()
{
    <span class="hljs-built_in">echo</span> <span class="hljs-string">"Cleaning modules"</span>
    make -C modules/example LICHEE_MOD_DIR=<span class="hljs-variable">${LICHEE_MOD_DIR}</span> LICHEE_KDIR=<span class="hljs-variable">${LICHEE_KDIR}</span> clean

    (
    <span class="hljs-keyword">export</span> LANG=en_US.UTF-<span class="hljs-number">8</span>
    <span class="hljs-built_in">unset</span> LANGUAGE
    make -C modules/mali LICHEE_MOD_DIR=<span class="hljs-variable">${LICHEE_MOD_DIR}</span> LICHEE_KDIR=<span class="hljs-variable">${LICHEE_KDIR}</span> clean
    )

    <span class="hljs-comment">##build ar6302 sdio wifi module</span>
    <span class="hljs-comment">#make -C modules/wifi/ar6302/AR6K_SDK_ISC.build_3.1_RC.329/host CROSS_COMPILE=${CROSS_COMPILE} \</span>
    <span class="hljs-comment">#    ARCH=arm KERNEL_DIR=${LICHEE_KDIR} INSTALL_DIR=${LICHEE_MOD_DIR} \</span>
    <span class="hljs-comment">#    clean</span>
    <span class="hljs-comment">##build ar6003 sdio wifi module</span>
    <span class="hljs-comment">#make -C modules/wifi/ar6003/AR6kSDK.build_3.1_RC.514/host CROSS_COMPILE=${CROSS_COMPILE} \</span>
    <span class="hljs-comment">#    ARCH=arm KERNEL_DIR=${LICHEE_KDIR} INSTALL_DIR=${LICHEE_MOD_DIR} \</span>
    <span class="hljs-comment">#    clean</span>
    <span class="hljs-comment">##build usi-bmc4329 sdio wifi module</span>
    <span class="hljs-comment">#make -C modules/wifi/usi-bcm4329/v4.218.248.15/open-src/src/dhd/linux \</span>
    <span class="hljs-comment">#    CROSS_COMPILE=${CROSS_COMPILE} ARCH=arm LINUXVER=${KERNEL_VERSION} \</span>
    <span class="hljs-comment">#    LICHEE_MOD_DIR=${LICHEE_MOD_DIR} LINUXDIR=${LICHEE_KDIR} \</span>
    <span class="hljs-comment">#    INSTALL_DIR=${LICHEE_MOD_DIR} clean</span>
    <span class="hljs-comment">##build bcm40181 sdio wifi module 5.90.125.69.2</span>
    <span class="hljs-comment">#make -C modules/wifi/bcm40181/5.90.125.69.2/open-src/src/dhd/linux \</span>
    <span class="hljs-comment">#    CROSS_COMPILE=${CROSS_COMPILE} ARCH=arm LINUXVER=${KERNEL_VERSION} \</span>
    <span class="hljs-comment">#    LICHEE_MOD_DIR=${LICHEE_MOD_DIR} LINUXDIR=${LICHEE_KDIR} \</span>
    <span class="hljs-comment">#    INSTALL_DIR=${LICHEE_MOD_DIR} clean</span>
    <span class="hljs-comment">##build bcm40183 sdio wifi module</span>
    <span class="hljs-comment">#make -C modules/wifi/bcm40183/5.90.125.95.3/open-src/src/dhd/linux \</span>
    <span class="hljs-comment">#    CROSS_COMPILE=${CROSS_COMPILE} ARCH=arm LINUXVER=${KERNEL_VERSION} \</span>
    <span class="hljs-comment">#    LICHEE_MOD_DIR=${LICHEE_MOD_DIR} LINUXDIR=${LICHEE_KDIR} \</span>
    <span class="hljs-comment">#    INSTALL_DIR=${LICHEE_MOD_DIR} OEM_ANDROID=1 clean</span>
}

<span class="hljs-keyword">case</span> <span class="hljs-string">"<span class="hljs-variable">$1</span>"</span> <span class="hljs-keyword">in</span>
    kernel)
        build_kernel
        ;;
    modules)
        build_modules
        ;;
    clean)
        clean_modules
        clean_kernel
        ;;
    *)
        build_kernel  <span class="hljs-comment">#编译内核 ,把编译好的内核,模块 拷到了output 目录下</span>
        build_modules <span class="hljs-comment">#变所有模块</span>
        gen_output   <span class="hljs-comment">#把output 目录下的所有内核,LICHEE_PLAT_OUT</span>
                     <span class="hljs-comment">#也就是 .../lichee/out/android/common</span>
        ;;
<span class="hljs-keyword">esac</span></code>
<ul style="display: block;" class="pre-numbering"><li>
</li></ul>

http://blog.csdn.net/jiege6699/article/details/44341551

rootroot@cm-System-Product-Name:/home/wwt/linux_r16$ tar zxvf lichee_parrotv1.1_20161202.tar.gz rootroot@cm-System-Product-Name:/home/wwt/linux_r16$ rootroot@cm-System-Product-Name:/home/wwt/linux_r16$ ll 总用量 10786992 drwx------ 4 rootroot rootroot 4096 5月 2 14:48 ./ drwxrwxrwx 18 rootroot rootroot 4096 5月 2 13:50 ../ -rwx------ 1 rootroot rootroot 8557328646 12月 2 16:08 android_parrotv1.1_20161202.tar.gz* drwxrwxr-x 7 rootroot rootroot 4096 12月 2 15:52 lichee/ -rwx------ 1 rootroot rootroot 2488523424 12月 2 16:15 lichee_parrotv1.1_20161202.tar.gz* drwxrwxr-x 8 rootroot rootroot 4096 5月 2 14:40 parrotv1p1_lichee/ rootroot@cm-System-Product-Name:/home/wwt/linux_r16$ rootroot@cm-System-Product-Name:/home/wwt/linux_r16$ rootroot@cm-System-Product-Name:/home/wwt/linux_r16$ rootroot@cm-System-Product-Name:/home/wwt/linux_r16$ rootroot@cm-System-Product-Name:/home/wwt/linux_r16$ cd lichee/ rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ ll 总用量 36 drwxrwxr-x 7 rootroot rootroot 4096 12月 2 15:52 ./ drwx------ 4 rootroot rootroot 4096 5月 2 14:48 ../ drwxrwxr-x 8 rootroot rootroot 4096 12月 2 15:51 brandy/ drwxrwxr-x 15 rootroot rootroot 4096 12月 2 15:52 buildroot/ -r-xr-xr-x 1 rootroot rootroot 55 12月 2 15:52 build.sh* drwxrwxr-x 26 rootroot rootroot 4096 12月 2 15:52 linux-3.4/ -r--r--r-- 1 rootroot rootroot 232 12月 2 15:52 README drwxrwxr-x 6 rootroot rootroot 4096 12月 2 15:51 .repo/ drwxrwxr-x 7 rootroot rootroot 4096 12月 2 15:52 tools/ rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ ./build.sh config Welcome to mkscript setup progress All available chips: 0. sun8iw5p1 Choice: 0 All available platforms: 0. android 1. dragonboard 2. linux 3. tina Choice: 2 All available kernel: 0. linux-3.4 Choice: 0 All available boards: 0. bell-one 1. evb 2. evb-20 3. evb-30 4. evb-rtl8723bs 5. sc3813r Choice: 3 rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ ./build.sh KCONFIG_AUTOCONFIG=/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/buildroot-config/auto.conf KCONFIG_AUTOHEADER=/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/buildroot-config/autoconf.h KCONFIG_TRISTATE=/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/buildroot-config/tristate.config BUILDROOT_CONFIG=/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/.config /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/buildroot-config/conf --silentoldconfig Config.in # # make dependencies written to .auto.deps # ATTENTION buildroot devels! # See top of this file before playing with this auto-preprequisites! # make[1]:正在离开目录 `/home/wwt/linux_r16/lichee/buildroot' You must install 'makeinfo' on your build machine makeinfo is usually part of the texinfo package in your distribution make: *** [dependencies] 错误 1 make:离开目录“/home/wwt/linux_r16/lichee/buildroot” ERROR: build buildroot Failed rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ d/buildroot-config/conf.o /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/buildroot-config/zconf.tab.o -o /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/buildroot-config/conf rm /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/buildroot-config/zconf.tab.c make[1]:正在离开目录 `/home/wwt/linux_r16/lichee/buildroot/package/config' # # configuration written to /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/.config # make:离开目录“/home/wwt/linux_r16/lichee/buildroot” make:进入目录'/home/wwt/linux_r16/lichee/buildroot' /usr/bin/make -j6 O=/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot silentoldconfig make[1]: 正在进入目录 `/home/wwt/linux_r16/lichee/buildroot' GEN /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/Makefile KCONFIG_AUTOCONFIG=/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/buildroot-config/auto.conf KCONFIG_AUTOHEADER=/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/buildroot-config/autoconf.h KCONFIG_TRISTATE=/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/buildroot-config/tristate.config BUILDROOT_CONFIG=/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/.config /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/buildroot-config/conf --silentoldconfig Config.in # # make dependencies written to .auto.deps # ATTENTION buildroot devels! # See top of this file before playing with this auto-preprequisites! # make[1]:正在离开目录 `/home/wwt/linux_r16/lichee/buildroot' You must install 'makeinfo' on your build machine makeinfo is usually part of the texinfo package in your distribution make: *** [dependencies] 错误 1 make:离开目录“/home/wwt/linux_r16/lichee/buildroot” ERROR: build buildroot Failed rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ sudo apt-get install texinfo [sudo] password for rootroot: 正在读取软件包列表... 完成 正在分析软件包的依赖关系树 正在读取状态信息... 完成 下列软件包是自动安装的并且现在不需要了: fakeroot libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libfakeroot Use 'apt-get autoremove' to remove them. 将会安装下列额外的软件包: libencode-locale-perl libfile-listing-perl libfont-afm-perl libhtml-form-perl libhtml-format-perl libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl libhttp-cookies-perl libhttp-daemon-perl libhttp-date-perl libhttp-message-perl libhttp-negotiate-perl libintl-perl libio-html-perl liblwp-mediatypes-perl liblwp-protocol-https-perl libnet-http-perl libtext-unidecode-perl libwww-perl libwww-robotrules-perl libxml-libxml-perl libxml-namespacesupport-perl libxml-parser-perl libxml-sax-base-perl libxml-sax-expat-perl libxml-sax-perl 建议安装的软件包: libdata-dump-perl libintl-xs-perl libcrypt-ssleay-perl libauthen-ntlm-perl texinfo-doc-nonfree 下列【新】软件包将被安装: libencode-locale-perl libfile-listing-perl libfont-afm-perl libhtml-form-perl libhtml-format-perl libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl libhttp-cookies-perl libhttp-daemon-perl libhttp-date-perl libhttp-message-perl libhttp-negotiate-perl libintl-perl libio-html-perl liblwp-mediatypes-perl liblwp-protocol-https-perl libnet-http-perl libtext-unidecode-perl libwww-perl libwww-robotrules-perl libxml-libxml-perl libxml-namespacesupport-perl libxml-parser-perl libxml-sax-base-perl libxml-sax-expat-perl libxml-sax-perl texinfo 升级了 0 个软件包,新安装了 28 个软件包,要卸载 0 个软件包,有 737 个软件包未被升级。 需要下载 3,425 kB 的软件包。 解压缩后会消耗掉 13.0 MB 的额外空间。 您希望继续执行吗? [Y/n] y 获取:1 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libencode-locale-perl all 1.03-1 [12.4 kB] 获取:2 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libhttp-date-perl all 6.02-1 [10.4 kB] 获取:3 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libfile-listing-perl all 6.04-1 [9,774 B] 获取:4 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libfont-afm-perl all 1.20-1 [14.3 kB] 获取:5 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libhtml-tagset-perl all 3.20-2 [13.5 kB] 获取:6 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libhtml-parser-perl amd64 3.71-1build1 [98.2 kB] 获取:7 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libio-html-perl all 1.00-1 [15.7 kB] 获取:8 http://cn.archive.ubuntu.com/ubuntu/ trusty/main liblwp-mediatypes-perl all 6.02-1 [21.7 kB] 获取:9 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libhttp-message-perl all 6.06-1 [78.7 kB] 获取:10 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libhtml-form-perl all 6.03-1 [23.5 kB] 获取:11 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libhtml-tree-perl all 5.03-1 [215 kB] 获取:12 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libhtml-format-perl all 2.11-1 [44.7 kB] 获取:13 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libhttp-cookies-perl all 6.00-2 [23.3 kB] 获取:14 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libhttp-daemon-perl all 6.01-1 [17.0 kB] 获取:15 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libhttp-negotiate-perl all 6.00-2 [13.4 kB] 获取:16 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libintl-perl all 1.23-1build1 [1,204 kB] 获取:17 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libnet-http-perl all 6.06-1 [24.2 kB] 获取:18 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libwww-robotrules-perl all 6.01-1 [14.1 kB] 获取:19 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libwww-perl all 6.05-2 [146 kB] 获取:20 http://cn.archive.ubuntu.com/ubuntu/ trusty-updates/main liblwp-protocol-https-perl all 6.04-2ubuntu0.1 [7,644 B] 获取:21 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libtext-unidecode-perl all 0.04-2 [115 kB] 获取:22 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libxml-namespacesupport-perl all 1.11-1 [13.2 kB] 获取:23 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libxml-sax-base-perl all 1.07-1 [21.5 kB] 获取:24 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libxml-sax-perl all 0.99+dfsg-2ubuntu1 [64.6 kB] 获取:25 http://cn.archive.ubuntu.com/ubuntu/ trusty-updates/main libxml-libxml-perl amd64 2.0108+dfsg-1ubuntu0.1 [337 kB] 获取:26 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libxml-parser-perl amd64 2.41-1build3 [294 kB] 获取:27 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libxml-sax-expat-perl all 0.40-2 [11.5 kB] 获取:28 http://cn.archive.ubuntu.com/ubuntu/ trusty/main texinfo amd64 5.2.0.dfsg.1-2 [561 kB] 下载 3,425 kB,耗时 2秒 (1,303 kB/s) Selecting previously unselected package libencode-locale-perl. (正在读取数据库 ... 系统当前共安装有 213805 个文件和目录。) Preparing to unpack .../libencode-locale-perl_1.03-1_all.deb ... Unpacking libencode-locale-perl (1.03-1) ... Selecting previously unselected package libhttp-date-perl. Preparing to unpack .../libhttp-date-perl_6.02-1_all.deb ... Unpacking libhttp-date-perl (6.02-1) ... Selecting previously unselected package libfile-listing-perl. Preparing to unpack .../libfile-listing-perl_6.04-1_all.deb ... Unpacking libfile-listing-perl (6.04-1) ... Selecting previously unselected package libfont-afm-perl. Preparing to unpack .../libfont-afm-perl_1.20-1_all.deb ... Unpacking libfont-afm-perl (1.20-1) ... Selecting previously unselected package libhtml-tagset-perl. Preparing to unpack .../libhtml-tagset-perl_3.20-2_all.deb ... Unpacking libhtml-tagset-perl (3.20-2) ... Selecting previously unselected package libhtml-parser-perl. Preparing to unpack .../libhtml-parser-perl_3.71-1build1_amd64.deb ... Unpacking libhtml-parser-perl (3.71-1build1) ... Selecting previously unselected package libio-html-perl. Preparing to unpack .../libio-html-perl_1.00-1_all.deb ... Unpacking libio-html-perl (1.00-1) ... Selecting previously unselected package liblwp-mediatypes-perl. Preparing to unpack .../liblwp-mediatypes-perl_6.02-1_all.deb ... Unpacking liblwp-mediatypes-perl (6.02-1) ... Selecting previously unselected package libhttp-message-perl. Preparing to unpack .../libhttp-message-perl_6.06-1_all.deb ... Unpacking libhttp-message-perl (6.06-1) ... Selecting previously unselected package libhtml-form-perl. Preparing to unpack .../libhtml-form-perl_6.03-1_all.deb ... Unpacking libhtml-form-perl (6.03-1) ... Selecting previously unselected package libhtml-tree-perl. Preparing to unpack .../libhtml-tree-perl_5.03-1_all.deb ... Unpacking libhtml-tree-perl (5.03-1) ... Selecting previously unselected package libhtml-format-perl. Preparing to unpack .../libhtml-format-perl_2.11-1_all.deb ... Unpacking libhtml-format-perl (2.11-1) ... Selecting previously unselected package libhttp-cookies-perl. Preparing to unpack .../libhttp-cookies-perl_6.00-2_all.deb ... Unpacking libhttp-cookies-perl (6.00-2) ... Selecting previously unselected package libhttp-daemon-perl. Preparing to unpack .../libhttp-daemon-perl_6.01-1_all.deb ... Unpacking libhttp-daemon-perl (6.01-1) ... Selecting previously unselected package libhttp-negotiate-perl. Preparing to unpack .../libhttp-negotiate-perl_6.00-2_all.deb ... Unpacking libhttp-negotiate-perl (6.00-2) ... Selecting previously unselected package libintl-perl. Preparing to unpack .../libintl-perl_1.23-1build1_all.deb ... Unpacking libintl-perl (1.23-1build1) ... Selecting previously unselected package libnet-http-perl. Preparing to unpack .../libnet-http-perl_6.06-1_all.deb ... Unpacking libnet-http-perl (6.06-1) ... Selecting previously unselected package libwww-robotrules-perl. Preparing to unpack .../libwww-robotrules-perl_6.01-1_all.deb ... Unpacking libwww-robotrules-perl (6.01-1) ... Selecting previously unselected package libwww-perl. Preparing to unpack .../libwww-perl_6.05-2_all.deb ... Unpacking libwww-perl (6.05-2) ... Selecting previously unselected package liblwp-protocol-https-perl. Preparing to unpack .../liblwp-protocol-https-perl_6.04-2ubuntu0.1_all.deb ... Unpacking liblwp-protocol-https-perl (6.04-2ubuntu0.1) ... Selecting previously unselected package libtext-unidecode-perl. Preparing to unpack .../libtext-unidecode-perl_0.04-2_all.deb ... Unpacking libtext-unidecode-perl (0.04-2) ... Selecting previously unselected package libxml-namespacesupport-perl. Preparing to unpack .../libxml-namespacesupport-perl_1.11-1_all.deb ... Unpacking libxml-namespacesupport-perl (1.11-1) ... Selecting previously unselected package libxml-sax-base-perl. Preparing to unpack .../libxml-sax-base-perl_1.07-1_all.deb ... Unpacking libxml-sax-base-perl (1.07-1) ... Selecting previously unselected package libxml-sax-perl. Preparing to unpack .../libxml-sax-perl_0.99+dfsg-2ubuntu1_all.deb ... Unpacking libxml-sax-perl (0.99+dfsg-2ubuntu1) ... Selecting previously unselected package libxml-libxml-perl. Preparing to unpack .../libxml-libxml-perl_2.0108+dfsg-1ubuntu0.1_amd64.deb ... Unpacking libxml-libxml-perl (2.0108+dfsg-1ubuntu0.1) ... Selecting previously unselected package libxml-parser-perl. Preparing to unpack .../libxml-parser-perl_2.41-1build3_amd64.deb ... Unpacking libxml-parser-perl (2.41-1build3) ... Selecting previously unselected package libxml-sax-expat-perl. Preparing to unpack .../libxml-sax-expat-perl_0.40-2_all.deb ... Unpacking libxml-sax-expat-perl (0.40-2) ... Selecting previously unselected package texinfo. Preparing to unpack .../texinfo_5.2.0.dfsg.1-2_amd64.deb ... Unpacking texinfo (5.2.0.dfsg.1-2) ... Processing triggers for man-db (2.6.7.1-1) ... Processing triggers for doc-base (0.10.5) ... Processing 1 added doc-base file... 正在设置 libencode-locale-perl (1.03-1) ... 正在设置 libhttp-date-perl (6.02-1) ... 正在设置 libfile-listing-perl (6.04-1) ... 正在设置 libfont-afm-perl (1.20-1) ... 正在设置 libhtml-tagset-perl (3.20-2) ... 正在设置 libhtml-parser-perl (3.71-1build1) ... 正在设置 libio-html-perl (1.00-1) ... 正在设置 liblwp-mediatypes-perl (6.02-1) ... 正在设置 libhttp-message-perl (6.06-1) ... 正在设置 libhtml-form-perl (6.03-1) ... 正在设置 libhtml-tree-perl (5.03-1) ... 正在设置 libhtml-format-perl (2.11-1) ... 正在设置 libhttp-cookies-perl (6.00-2) ... 正在设置 libhttp-daemon-perl (6.01-1) ... 正在设置 libhttp-negotiate-perl (6.00-2) ... 正在设置 libintl-perl (1.23-1build1) ... 正在设置 libnet-http-perl (6.06-1) ... 正在设置 libwww-robotrules-perl (6.01-1) ... 正在设置 libtext-unidecode-perl (0.04-2) ... 正在设置 libxml-namespacesupport-perl (1.11-1) ... 正在设置 libxml-sax-base-perl (1.07-1) ... 正在设置 libxml-sax-perl (0.99+dfsg-2ubuntu1) ... update-perl-sax-parsers: Registering Perl SAX parser XML::SAX::PurePerl with priority 10... update-perl-sax-parsers: Updating overall Perl SAX parser modules info file... Creating config file /etc/perl/XML/SAX/ParserDetails.ini with new version 正在设置 libxml-libxml-perl (2.0108+dfsg-1ubuntu0.1) ... update-perl-sax-parsers: Registering Perl SAX parser XML::LibXML::SAX::Parser with priority 50... update-perl-sax-parsers: Registering Perl SAX parser XML::LibXML::SAX with priority 50... update-perl-sax-parsers: Updating overall Perl SAX parser modules info file... Replacing config file /etc/perl/XML/SAX/ParserDetails.ini with new version 正在设置 texinfo (5.2.0.dfsg.1-2) ... Running mktexlsr. This may take some time. ... done. 正在设置 libwww-perl (6.05-2) ... 正在设置 liblwp-protocol-https-perl (6.04-2ubuntu0.1) ... 正在设置 libxml-parser-perl (2.41-1build3) ... 正在设置 libxml-sax-expat-perl (0.40-2) ... update-perl-sax-parsers: Registering Perl SAX parser XML::SAX::Expat with priority 50... update-perl-sax-parsers: Updating overall Perl SAX parser modules info file... Replacing config file /etc/perl/XML/SAX/ParserDetails.ini with new version rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ ./build.sh http://blog.csdn.net/linuxarmsummary/article/details/12775457 msgfmt包错误 makeinfo 包错误 e.o -MD -MP -MF .deps/execute.Tpo -c -o execute.o execute.c /usr/bin/gcc -std=gnu99 -I. -O2 -I/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/host/include -I/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/host/usr/include -MT exitfail.o -MD -MP -MF .deps/exitfail.Tpo -c -o exitfail.o exitfail.c In file included from clean-temp.h:22:0, from clean-temp.c:23: ./stdio.h:456:1: error: 'gets' undeclared here (not in a function) _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); ^ mv -f .deps/exitfail.Tpo .deps/exitfail.Po /usr/bin/gcc -std=gnu99 -I. -O2 -I/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/host/include -I/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/host/usr/include -MT fatal-signal.o -MD -MP -MF .deps/fatal-signal.Tpo -c -o fatal-signal.o fatal-signal.c mv -f .deps/c-ctype.Tpo .deps/c-ctype.Po /usr/bin/gcc -std=gnu99 -I. -O2 -I/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/host/include -I/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/host/usr/include -MT fd-safer-flag.o -MD -MP -MF .deps/fd-safer-flag.Tpo -c -o fd-safer-flag.o fd-safer-flag.c mv -f .deps/c-stack.Tpo .deps/c-stack.Po make[4]: *** [clean-temp.o] Error 1 make[4]: *** Waiting for unfinished jobs.... mv -f .deps/execute.Tpo .deps/execute.Po mv -f .deps/fd-safer-flag.Tpo .deps/fd-safer-flag.Po mv -f .deps/fatal-signal.Tpo .deps/fatal-signal.Po mv -f .deps/gl_avltree_oset.Tpo .deps/gl_avltree_oset.Po make[4]: Leaving directory `/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/host-m4-1.4.15/lib' make[3]: *** [all] Error 2 make[3]: Leaving directory `/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/host-m4-1.4.15/lib' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/host-m4-1.4.15' make[1]: *** [all] 错误 2 make[1]:正在离开目录 `/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/host-m4-1.4.15' make: *** [/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/host-m4-1.4.15/.stamp_built] 错误 2 make:离开目录“/home/wwt/linux_r16/lichee/buildroot” ERROR: build buildroot Failed rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ find . -name stdio.in.h ./out/sun8iw5p1/linux/common/buildroot/build/host-m4-1.4.15/lib/stdio.in.h rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ Z:\home\wwt\linux_r16\lichee\out\sun8iw5p1\linux\common\buildroot\build\host-m4-1.4.15\lib\stdio.in.h // 2017/5/2 14:13 wenyuanbo add!!!! //_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); #if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16) _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); #endif http://www.cnblogs.com/hjj801006/p/3988220.html 'gets' undeclared here (not in a function) rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ ./build.sh make[3]: Leaving directory `/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/host-autoconf-2.65/lib' Making install in doc make[3]: Entering directory `/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/host-autoconf-2.65/doc' restore=: && backupdir=".am$$" && \ am__cwd=`pwd` && CDPATH="${ZSH_VERSION+.}:" && cd . && \ rm -rf $backupdir && mkdir $backupdir && \ if (/bin/sh /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/host-autoconf-2.65/build-aux/missing --run makeinfo --version) >/dev/null 2>&1; then \ for f in autoconf.info autoconf.info-[0-9] autoconf.info-[0-9][0-9] autoconf.i[0-9] autoconf.i[0-9][0-9]; do \ if test -f $f; then mv $f $backupdir; restore=mv; else :; fi; \ done; \ else :; fi && \ cd "$am__cwd"; \ if /bin/sh /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/host-autoconf-2.65/build-aux/missing --run makeinfo --no-split -I . \ -o autoconf.info autoconf.texi; \ then \ rc=0; \ CDPATH="${ZSH_VERSION+.}:" && cd .; \ else \ rc=$?; \ CDPATH="${ZSH_VERSION+.}:" && cd . && \ $restore $backupdir/* `echo "./autoconf.info" | sed 's|[^/]*$||'`; \ fi; \ rm -rf $backupdir; exit $rc conftest.c:14625: must be after `@defmac' to use `@defmacx' make[3]: *** [autoconf.info] Error 1 make[3]: Leaving directory `/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/host-autoconf-2.65/doc' make[2]: *** [install-recursive] Error 1 make[2]: Leaving directory `/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/host-autoconf-2.65' make[1]: *** [install] 错误 2 make[1]:正在离开目录 `/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/host-autoconf-2.65' make: *** [/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/host-autoconf-2.65/.stamp_host_installed] 错误 2 make:离开目录“/home/wwt/linux_r16/lichee/buildroot” ERROR: build buildroot Failed rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ find . -name autoconf.texi ./out/sun8iw5p1/linux/common/buildroot/build/host-autoconf-2.65/doc/autoconf.texi rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ Z:\home\wwt\linux_r16\lichee\out\sun8iw5p1\linux\common\buildroot\build\host-autoconf-2.65\doc\autoconf.texi @r{[}@var{\varname\}@r{]}@c (修改为:) @r{[}@var{\varname\}@r{]} @r{[}@var{\varname\} = @samp{\default\}@r{]}@c (修改为:) @r{[}@var{\varname\} = @samp{\default\}@r{]} http://blog.csdn.net/laohuang1122/article/details/44098291/ Ubuntu14.04编译Allwinner lichee 两个出错解决方法 rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ ./build.sh libtool: install: ranlib /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/host/usr/lib/libfakeroot.a libtool: finish: PATH="/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/host/bin:/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/host/usr/bin:/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/external-toolchain/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/cm/cm/R58/r58_new20161012/android/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/arm-linux-androideabi/bin:/home/cm/cm/R58/r58_new20161012/android/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin:/opt/jdk1.6.0_45/bin:/opt/jdk1.6.0_45/jre/bin:/sbin" ldconfig -n /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/host/usr/lib ---------------------------------------------------------------------- Libraries have been installed in: /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/host/usr/lib If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the `LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the `LD_RUN_PATH' environment variable during linking - use the `-Wl,-rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to `/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- test -z "/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/host/usr/bin" || /bin/mkdir -p "/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/host/usr/bin" /bin/sh ./libtool --mode=install /usr/bin/install -c 'faked' '/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/host/usr/bin/faked' libtool: install: /usr/bin/install -c faked /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/host/usr/bin/faked make[3]:正在离开目录 `/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/host-fakeroot-1.9.5' make[2]:正在离开目录 `/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/host-fakeroot-1.9.5' make[1]:正在离开目录 `/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/host-fakeroot-1.9.5' rm -rf /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/host-makedevs mkdir /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/host-makedevs cp package/makedevs/makedevs.c /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/host-makedevs cc -Wall -Werror -O2 /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/host-makedevs/makedevs.c -o /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/host-makedevs/makedevs /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/host-makedevs/makedevs.c: In function ‘main’: /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/host-makedevs/makedevs.c:374:6: error: variable ‘ret’ set but not used [-Werror=unused-but-set-variable] int ret = EXIT_SUCCESS; ^ cc1: all warnings being treated as errors make: *** [/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/host-makedevs/makedevs] 错误 1 make:离开目录“/home/wwt/linux_r16/lichee/buildroot” ERROR: build rootfs Failed rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ find . -name makedevs.c ./buildroot/package/makedevs/makedevs.c ./out/sun8iw5p1/linux/common/buildroot/build/host-makedevs/makedevs.c ./out/sun8iw5p1/linux/common/buildroot/build/busybox-1.18.3/miscutils/makedevs.c rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ http://blog.csdn.net/laohuang1122/article/details/44098291/ Ubuntu14.04编译Allwinner lichee 两个出错解决方法 rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ ./build.sh /local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/cm/cm/R58/r58_new20161012/android/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/arm-linux-androideabi/bin:/home/cm/cm/R58/r58_new20161012/android/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin:/opt/jdk1.6.0_45/bin:/opt/jdk1.6.0_45/jre/bin"" >> /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/_fakeroot.fs chmod a+x /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/_fakeroot.fs /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/host/usr/bin/fakeroot -- /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/_fakeroot.fs rootdir=/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/target table='target/generic/device_table.txt' Warning: skip syncing -d /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/target /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/images/rootfs.ext4 -N 1399 -b 42633 tune2fs 1.42.9 (4-Feb-2014) Creating journal inode: 完成 This filesystem will be automatically checked every 20 mounts or 0 days, whichever comes first. Use tune2fs -c or -i to override. e2fsck 1.42.9 (4-Feb-2014) 文件系统缺少UUID;正在生成一个。 Adding dirhash hint to 文件系统. /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/images/rootfs.ext4: clean, 1009/1440 files, 38102/42633 blocks busybox directfb directfb-examples divine dosfstools e2fsprogs ethtool ext4-utils freetype fsck-msdos fuse-exfat libfuse i2c-tools input-tools iostat iperf iw jpeg libnl libpcap libpng memstat memtester ntfs-3g openssh openssl portmap strace stress sysstat szrz tcpdump tiobench tslib udev which wireless_tools wpa_supplicant zlib target-generic-hostname target-generic-issue target-generic-getty-busybox target-finalize target-purgelocales /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/host/bin:/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/host/usr/bin:/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/host/usr/sbin/:/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/external-toolchain/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/cm/cm/R58/r58_new20161012/android/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/arm-linux-androideabi/bin:/home/cm/cm/R58/r58_new20161012/android/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin:/opt/jdk1.6.0_45/bin:/opt/jdk1.6.0_45/jre/bin make:离开目录“/home/wwt/linux_r16/lichee/buildroot” INFO: build rootfs OK. INFO: ---------------------------------------- INFO: build lichee OK. INFO: ---------------------------------------- rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ ./build.sh pack INFO: packing firmware ... copying tools file copying configs file ./out/aultls32.fex ./out/aultools.fex ./out/cardscript.fex ./out/cardtool.fex ./out/diskfs.fex ./out/env_burn.cfg ./out/env.cfg ./out/image.cfg "./out/image_linux.cfg" -> "./out/image.cfg" ./out/split_xxxx.fex ./out/sys_config.fex ./out/sys_partition_dragonboard.fex ./out/sys_partition_dump.fex ./out/sys_partition.fex "./out/sys_partition_linux.fex" -> "./out/sys_partition.fex" ./out/sys_partition_private.fex ./out/sys_partition_tina.fex ./out/test_config.fex ./out/usbtool.fex ./out/usbtool_test.fex copying boot resource copying boot file packing for linux normal /home/wwt/linux_r16/lichee/tools/pack/pctools/linux/eDragonEx/ /home/wwt/linux_r16/lichee/tools/pack/out Begin Parse sys_partion.fex Add partion boot-resource.fex BOOT-RESOURCE_FEX Add partion very boot-resource.fex BOOT-RESOURCE_FEX FilePath: boot-resource.fex FileLength=453400Add partion env.fex ENV_FEX000000000 Add partion very env.fex ENV_FEX000000000 FilePath: env.fex FileLength=20000Add partion boot.fex BOOT_FEX00000000 Add partion very boot.fex BOOT_FEX00000000 FilePath: boot.fex FileLength=c5a000Add partion rootfs.fex ROOTFS_FEX000000 Add partion very rootfs.fex ROOTFS_FEX000000 FilePath: rootfs.fex FileLength=29a2400sys_config.fex Len: 0xf450 config.fex Len: 0x9ac8 split_xxxx.fex Len: 0x200 sys_partition.fex Len: 0xa80 boot0_nand.fex Len: 0x8000 boot0_sdcard.fex Len: 0x8000 u-boot.fex Len: 0xc4000 fes1.fex Len: 0x1fc0 usbtool.fex Len: 0x23000 aultools.fex Len: 0x26ead aultls32.fex Len: 0x238dd cardtool.fex Len: 0x14000 cardscript.fex Len: 0x6ea sunxi_mbr.fex Len: 0x10000 dlinfo.fex Len: 0x4000 arisc.fex Len: 0x2ed88 vmlinux.fex Len: 0x2c78baa boot-resource.fex Len: 0x453400 Vboot-resource.fex Len: 0x4 env.fex Len: 0x20000 Venv.fex Len: 0x4 boot.fex Len: 0xc5a000 Vboot.fex Len: 0x4 rootfs.fex Len: 0x29a2400 Vrootfs.fex Len: 0x4 BuildImg 0 Dragon execute image.cfg SUCCESS ! ----------image is at---------- /home/wwt/linux_r16/lichee/tools/pack/sun8iw5p1_linux_evb-30_uart0.img pack finish rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值