如何编译clk,Android bootloader?

时间:2014-05-25 15:10:04

标签: android bootloader

https://github.com/n0d3/lk - 这是保存clk 1.5源代码的存储库,它是Android的引导程序,我正在尝试编译。可以找到编译的包;但是,我需要自定义它。我怎么编译呢?

运行make会返回以下内容:

$ make
makefile:22: *** No project specified.  Use "make projectname" or put "PROJECT := projectname" in local.mk.  Stop.

运行make htcleo会返回以下内容:

$ make htcleo
make[1]: Entering directory '/cygdrive/c/Users/Domas/lk'
make[1]: arm-eabi-gcc: Command not found
LIBGCC =
CFLAGS = -O2 -g -fno-builtin -finline -W -Wall -Wno-multichar -Wno-unused-parameter -Wno-unused-function -include ./build-htcleo/config.h -ffunction-sections -fdata-sections -mlittle-endian -mfpu=neon -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -mthumb-interwork -mthumb -D__thumb__
including app/aboot dev/battery dev/fbcon dev/keys lib/debug lib/devinfo lib/heap lib/libc lib/ptable
generating build-htcleo/config.h
compiling arch/arm/start.S
make[1]: arm-eabi-gcc: Command not found
arch/arm/compile.mk:30: recipe for target 'build-htcleo/arch/arm/start.o' failed
make[1]: *** [build-htcleo/arch/arm/start.o] Error 127
make[1]: Leaving directory '/cygdrive/c/Users/Domas/lk'
makefile:15: recipe for target 'make-make' failed
make: *** [make-make] Error 2

正如您在make[1]: arm-eabi-gcc: Command not found上看到的那样。我能够使用CodeSourcery工具链编译旧版本(具有不同的编译过程),该工具链具有arm-none-eabi-gcc.exe,但不是arm-eabi-gcc.exe,这似乎是编译此版本所必需的。

注意: 我很欣赏这可能不是一个在SO上流行的问题;然而,我一整天都在敲打这个,并且真的可以使用一些指导。

1 个答案:

答案 0 :(得分:0)

我设法编译它。我所做的是找到一个git存储库,它有一个编译脚本和一些其他文件,用于编译源代码,但它是旧的源代码。所以我下载了这个项目,用最近的代码替换了源代码,编译脚本也运行了。以下说明中,大多数是xda forums的复制粘贴:

  1. 在此处下载此zip存档:https://github.com/cedesmith/cLK/archive/master.zip 这是旧的源代码,但它具有使编译变得容易的必要脚本。

  2. 解压缩存档,以便compile脚本的路径为~/cLK/compile

  3. 删除~/cLK/lk子目录(这是旧的源代码)。

  4. 下载新的源代码:git clone https://github.com/n0d3/lk

  5. 现在您应该在~/cLK/lk中拥有新的源代码。关于实际编译:这取决于你是在Linux还是Windows上:

    的Linux

      Debian上的
    1. sudo apt-get update
      sudo apt-get install gcc make git wget unzip zip libc6-dev-amd64 libc6-dev
      

      在Fedora上:

      yum install gcc make git wget unzip zip
      
    2. 现在下载CodeSourcery工具链:

      wget http://www.codesourcery.com/sgpp/lite/arm/portal/package5353/public/arm-none-eabi/arm-2009q3-68-arm-none-eabi-i686-pc-linux-gnu.tar.bz2
      tar xvfj arm-2009q3-68-arm-none-eabi-i686-pc-linux-gnu.tar.bz2
      export PATH=$HOME/clk/arm-2009q3/bin:$PATH
      
    3. 最后,编译:

      cd ~/cLK
      ./compile clean
      
    4. 如果一切顺利,您会在此文件夹中找到RUU_signed:bin/RUU_signed.nbh

      1. 你需要Cygwin:

        Download, the following file, and execute it http://www.cygwin.com/setup.exe
        Click Next
        Click "Install from internet" and click Next
        Click Next (to accept the default directory to install)
        Click Next (to accept the default directory for local Package directory)
        Click "Direct Connection", and click Next
        Select a "local mirror", and click Next
        Now in the search bar, you need to search for the following things to install
        gcc
        make
        git
        wget
        zip
        unzip
        Once selected click Next to continue, and Finish
        
      2. 启动cygwin终端(薄荷);以下命令可能在cmd.exe中不起作用。

      3. 现在下载CodeSourcery工具链和杨:

        wget http://www.codesourcery.com/sgpp/lite/arm/portal/package5354/public/arm-none-eabi/arm-2009q3-68-arm-none-eabi-i686-mingw32.tar.bz2
        tar xvfj arm-2009q3-68-arm-none-eabi-i686-mingw32.tar.bz2
        wget http://htc-flasher.googlecode.com/files/yang-1.1_win32.zip
        cd cLK/bin
        rm -rf yang
        mkdir yang
        unzip ../../yang-1.1_win32.zip yang/yang.exe
        mv yang/yang.exe .
        cd ..
        sed -i s/yang/yang.exe/g compile
        
      4. 最后,编译:

        export PATH=$HOME/arm-2009q3/bin:$PATH
        cd ~/cLK
        ./compile clean
        
      5. 现在您的RUU_signed.nbh将位于以下文件夹bin/RUU_signed.nbh