device-treeandroid-kernellineageos

recipe for target 'arch/arm64/boot/dts/qcom/msm8917-pmi8937-qrd-sku5.dtb' failed


I am getting the following exception while building the recovery for a lineageos project and need some help diagnosing and resolving the issue:

ERROR (phandle_references): Reference to non-existent node or label "smb_int_default"

ERROR (phandle_references): Reference to non-existent node or label "gpio_led_off"

ERROR: Input tree has errors, aborting (use -f to force output)
scripts/Makefile.lib:292: recipe for target 'arch/arm64/boot/dts/qcom/msm8917-pmi8937-qrd-sku5.dtb' failed
make[3]: *** [arch/arm64/boot/dts/qcom/msm8917-pmi8937-qrd-sku5.dtb] Error 2
make[3]: *** Waiting for unfinished jobs....
  CC      drivers/media/platform/msm/camera_v2/isp/msm_isp40.o
  CC      drivers/media/platform/msm/camera_v2/jpeg_10/msm_jpeg_hw.o
  CC      drivers/media/radio/radio-iris.o
  LD      drivers/media/platform/msm/camera_v2/msm_vb2/built-in.o
  CC      drivers/media/platform/msm/camera_v2/jpeg_10/msm_jpeg_platform.o
  CC      drivers/media/radio/radio-iris-transport.o
  LD      drivers/media/platform/msm/camera_v2/jpeg_10/built-in.o
  CC      drivers/media/platform/msm/camera_v2/isp/msm_isp.o
/home/lineageos/kernel/lenovo/msm8917/scripts/Makefile.build:402: recipe for target 'arch/arm64/boot/dts/qcom' failed
make[2]: *** [arch/arm64/boot/dts/qcom] Error 2
/home/lineageos/kernel/lenovo/msm8917/arch/arm64/Makefile:92: recipe for target 'dtbs' failed
make[1]: *** [dtbs] Error 2
make[1]: *** Waiting for unfinished jobs....

Device tree:= https://github.com/darran-kelinske-fivestars/android_device_lenovo_tb8504f/tree/lineage-15.1

Vendor tree:= https://github.com/darran-kelinske-fivestars/android_vendor_lenovo_tb8504f/tree/lineage-15.1

Kernel source:= https://github.com/darran-kelinske-fivestars/android_kernel_lenovo_tb8504f/tree/lineage-15.1

ROM Source:= https://github.com/LineageOS/android

Command: source build/envsetup.sh && breakfast tb8504f && repo sync --force-sync -q -j6 && mka recoveryimage -j6 | tee recovery.log

Full log:

https://pastebin.com/9V7tQu9G


Solution

  • I really appreciate the help from danlor.

    I took at different approach to solving this problem.

    I was using a kernel defconfig that was recommended by another rom builder and I'm not sure if it was correct so I found a way to get the defconfig from the kernel of the device.

    1. I pulled the boot.img file off the device
    2. I then grabbed the config from the kernel

      /usr/src/linux-headers-4.18.0-25-generic/scripts/extract-ikconfig kernel > lineageos_tb8504f_defconfig

    I then uploaded it to the kernel repo:

    https://github.com/darran-kelinske-fivestars/android_kernel_lenovo_tb8504f/commit/72370bfa987297398662e314a6c6e898dd193ddb

    From there, I set to user it in the make files of the device repo.

    https://github.com/darran-kelinske-fivestars/android_device_lenovo_tb8504f/commit/460d9657ab0572e448be39422b98fc0b23b0c257

    1. To get the device tree, I used the following tool:

    https://github.com/PabloCastellano/extract-dtb

    I extracted the device tree

    ./extract-dtb.py ../../../boot.img
    
    1. I then found the dbt file for the tree that was referenced above and dumped it to a file

      fdtdump 26_dtbdump_Qualcomm_Technologies,_Inc._MSM8917-PMI8937_QRD_SKU5.dtb > sku5.txt

    I then updated the device tree file to what was in the dump:

    https://github.com/darran-kelinske-fivestars/android_kernel_lenovo_tb8504f/commit/6ae1722b1906a06bb5d0b6cf8e0d8c7501ff9555

    I was then able to successfully build the recovery.

    [ 99% 1462/1467] Prebuilt:  (/home/lineageos/out/target/product/tb8504f/kernel)
    [ 99% 1463/1467] Target boot image: /home/lineageos/out/target/product/tb8504f/boot.img
    /home/lineageos/out/target/product/tb8504f/boot.img maxsize=68395008 blocksize=135168 total=27078656 reserve=811008
    [ 99% 1464/1467] Copying baseline ramdisk...
    Modifying ramdisk contents...
    cp: cannot stat '/home/lineageos/out/target/product/tb8504f/root/init.recovery.*.rc': No such file or directory
    ----- Making uncompressed recovery ramdisk ------
    [ 99% 1465/1467] ----- Making compressed recovery ramdisk ------
    [ 99% 1466/1467] ----- Making recovery image ------
    +/home/lineageos/out/target/product/tb8504f/recovery.img maxsize=68395008 blocksize=135168 total=33243136 reserve=811008
    ----- Made recovery image: /home/lineageos/out/target/product/tb8504f/recovery.img --------
    [100% 1467/1467] build /home/lineageos/out/target/product/tb8504f/system/etc/recovery-resource.dat
    
    #### build completed successfully (04:41 (mm:ss)) ####