Android      aosp06-手动编译小米Note3的LineageOS系统   
文章目录  [隐藏]

Ubuntu20
小米Note3(已刷lineageos,http://www.gaohaiyan.com/3728.html)


1.Ubuntu设置

1.1.配置USB调试手机

查看手机的ID:
$lsusb
Bus 003 Device 003: ID 18d1:4ee7 Google Inc. Mi Note 3

使用root用户创建 /etc/udev/rules.d/70-android.rules 文件,并输入
SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4ee7", MODE="0666"
$ sudo chmod a+r 70-android.rules
$ sudo service udev restart

把手机重新插到电脑上,提示“允许USB调试吗?这台计算机的RSA密钥xxxx,一律允许xxx”时,允许。
$ adb devices

1.2.设置编译器缓存

$ sudo apt install ccache -y

然后设置大小
export USE_CCACHE=1
ccache -M 50G
export CCACHE_COMPRESS=1

可以把export加到 .bashrc 文件中。

1.3.须要的jdk版本

https://wiki.lineageos.org/devices/jason/build#java

2.下载lineageos源码

2.1.查找支持的手机

查看支持的设备 https://wiki.lineageos.org/devices/
根据手机代号查看支持的版本 https://wiki.lineageos.org/devices/jason/build#initialize-the-lineageos-source-repository

2.2.下载源码

第1步,配置git的姓名和电子邮件地址,如果不提交代码,按下默认即可。
$ git config --global user.email "you@example.com"
$ git config --global user.name "Your Name"

第2步,在 ~/.bashrc 中加入命令
export REPO_URL=’https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/’
刷新 $ source ~/.bashrc

第3步,初始化
镜像站 https://mirrors.tuna.tsinghua.edu.cn/help/lineageOS/
创建工作目录并拉取配置:
$ mkdir lineage18.1 下文用 %lineage% 表示这个路径。
$ cd lineage18.1
$ repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/lineageOS/LineageOS/android.git -b lineage-18.1
如果出现

Downloading Repo source from https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/
fatal: 无法访问 'https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/':server certificate verification failed. CAfile: none CRLfile: none
repo: error: "git" failed with exit status 128
cwd: /home/happy/aosp/lineage18.1/.repo/repo
cmd: ['git', 'fetch', '--quiet', '--progress', 'origin', '+refs/heads/*:refs/remotes/origin/*', '+refs/tags/*:refs/tags/*']
fatal: double check your --repo-rev setting.
fatal: cloning the git-repo repository failed, will remove '.repo/repo'.

把REPO_URL、‘repo init -u’的协议换为http。

第4步,打开.repo/manifests/default.xml,
● 将
 <remote name="github"
      fetch=".."
      review="review.lineageos.org" />

改成
 <remote name="github"
      fetch="https://github.com/" />
 <remote name="lineage"
      fetch="https://mirrors.tuna.tsinghua.edu.cn/git/lineageOS/"
      review="review.lineageos.org" />

● 将
 <remote name="aosp"
      fetch="https://android.googlesource.com"

改成
 <remote name="aosp"
      fetch="https://mirrors.tuna.tsinghua.edu.cn/git/AOSP"

● 将
 <default revision="..."
      remote="github"

改成
 <default revision="..."
      remote="lineage"



第5步,下载,或更新
$ repo sync -j4
如果出现了和第3步类似的CAfile错误,尝试将上面default.xml修改的项目换为http协议。


3.准备MiNote3手机硬件文件

3.1.挂载lineageos镜像

第1步,从这里下载小米note3可用的lineageos卡刷包系统
https://download.lineageos.org/jason,解压,进入。
$ cd ~/Downloads/lineage-18.1-20211229-nightly-jason-signed

第2步,生成 system.new.dat 和 vendor.new.dat
$ apt install brotli
$ brotli --decompress --output=system.new.dat system.new.dat.br
$ brotli --decompress --output=vendor.new.dat vendor.new.dat.br

第3步,生成 system.img 和 vendor.img
$ git clone https://github.com/xpirt/sdat2img
$ python sdat2img/sdat2img.py system.transfer.list system.new.dat system.img
$ python sdat2img/sdat2img.py vendor.transfer.list vendor.new.dat vendor.img

第4步,挂载 system.img 和 vendor.img 。
当前目录 ~/Downloads/lineage-18.1-20211229-nightly-jason-signed/,
创建一个固定名称‘system’的目录,以及内部的'vendor'目录,
$ mkdir system/
$ mkdir system/vendor/
$ sudo mount system.img system/
$ sudo mount vendor.img system/vendor/

3.2.拉取设备特定代码文件

主要是获取手机的驱动文件(so库),这些不是源码,后面编译系统时直接打包。

第1步,手机用usb线连接到电脑,adb devices 可以看到。
同步机型的信息以及内核文件。
$ cd %lineage%
$ source build/envsetup.sh
$ breakfast jason
执行完毕,
▶ 在device下生成xiaomi目录
%lineage%/device/xiaomi/
◆ 目录 %lineage%/device/xiaomi/jason/ 对应:
https://github.com/LineageOS/android_device_xiaomi_jason
◆ 目录 %lineage%/device/xiaomi/sdm660-common/ 对应:
https://github.com/LineageOS/android_device_xiaomi_sdm660-common
▶ 在kernel下生成xiaomi目录 %lineage%/kernel/xiaomi/ ,对应:
https://github.com/LineageOS/android_kernel_xiaomi_sdm660

日志:

In file included from build/make/core/config.mk:291:
In file included from build/make/core/envsetup.mk:266:
build/make/core/product_config.mk:155: error: Can not locate config makefile for product "lineage_jason".
21:38:59 dumpvars failed with: exit status 1
Device jason not found. Attempting to retrieve device repository from LineageOS Github (http://github.com/LineageOS).
Found repository: android_device_xiaomi_jason
Default revision: lineage-18.1
Checking branch info
Checking if device/xiaomi/jason is fetched from android_device_xiaomi_jason
Adding dependency: LineageOS/android_device_xiaomi_jason -> device/xiaomi/jason
Using default branch for android_device_xiaomi_jason
Syncing repository to retrieve project.
remote: Enumerating objects: 15, done.
remote: Counting objects: 100% (15/15), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 7 (delta 3), reused 0 (delta 0)
展开对象中: 100% (7/7), 1.50 KiB | 218.00 KiB/s, 完成.
Fetching: 100% (2/2), done in 5.245s
Garbage collecting: 100% (2/2), done in 0.037s
repo sync has finished successfully.
Repository synced!
Looking for dependencies in device/xiaomi/jason
Adding dependencies to manifest
Checking if device/xiaomi/sdm660-common is fetched from android_device_xiaomi_sdm660-common
Adding dependency: LineageOS/android_device_xiaomi_sdm660-common -> device/xiaomi/sdm660-common
Using default branch for android_device_xiaomi_sdm660-common
Syncing dependencies
Fetching: 100% (2/2), done in 4.083s
Garbage collecting: 100% (2/2), done in 0.014s
repo sync has finished successfully.
Looking for dependencies in device/xiaomi/sdm660-common
Adding dependencies to manifest
Checking if kernel/xiaomi/sdm660 is fetched from android_kernel_xiaomi_sdm660
Adding dependency: LineageOS/android_kernel_xiaomi_sdm660 -> kernel/xiaomi/sdm660
Using default branch for android_kernel_xiaomi_sdm660
Syncing dependencies
Fetching: 100% (2/2), done in 13m2.776s
Garbage collecting: 100% (2/2), done in 0.017s
正在更新文件: 100% (57347/57347), 完成.
Checking out: 100% (2/2), done in 8.190s
repo sync has finished successfully.
Looking for dependencies in kernel/xiaomi/sdm660
kernel/xiaomi/sdm660 has no additional dependencies.
Done
In file included from build/make/core/config.mk:291:
In file included from build/make/core/envsetup.mk:266:
device/xiaomi/sdm660-common/sdm660.mk:398: error: _nic.PRODUCTS.[[device/xiaomi/jason/lineage_jason.mk]]: "vendor/xiaomi/sdm660-common/sdm660-common-vendor.mk" does not exist.
21:52:31 dumpvars failed with: exit status 1
In file included from build/make/core/config.mk:291:
In file included from build/make/core/envsetup.mk:266:
device/xiaomi/sdm660-common/sdm660.mk:398: error: _nic.PRODUCTS.[[device/xiaomi/jason/lineage_jason.mk]]: "vendor/xiaomi/sdm660-common/sdm660-common-vendor.mk" does not exist.
21:52:32 dumpvars failed with: exit status 1
** Don't have a product spec for: 'lineage_jason'
** Do you have the right repo manifest?



第2步,提取blob
进入lilneos的源码目录,$ cd %lineage%/device/xiaomi/jason
下面指令,第2个参数是上一步挂载目录‘system’的父路径‘lineage-18.1-20211229-nightly-jason-signed’。extract-files.sh 自动去查找system目录。
$ ./extract-files.sh ~/Downloads/lineage-18.1-20211229-nightly-jason-signed/
结束后,手机相关资源生成到 %lineage%/vendor/xiaomi/

日志:

Cleaning output directory (./../../xiaomi/sdm660-common/../../../vendor/xiaomi/sdm660-common/proprietary)..
Extracting 482 files in ./../../xiaomi/sdm660-common/proprietary-files.txt from adb:
 - etc/cne/Nexus/ATT/ATT_profiles.xml
 - etc/cne/Nexus/ROW/ROW_profiles.xml
 - etc/cne/Nexus/VZW/VZW_profiles.xml
 - system_ext/etc/permissions/qti_permissions.xml
 - lib/libFileMux.so
 - lib/libOmxMux.so
 - lib/libmmosal.so
 - lib/libmmparser_lite.so
 - lib64/libmmosal.so
 - system_ext/bin/dpmd
 - system_ext/etc/dpm/dpm.conf
 - system_ext/etc/init/dpmd.rc
 - system_ext/etc/permissions/com.qti.dpmframework.xml
 - system_ext/etc/permissions/dpmapi.xml
 - system_ext/etc/permissions/qcrilhook.xml
 - system_ext/etc/permissions/telephonyservice.xml
 - system_ext/framework/QtiTelephonyServicelibrary.jar
Checking if system is odexed and locating boot.oats...
 - system_ext/framework/com.qti.dpmframework.jar
 - system_ext/framework/dpmapi.jar
 - system_ext/framework/qcrilhook.jar
 - system_ext/framework/qti-telephony-common.jar
 - system_ext/lib64/com.qualcomm.qti.ant@1.0.so
 - system_ext/lib64/com.qualcomm.qti.dpm.api@1.0.so
 - system_ext/lib64/lib-imscamera.so
 - system_ext/lib64/lib-imsvideocodec.so
 - system_ext/lib64/lib-imsvt.so
 - system_ext/lib64/lib-imsvtextutils.so
 - system_ext/lib64/lib-imsvtutils.so
 - system_ext/lib64/libdiag_system.so
 - system_ext/lib64/libdpmctmgr.so
 - system_ext/lib64/libdpmfdmgr.so
 - system_ext/lib64/libdpmframework.so
 - system_ext/lib64/libdpmtcm.so
 - system_ext/lib64/libimscamera_jni.so
 - system_ext/lib64/libimsmedia_jni.so
 - system_ext/lib64/vendor.qti.imsrtpservice@2.0.so
 - system_ext/lib64/vendor.qti.imsrtpservice@2.1.so
 - vendor/bin/ATFWD-daemon
 - vendor/bin/adpl
 - vendor/bin/adsprpcd
 - vendor/bin/cdsprpcd
 - vendor/bin/cnd
 - vendor/bin/dpmQmiMgr
 - vendor/bin/energy-awareness
 - vendor/bin/hvdcp_opti
 - vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti
 - vendor/bin/hw/android.hardware.drm@1.2-service.widevine
 - vendor/bin/hw/qcrild
 - vendor/bin/hw/vendor.display.color@1.0-service
 - vendor/bin/hw/vendor.qti.hardware.alarm@1.0-service
 - vendor/bin/hw/vendor.qti.hardware.perf@2.0-service
 - vendor/bin/hw/vendor.qti.hardware.soter@1.0-service
 - vendor/bin/hw/vendor.qti.hardware.tui_comm@1.0-service-qti
 - vendor/bin/ims_rtp_daemon
 - vendor/bin/imsdatadaemon
 - vendor/bin/imsqmidaemon
 - 很多...
 - vendor/etc/cne/wqeclient/ROW/ROW_profile2.xml
 - vendor/etc/cne/wqeclient/ROW/ROW_profile20.xml
 - vendor/etc/cne/wqeclient/ROW/ROW_profile21.xml
 - vendor/etc/cne/wqeclient/ROW/ROW_profile3.xml
 - vendor/etc/cne/wqeclient/ROW/ROW_profile32.xml
 - vendor/etc/cne/wqeclient/ROW/ROW_profile4.xml
 - vendor/etc/cne/wqeclient/ROW/ROW_profile5.xml
 - vendor/etc/cne/wqeclient/ROW/ROW_profile6.xml
 - vendor/etc/cne/wqeclient/ROW/ROW_profile7.xml
 - vendor/etc/cne/wqeclient/VZW/VZW_profile1.xml
 - vendor/etc/cne/wqeclient/VZW/VZW_profile2.xml
 - vendor/etc/cne/wqeclient/VZW/VZW_profile3.xml
 - vendor/etc/cne/wqeclient/VZW/VZW_profile4.xml
 - vendor/lib/libOmxQcelp13Dec.so
 - vendor/lib/libOmxVideoDSMode.so
 - 很多...
 - vendor/lib64/libqrtr.so
 - vendor/lib64/libqseed3.so
 - vendor/lib64/libqsocket.so
 - vendor/lib64/libqti-perfd-client.so
 - vendor/lib64/libqti-perfd.so
 - vendor/lib64/libqti-util.so
 - vendor/lib64/librcc.so
 - vendor/lib64/libril-qc-hal-qmi.so
 - vendor/lib64/libril-qc-ltedirectdisc.so
 - vendor/lib64/libril-qc-radioconfig.so
 - vendor/lib64/libril-qcril-hook-oem.so
 - vendor/lib64/librilqmiservices.so
 - vendor/lib64/librpmb.so
 - vendor/lib64/librs_adreno.so
 - vendor/lib64/librs_adreno_sha1.so
 - vendor/radio/qcril_database/upgrade/5_version_update_ecc_table.sql
 - vendor/radio/qcril_database/upgrade/8_version_mi.sql
 - app/SoterService/SoterService.apk
 - system_ext/lib/libantradio.so
 - system_ext/lib64/libantradio.so
 - product/app/PowerOffAlarm/PowerOffAlarm.apk
 - system_ext/app/QtiTelephonyService/QtiTelephonyService.apk
 - system_ext/app/datastatusnotification/datastatusnotification.apk
 - system_ext/app/imssettings/imssettings.apk
 - system_ext/app/uceShimService/uceShimService.apk
 - system_ext/priv-app/dpmserviceapp/dpmserviceapp.apk
 - system_ext/priv-app/ims/ims.apk
 - system_ext/priv-app/qcrilmsgtunnel/qcrilmsgtunnel.apk
 - vendor/app/CneApp/CneApp.apk
 - vendor/app/IWlanService/IWlanService.apk
 - vendor/app/TimeService/TimeService.apk
 - vendor/etc/vintf/manifest/vendor.qti.gnss@3.0-service.xml
  !! vendor/lib64/hw/vendor.qti.hardware.fm@1.0-impl.so: file not found in source
###### @1@ -start 缺失4个FM收音机相关so
Extracting 4 files in ./../../xiaomi/sdm660-common/proprietary-files-fm.txt from adb:
 - system_ext/lib64/fm_helium.so
  !! system_ext/lib64/fm_helium.so: file not found in source
 - system_ext/lib64/libfm-hci.so
  !! system_ext/lib64/libfm-hci.so: file not found in source
 - system_ext/lib64/vendor.qti.hardware.fm@1.0.so
  !! system_ext/lib64/vendor.qti.hardware.fm@1.0.so: file not found in source
 - vendor/lib64/hw/vendor.qti.hardware.fm@1.0-impl.so
  !! vendor/lib64/hw/vendor.qti.hardware.fm@1.0-impl.so: file not found in source
###### @1@ -end

Extracting 2 files in ./../../xiaomi/sdm660-common/proprietary-files-ir.txt from adb:
 - vendor/lib64/hw/consumerir.lirc.sdm660.so
 - vendor/lib64/hw/consumerir.spi.sdm660.so
Cleaning output directory (./../../xiaomi/sdm660-common/../../../vendor/xiaomi/jason/proprietary)..
Extracting 337 files in ./../../xiaomi/sdm660-common/../jason/proprietary-files.txt from adb:
 - vendor/firmware/jason_bu63169_ofilm.coeff
 - vendor/firmware/jason_bu63169_ofilm.prog
 - vendor/firmware/jason_bu63169_semco.coeff
 - vendor/firmware/jason_bu63169_semco.prog
 - vendor/bin/cnss-daemon
 - vendor/bin/nqnfcinfo
 - vendor/bin/remosaic_daemon
 - vendor/bin/sensors.qti
 - vendor/bin/thermal-engine
 - vendor/etc/acdbdata/Forte/Forte_Bluetooth_cal.acdb
 - vendor/etc/acdbdata/Forte/Forte_General_cal.acdb
 - vendor/etc/acdbdata/Forte/Forte_Global_cal.acdb
 - vendor/etc/acdbdata/Forte/Forte_Handset_cal.acdb
 - vendor/etc/acdbdata/Forte/Forte_Hdmi_cal.acdb
 - vendor/etc/acdbdata/Forte/Forte_Headset_cal.acdb
 - vendor/etc/acdbdata/Forte/Forte_Speaker_cal.acdb
 - vendor/etc/acdbdata/Forte/Forte_workspaceFile.qwsp
 - vendor/etc/acdbdata/adsp_avs_config.acdb
 - vendor/etc/camera/camera_config.xml
 - vendor/etc/camera/jason_imx386_ofilm_chromatix.xml
 - vendor/etc/camera/jason_imx386_semco_chromatix.xml
 - vendor/etc/camera/jason_s5k3m3_ofilm_chromatix.xml
 - vendor/etc/camera/jason_s5k3m3_semco_chromatix.xml
 - vendor/etc/camera/jason_s5k3p8sp_sunny_chromatix.xml
 - vendor/etc/hdr_config.cfg
 - vendor/etc/qdcm_calib_data_jdi_fhd_cmd_incell_dsi_panel.xml
 - vendor/etc/qdcm_calib_data_sharp_fhd_cmd_incell_dsi_panel.xml
 - vendor/etc/sdr_config.cfg
 - vendor/etc/sensors/hals.conf
 - vendor/etc/sensors/sensor_def_qcomdev.conf
 - vendor/etc/thermal-engine-sdm660-high.conf
 - vendor/etc/thermal-engine-sdm660-map.conf
 - vendor/etc/thermal-engine-sdm660-nolimits.conf
 - vendor/etc/thermal-engine-sdm660.conf
 - vendor/etc/thermal-engine.conf
 - vendor/firmware/a512_zap.b00
 - vendor/firmware/a512_zap.b01
 - vendor/firmware/a512_zap.b02
 - vendor/firmware/a512_zap.elf
 - vendor/firmware/a512_zap.mdt
 - vendor/firmware/a530_gpmu.fw2
 - vendor/firmware/a530_pfp.fw
 - vendor/firmware/a530_pm4.fw
 - vendor/firmware/cpp_firmware_v1_12_0.fw
 - vendor/lib/hw/activity_recognition.sdm660.so
 - 很多...
 - vendor/lib/libsensor1.so
 - vendor/lib/libsensor_reg.so
 - vendor/lib/sensors.ssc.so
 - vendor/lib64/com.fingerprints.extension@1.0.so
 - vendor/lib64/hw/activity_recognition.sdm660.so
 - vendor/lib64/hw/fingerprint.fpc.sdm660.so
 - vendor/lib64/hw/fingerprint.goodix.sdm660.so
 - vendor/lib64/hw/gatekeeper.sdm660.so
 - vendor/lib64/hw/keystore.sdm660.so
 - vendor/lib64/libgf_ca.so
 - vendor/lib64/libgf_hal.so
 - vendor/lib64/libqminvapi.so
 - vendor/lib64/libremosaic_daemon.so
 - vendor/lib64/libremosaiclib.so
 - vendor/lib64/libsensor1.so
 - vendor/lib64/libsensor_reg.so
 - vendor/lib64/libthermalioctl.so
 - vendor/lib64/sensors.ssc.so
 - vendor/lib64/vendor.goodix.hardware.fingerprintextension@1.0.so
 - vendor/lib/libthermalclient.so
 - vendor/lib64/libthermalclient.so



第3步,提取结束后取消挂载
$ sudo umount ~/Downloads/lineage-18.1-20211229-nightly-jason-signed/system/vendor/
$ sudo umount ~/Downloads/lineage-18.1-20211229-nightly-jason-signed/system/

3.3.验证设备特定代码文件

操作和3.2.的第1步相同。
$ cd %lineage%
$ source build/envsetup.sh
$ breakfast jason

日志:

Looking for dependencies in device/xiaomi/jason
Looking for dependencies in device/xiaomi/sdm660-common
Looking for dependencies in kernel/xiaomi/sdm660
kernel/xiaomi/sdm660 has no additional dependencies.
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=11
LINEAGE_VERSION=18.1-20220104-UNOFFICIAL-jason
TARGET_PRODUCT=lineage_jason
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv8-a
TARGET_2ND_CPU_VARIANT=generic
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-5.11.0-40-generic-x86_64-Ubuntu-20.04.3-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=RQ3A.211001.001
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/xiaomi/sdm660-common vendor/xiaomi/sdm660-common vendor/nxp/opensource/pn5xx vendor/xiaomi/jason hardware/qcom-caf/msm8998 vendor/qcom/opensource/data-ipa-cfg-mgr vendor/qcom/opensource/dataservices vendor/qcom/opensource/commonsys/packages/apps/Bluetooth vendor/qcom/opensource/commonsys/system/bt/conf
============================================
23:03:22 *************** 如果电脑配置太低可能出现的提示 *******************
23:03:22 You are building on a machine with 7.61GB of RAM
23:03:22
23:03:22 The minimum required amount of free memory is around 16GB,
23:03:22 and even with that, some configurations may not work.
23:03:22
23:03:22 If you run into segfaults or other errors, try reducing your
23:03:22 -j value.
23:03:22 ************************************************************
============================================


4.编译

$ cd %lineage%
$ croot
$ brunch jason | tee -a build.log

日志:

============================================
[100% 1/1] out/soong/.minibootstrap/minibp out/soong/.bootstrap/build.ninja
[ 1% 2/182] compile out/soong/.bootstrap/blueprint-deptools/pkg/github.com/google/blueprint/deptools.a
[ 1% 3/182] compile out/soong/.bootstrap/gotestrunner/obj/gotestrunner.a
[ 2% 4/182] compile out/soong/.bootstrap/blueprint-parser/pkg/github.com/google/blueprint/parser.a
[ 2% 5/182] compile out/soong/.bootstrap/gotestmain/obj/gotestmain.a
[ 3% 6/182] compile out/soong/.bootstrap/loadplugins/obj/loadplugins.a
[ 3% 7/182] compile out/soong/.bootstrap/blueprint-parser/test/github.com/google/blueprint/parser.a
[ 4% 8/182] compile out/soong/.bootstrap/blueprint-pathtools/pkg/github.com/google/blueprint/pathtools.a
[ 4% 9/182] compile out/soong/.bootstrap/blueprint-pathtools/test/github.com/google/blueprint/pathtools.a
[ 5% 10/182] compile out/soong/.bootstrap/blueprint-proptools/pkg/github.com/google/blueprint/proptools.a
[ 6% 11/182] compile out/soong/.bootstrap/soong-env/pkg/android/soong/env.a
[ 6% 12/182] compile out/soong/.bootstrap/blueprint-proptools/test/github.com/google/blueprint/proptools.a
[ 7% 13/182] compile out/soong/.bootstrap/soong-shared/pkg/android/soong/shared.a
[ 7% 14/182] link out/soong/.bootstrap/gotestrunner/obj/a.out
[ 8% 15/182] cp out/soong/.bootstrap/bin/gotestrunner
[ 8% 16/182] compile out/soong/.bootstrap/soong_env/obj/soong_env.a
[ 9% 17/182] link out/soong/.bootstrap/loadplugins/obj/a.out
[ 9% 18/182] cp out/soong/.bootstrap/bin/loadplugins
[ 10% 19/182] create out/soong/.bootstrap/soong_build/gen/plugin.go
[ 10% 20/182] compile out/soong/.bootstrap/blueprint/test/github.com/google/blueprint.a
[ 11% 21/182] compile out/soong/.bootstrap/blueprint/pkg/github.com/google/blueprint.a
[ 12% 22/182] link out/soong/.bootstrap/gotestmain/obj/a.out
[ 12% 23/182] cp out/soong/.bootstrap/bin/gotestmain
[ 13% 24/182] gotestmain out/soong/.bootstrap/aidl-soong-rules/test/test.go
[ 13% 25/182] compile out/soong/.bootstrap/blueprint-bootstrap-bpdoc/pkg/github.com/google/blueprint/bootstrap/bpdoc.a
[ 14% 26/182] compile out/soong/.bootstrap/soong/pkg/android/soong.a
[ 14% 27/182] gotestmain out/soong/.bootstrap/blueprint-bootstrap-bpdoc/test/test.go
[ 15% 28/182] gotestmain out/soong/.bootstrap/blueprint/test/test.go
[ 很多... ]
[ 96% 175/182] test android/soong/rust
[ 96% 176/182] test android/soong/java
[ 97% 177/182] test android/soong/sysprop
[ 97% 178/182] test android/soong/aidl
[ 98% 179/182] test android/soong/apex
[ 98% 180/182] test android/soong/sdk
[ 99% 181/182] cp out/soong/.bootstrap/bin/soong_build
[100% 182/182] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
##### 电脑内存太小时可能会出错:
FAILED: out/soong/build.ninja
out/soong/.bootstrap/bin/soong_build -t -l out/.module_paths/Android.bp.list -b out/soong -n out -d out/soong/build.ninja.d -globFile out/soong/.bootstrap/build-globs.ninja -o out/soong/build.ninja Android.bp
Killed
13:01:35 soong bootstrap failed with: exit status 1
ninja: build stopped: subcommand failed.
#### failed to build some targets (01:37:31 (hh:mm:ss)) ####



编译成功会提示:
#### build completed successfully (耗时 (hh:mm:ss)) ####

在 %lineageos%/out/target/product/jason/ 下生成卡刷包 lineage-18.1-20220109-UNOFFICIAL-jason.zip 。
2013年设备 宏碁E1-471G-53212G50Mnks(Intel Core i5-3210M(2.5GHz/L3 3M) + 2 * 8G DDR3 1600MHz)整个耗时约20小时,所以2020后的家用cpu可能只需要一两个小时。编译初始占用内存约13个G,之后维持在5个G上下,临近结束8G左右,大概是受制于cpu不能高效使用内存。
编译日志参考:https://www.aliyundrive.com/s/GaJ8aiGZTPF 。



卡刷系统参考 http://www.gaohaiyan.com/3728.html


本例编译过程出现2个意外导致两次中断。解决后直接继续执行“brunch”即可:
(1)error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
解决:sudo apt install libncurses5
(2)下列软件包有未满足的依赖关系:
libssl-dev : 依赖: libssl1.1 (= 1.1.1f-1ubuntu2.8) 但是 1.1.1f-1ubuntu2.10 正要被安装
E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。

解决:sudo apt-get install libssl1.1=1.1.1f-1ubuntu2.8



- end

承接App定制、企业web站点、办公系统软件 设计开发,外包项目,毕设