編譯 Android 4.2 for CubieBorad2 雙卡版

suzhouclark發表於2015-08-25
1. 用的是ubuntu 12.04.5  64bit.
2. 先安裝 JDK 
  $wget dl.cubieboard.org/software/tools/android/jdk1.6.0_45.tar.gz
$ sudo vim ~/.bashrc

Add :

JAVA_HOME=/work/tools/jdk1.6.0_45
export JRE_HOME=/work/tools/jdk1.6.0_45/jre
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
Delete all item in this file, then copy the following server addresses to it
#sudo vi /etc/apt/sources.list
deb style="font-size:18px;"> precise main restricted
deb-src
style="font-size:18px;"> precise main restricted
deb
style="font-size:18px;"> precise-updates main restricted
deb-src
style="font-size:18px;"> precise-updates main restricted
deb
style="font-size:18px;"> precise universe
deb-src
style="font-size:18px;"> precise universe
deb
style="font-size:18px;"> precise-updates universe
deb-src
style="font-size:18px;"> precise-updates universe
deb
style="font-size:18px;"> precise multiverse
deb-src
style="font-size:18px;"> precise multiverse
deb
style="font-size:18px;"> precise-updates multiverse
deb-src
style="font-size:18px;"> precise-updates multiverse
deb
style="font-size:18px;"> precise-backports main restricted universe multiverse
deb-src
style="font-size:18px;"> precise-backports main restricted universe multiverse
deb
style="font-size:18px;"> precise-security main restricted
deb-src
style="font-size:18px;"> precise-security main restricted
deb
style="font-size:18px;"> precise-security universe
deb-src
style="font-size:18px;"> precise-security universe
deb
style="font-size:18px;"> precise-security multiverse
deb-src
style="font-size:18px;"> precise-security multiverse
deb
style="font-size:18px;"> precise main
deb-src
style="font-size:18px;"> precise main
儲存退出。然後執行命令:
#sudo apt-get update
更新之後,你再安裝那些包的話就不會有問題了。






3. 安裝  
sudo apt-get install  build-essential  
sudo apt-get install u-boot-tools 

4. 然後安裝其他的
$sudo apt-get install uboot-mkimage binutils-arm-linux-gnueabihf gcc-arm-linux-gnueabi gcc-arm-linux-gnueabihf cpp-arm-linux-gnueabihf libusb-1.0-0 libusb-1.0-0-dev git  fakeroot kernel-package zlib1g-dev libncurses5-dev

$sudo apt-get install texinfo texlive ccache zlib1g-dev gawk bison flex gettext uuid-dev ia32-libs ncurses-dev gcc-multilib
5. 下載SDK
http://dl.cubieboard.org/software/a20-cubieboard/android/v2.0_A20_android_source.tar.gz

==========================================


修改lichee/tools/pack/chips/sun7i/configs/android/sugar-cubieboard2/sys_config.fex
  1. [system]
  2. ;recovery_key             = port:PH16<0><default>

就是把此條定義註釋掉(新增分號),重啟了N多次還保留資料,各位親都試試吧!

##為了輸出為1080P
同檔案,修改
screen1_output_mode     = 4

screen1_output_mode     = 10


===========================================
##為了輸出為1080P
  1. diff --git a/device/softwinner/wing-common/hardware/libhardware/display/display.cpp b/device/softwinner/wing-common/hardware/libhardware/display/display.cpp
  2. index a406f36..01a5ba8 100755
  3. --- a/device/softwinner/wing-common/hardware/libhardware/display/display.cpp
  4. +++ b/device/softwinner/wing-common/hardware/libhardware/display/display.cpp
  5. @@ -2529,7 +2529,8 @@ static int display_init(struct display_context_t* ctx)
  6.                      }
  7.                      if(i==sizeof(g_tv_para)/sizeof(struct tv_para_t))
  8.                      {
  9. -                        ctx->out_format[sel] = DISPLAY_TVFORMAT_720P_60HZ;
  10. +                        //ctx->out_format[sel] = DISPLAY_TVFORMAT_720P_60HZ;
  11. +                        ctx->out_format[sel] = DISPLAY_TVFORMAT_1080P_60HZ;
  12.                      }
  13.                  }
  14.                  else if(init_para.output_type[sel] == DISP_OUTPUT_TYPE_VGA)


  1. diff --git a/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java b/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
  2. index 1045c7d..2f6d375 100755
  3. --- a/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
  4. +++ b/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java
  5. @@ -4045,7 +4045,7 @@ public class WindowManagerService extends IWindowManager.Stub
  6.         if (req == ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) {
  7.              req = getOrientationFromAppTokensLocked();
  8.          }
  9. -               req = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
  10. +               //req = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
  11.          return req;
  12.         }
  13.         else{


  1. diff --git a/system/core/init/init_disp.c b/system/core/init/init_disp.c
  2. index 3637143..8b2c8cd 100755
  3. --- a/system/core/init/init_disp.c
  4. +++ b/system/core/init/init_disp.c
  5. @@ -768,7 +768,9 @@ int init_initdisplay()
  6.      }
  7.      if(hdmistatus)
  8.      {
  9. -        init_swtichdisplay(0,DISP_OUTPUT_TYPE_HDMI,DISP_TV_MOD_720P_60HZ);
  10. +        //init_swtichdisplay(0,DISP_OUTPUT_TYPE_HDMI,DISP_TV_MOD_720P_60HZ);
  11. +       int mode = init_dispgethdmimaxmode();
  12. +        init_swtichdisplay(0,DISP_OUTPUT_TYPE_HDMI,mode);
  13.      }
  14.      else
  15.      {



===========================================


6. 開始編譯
  • After extract it,
   $ cd lichee/linux-3.4
   $ make clean
   $ cp arch/arm/configs/cubieboard2_config .config   //note:if you want to complie cubietruck, please copy cubietruck_config.
   $ cd ..
   $ ./build.sh -p sun7i_android
   $ cd ../android
   $ source build/envsetup.sh
   $ lunch   //note:select sugar-cubieboard2 or sugar-cubietruck
   $ extract-bsp
   $ make -j8

7. 打包(在Android根目錄)
     $pack

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9697/viewspace-1781886/,如需轉載,請註明出處,否則將追究法律責任。

相關文章