【问题标题】:Oneplus5 Lineage OS 15.1 kernel compilation一加5 Lineage OS 15.1内核编译
【发布时间】:2018-12-08 13:25:45
【问题描述】:

我正在尝试为安装了 Lineage OS 15.1 自定义 ROM 的 Oneplus5 编译内核。我正在使用 google ndk 工具链来编译内核。我从 Lineage OS 源代码中提取了内核源代码,也尝试编译股票 ROM 内核。

经过几次加热和试验,并修复了内核源代码中的一些文件,我终于成功编译了它!编译完成后我得到了arch/arm64/boot目录下的Image,Image.gz文件。

但是当我尝试从 TWRP 恢复中刷新内核映像时,设备总是启动到 fastboot 模式并卡在那里。有什么问题,我该怎么做才能让它发挥作用。

【问题讨论】:

    标签: android linux-kernel toolchain rom


    【解决方案1】:

    尝试运行mka bootimage,然后用fastboot flash boot boot.img 刷新生成的boot.img

    略长的版本,基于https://wiki.lineageos.org/devices/cheeseburger/build 的说明:

    apt install adb fastboot bc bison build-essential ccache curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev openjdk-8-jdk python unzip
    
    mkdir -p ~/bin
    mkdir -p ~/android/lineage
    
    curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
    chmod a+x ~/bin/repo
    
    echo 'PATH="$HOME/bin:$PATH"' >> .profile
    echo 'export LC_ALL=C' >> .profile
    
    git config --global user.email "you@example.com"
    git config --global user.name "Your Name"
    
    cd ~/android/lineage
    repo init -u https://github.com/LineageOS/android.git -b lineage-15.1
    repo sync
    
    source build/envsetup.sh
    # use extract-files.sh or follow https://gist.github.com/fourkbomb/261ced58cd029c5f7742350aafdd9825
    breakfast cheeseburger
    
    mka bootimage
    

    如果mka bootimage 步骤运行没有错误但未生成boot.img,请尝试运行mka bacon 几分钟,然后中止它并重新运行mka bootimage

    以上命令将使用 LineageOS 的设备默认内核,在./android/lineage/kernel/oneplus/msm8998。您可以简单地在那里进行更改,或者在该目录中放置一个全新的内核源代码。在后一种情况下,请确保将lineage_oneplus5_defconfig 文件放在arch/arm64/configs 中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-05-01
      • 1970-01-01
      • 2013-08-21
      • 2017-03-09
      • 1970-01-01
      • 2017-08-11
      • 2017-07-30
      相关资源
      最近更新 更多