Proper port of /e/OS to Motorola Deen (dtbo and signing failure)

I’m trying to build e/os for an unsupported device: Motorola One (codename: deen). I’m partially successful and able to make a userdebug signed version by following the steps of Edelling here: Motorola One (xt1941-4) „deen“: How to build e/OS 0.22 – Herr Elling by using the “repo” way. He uses code from electimon and from 100dasy.

There are however issues when trying to use the docker build system and when trying to sign the the images with my own keys.

The docker build system fails after compilation, when it tries to make the images. I have the same issue when trying to compile LineageOS 17.1 and Microg for Lineage, so something is missing for sure.

The exact error is:

  VDSOL   arch/arm64/kernel/vdso/vdso.so.dbg
  VDSOSYM include/generated/vdso-offsets.h
  DTC     arch/arm64/boot/dts/qcom/msm8953-deen-evt1.dtb
  DTC     arch/arm64/boot/dts/qcom/msm8953-deen-evt2.dtb
  DTC     arch/arm64/boot/dts/qcom/msm8953-deen-dvt1a.dtb
  DTC     arch/arm64/boot/dts/qcom/msm8953-deen-dvt1b.dtb
  DTC     arch/arm64/boot/dts/qcom/msm8953-deen-dvt2.dtb
  DTC     arch/arm64/boot/dts/qcom/msm8953-deen-pvt1.dtb
  DTC     arch/arm64/boot/dts/qcom/msm8953-deen-pvt2.dtb
Warning (reg_format): "reg" property in /soc/et320 has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1)
Warning (reg_format): "reg" property in /soc/et320 has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1)
Warning (reg_format): "reg" property in /soc/et320 has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1)
Warning (reg_format): "reg" property in /soc/et320 has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1)
Warning (reg_format): "reg" property in /soc/et320 has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1)
Warning (reg_format): "reg" property in /soc/et320 has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1)
Warning (reg_format): "reg" property in /soc/et320 has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1)
make[1]: Leaving directory '/srv/src/Q/out/target/product/deen/obj/DTBO_OBJ'
make: Leaving directory '/srv/src/Q/kernel/motorola/deen'
Traceback (most recent call last):
  File "/srv/src/Q/out/host/linux-x86/bin/mkdtboimg.py/internal/stdlib/runpy.py", line 174, in _run_module_as_main
  File "/srv/src/Q/out/host/linux-x86/bin/mkdtboimg.py/internal/stdlib/runpy.py", line 72, in _run_code
  File "/srv/src/Q/out/host/linux-x86/bin/mkdtboimg.py/__main__.py", line 12, in <module>
  File "/srv/src/Q/out/host/linux-x86/bin/mkdtboimg.py/internal/stdlib/runpy.py", line 174, in _run_module_as_main
  File "/srv/src/Q/out/host/linux-x86/bin/mkdtboimg.py/internal/stdlib/runpy.py", line 72, in _run_code
  File "/srv/src/Q/out/host/linux-x86/bin/mkdtboimg.py/mkdtboimg.py", line 1052, in <module>
  File "/srv/src/Q/out/host/linux-x86/bin/mkdtboimg.py/mkdtboimg.py", line 1049, in main
  File "/srv/src/Q/out/host/linux-x86/bin/mkdtboimg.py/mkdtboimg.py", line 850, in create_dtbo_image
