0

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

dazza5000
  • 7,075
  • 9
  • 44
  • 89
  • 1
    The `smb_int_default` and `gpio_led_off` nodes (inside pinctrl node) are not defined within your device tree, but they're referenced anyway. You should define them. – danrodlor Jul 11 '19 at 07:32
  • thank you - I imagine that those would be defined somewhere around here? : https://github.com/darran-kelinske-fivestars/android_device_lenovo_tb8504f/tree/lineage-15.1/board – dazza5000 Jul 11 '19 at 14:27
  • 1
    No, they should be somewhere under the `pinctrl` node in the device tree of your board; `arch/arm64/boot/dts/qcom/msm8917-pmi8937-qrd-sku5.dts` (https://github.com/darran-kelinske-fivestars/android_kernel_lenovo_tb8504f/blob/lineage-15.1/arch/arm64/boot/dts/qcom/msm8917-pmi8937-qrd-sku5.dts). – danrodlor Jul 11 '19 at 14:48
  • I think I understand - smb_int_default is referenced as a variable in that section of the device tree, but it isn't actually defined in the tree. – dazza5000 Jul 11 '19 at 15:20
  • Is it a bad idea to remove the references to the variable? It looks like it is - because that will break the drivers. – dazza5000 Jul 11 '19 at 22:08
  • Well, I wouldn't do that unless I don't need the smb1360 charger IC. `smb_int_default` seems to configure the SMB interruption pin (as stated by the dt-bindings: https://github.com/darran-kelinske-fivestars/android_kernel_lenovo_tb8504f/blob/5f94feddec00f7fbc9b012e8f070e5001f4da796/Documentation/devicetree/bindings/power/smb1360-charger-fg.txt), you should be able to find this GPIO in the 425 datahseet (from the device tree, you can say that it's GPIO 61). However, I don't have the datasheets so I can't give you more info about that. There're a couple of examples in the repo. – danrodlor Jul 12 '19 at 07:31
  • Regarding `led_gpio_off`, you should be able to get rid of `pinctrl-names` and `pinctrl-0` properties without any issue (check out `gpio-leds` dt-bindings https://github.com/darran-kelinske-fivestars/android_kernel_lenovo_tb8504f/blob/5f94feddec00f7fbc9b012e8f070e5001f4da796/Documentation/devicetree/bindings/leds/leds-gpio.txt) unless those GPIOs don't have the proper (PD, PU, DS...) configuration (by default) to control the LEDs. In order to verify this, you should refer to the processor reference manual/datasheet. – danrodlor Jul 12 '19 at 07:51

1 Answers1

0

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)) ####
dazza5000
  • 7,075
  • 9
  • 44
  • 89