ValueError: List of dtimages to add to DTBO not provided
[ 71% 80198/112442] //system/hardware/interfaces/suspend/aidl:suspend_control_aidl_interface-cpp clang++ android/system/suspend/ISuspendControlService.cpp [arm]
[ 71% 80199/112442] //system/core/fastboot:fastboot install fastboot [linux_glibc]
[ 71% 80200/112442] //system/hardware/interfaces/suspend/aidl:suspend_control_aidl_interface-cpp clang++ android/system/suspend/ISuspendCallback.cpp [arm]
[ 71% 80201/112442] //system/hardware/interfaces/suspend/aidl:suspend_control_aidl_interface-cpp clang++ android/system/suspend/ISuspendControlService.cpp
[ 71% 80202/112442] //system/tools/sysprop:sysprop_cpp clang++ CppMain.cpp [linux_glibc]
[ 71% 80203/112442] //system/hardware/interfaces/suspend/aidl:suspend_control_aidl_interface-cpp clang++ android/system/suspend/ISuspendCallback.cpp
[ 71% 80204/112442] //system/hardware/interfaces/suspend/1.0/default:android.system.suspend@1.0-service clang++ SuspendControlService.cpp
[ 71% 80205/112442] //system/tools/sysprop:sysprop_cpp clang++ proto/system/tools/sysprop/sysprop.pb.cc [linux_glibc]
[ 71% 80206/112442] //system/tools/sysprop:sysprop_java clang++ proto/system/tools/sysprop/sysprop.pb.cc [linux_glibc]
[ 71% 80207/112442] //system/hardware/interfaces/suspend/1.0/default:android.system.suspend@1.0-service clang++ main.cpp
[ 71% 80208/112442] //system/tools/sysprop:sysprop_java clang++ CodeWriter.cpp [linux_glibc]
[ 71% 80209/112442] //system/hardware/interfaces/suspend/1.0/default:android.system.suspend@1.0-service clang++ SystemSuspend.cpp
[ 71% 80210/112442] //system/tools/sysprop:sysprop_cpp clang++ CppGen.cpp [linux_glibc]
[ 71% 80211/112442] //system/tools/sysprop:sysprop_cpp clang++ Common.cpp [linux_glibc]
[ 71% 80212/112442] //system/tools/sysprop:sysprop_java clang++ Common.cpp [linux_glibc]
ninja: build stopped: subcommand failed.
22:44:47 ninja failed with: exit status 1

#### failed to build some targets (01:00:47 (hh:mm:ss)) ####

>> [Sun Jul 24 22:44:47 UTC 2022] Failed build for deen
>> [Sun Jul 24 22:44:47 UTC 2022] Finishing build for deen
>> [Sun Jul 24 22:44:47 UTC 2022] Cleaning source dir for device deen
22:45:10 Entire build directory removed.

And my docker build command is here:

$ cat ~/bin/build-e.sh
#!/bin/bash

BDIR=$(pwd)

mkdir -p "${BDIR}/"{src,zips,logs,ccache,keys,manifests}

cat <<'EOF' > ${BDIR}/manifests/deen.xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <remote name="device" fetch="https://github.com/" revision="refs/heads/lineage-17.1" />
  <remote name="kernel" fetch="https://github.com/" revision="refs/heads/android-10-release-qpks30.54-22-13" />
  <remote name="vendor" fetch="https://github.com/" revision="refs/heads/lineage-17.1" />
  <default revision="refs/heads/lineage-17.1"
           remote="github"
           sync-c="true"
           sync-j="4" />
  <project path="device/motorola/deen" remote="device" name="EdElling/device_motorola_deen" />
  <project path="kernel/motorola/deen" remote="kernel" name="EdElling/android_kernel_motorola_deen" />
  <project path="vendor/motorola/deen" remote="vendor" name="EdElling/vendor_motorola_deen" />
  <project path="system/qcom" remote="github" name="LineageOS/android_system_qcom" />
</manifest>
EOF

docker run \
-e "DEVICE_LIST=deen" \
-e "BRANCH_NAME=v1-q" \
-v "${BDIR}/src:/srv/src" \
-v "${BDIR}/zips:/srv/zips" \
-v "${BDIR}/logs:/srv/logs" \
-v "${BDIR}/ccache:/srv/ccache" \
-v "${BDIR}/keys:/srv/keys" \
-v "${BDIR}/manifests:/srv/local_manifests" \
-e "REPO=https://gitlab.e.foundation/e/os/releases.git" \
registry.gitlab.e.foundation:5000/e/os/docker-lineage-cicd:community

The second issue I have is that by signing the repo built with my own keys, I get a boot loop. The boot.img, system.img and vendor.img are the same as in the case of the “userdebug” keys. I only select “motorola-deen-user” as the device instead of the “userdebug”. The keys are properly generated by the build system. The only error I see in the “recovery” is a complaint about not being able to mount the /emulated/0 partition.

I hope I get some help (LOS devs are only bragging but not helping. Perhaps here will be different). Once android 10 runs (with proper keys etc), I want to continue to Android 11 and update the binary blobs for deen using the latest available update from Motorola.