realme X RMX1901 (CN Chinese version) Halium 9
-
I followed Porting guide and created a halium-boot.img file and flashed with fastboot successfully.
But my phone couldn't boot up with the error message "the current image (boot/recovery) have been destroyed and can not boot"
I did following:
- mkdir halium && cd halium
- repo init -u https://github.com/Halium/android -b halium-9.0 --depth=1
- repo sync -c -j 16
- code ./halium/devices/manifests/realme_RMX1901.xml
Added following:
<?xml version="1.0" encoding="UTF-8"?> <manifest> <remote name="sagar" fetch="https://github.com/SagarMakhar" /> <project path="device/realme/RMX1901" name="android_device_realme_RMX1901" remote="sagar" revision="lineage-16.0" /> <project path="device/realme/sdm710-common" name="android_device_realme_sdm710-common" remote="sagar" revision="lineage-16.0" /> <project path="kernel/realme/sdm710" name="android_kernel_realme_sdm710" remote="sagar" revision="lineage-16.0" /> <remote name="almas" fetch="https://github.com/almas" /> <project path="vendor/realme/RMX1901" name="android_vendor_tree_realme_RMX1901" remote="almas" revision="master" /> </manifest>
I didn't find official Lineage OS sources. But I found unofficial ones and used them.
- I extracted vendor blobs from stock firmware with the Android 9 version following the guide https://baalajimaestro.me/posts/extract-vendor/
Then I created a repo and added extracted vendor blobs to the https://github.com/almas/android_vendor_tree_realme_RMX1901 - ./halium/devices/setup RMX1901
- hybris-patches/apply-patches.sh --mb
- source build/envsetup.sh
result was:
including vendor/lineage/vendorsetup.sh
- breakfast RMX1901
result was:
including vendor/lineage/vendorsetup.sh Trying dependencies-only mode on a non-existing device tree? ============================================ PLATFORM_VERSION_CODENAME=REL PLATFORM_VERSION=9 LINEAGE_VERSION=16.0-20221014-UNOFFICIAL-RMX1901 TARGET_PRODUCT=lineage_RMX1901 TARGET_BUILD_VARIANT=userdebug TARGET_BUILD_TYPE=release TARGET_ARCH=arm64 TARGET_ARCH_VARIANT=armv8-a TARGET_CPU_VARIANT=kryo300 TARGET_2ND_ARCH=arm TARGET_2ND_ARCH_VARIANT=armv8-a TARGET_2ND_CPU_VARIANT=cortex-a75 HOST_ARCH=x86_64 HOST_2ND_ARCH=x86 HOST_OS=linux HOST_OS_EXTRA=Linux-5.15.0-50-generic-x86_64-Ubuntu-20.04.5-LTS HOST_CROSS_OS=windows HOST_CROSS_ARCH=x86 HOST_CROSS_2ND_ARCH=x86_64 HOST_BUILD_TYPE=release BUILD_ID=PQ3A.190801.002 OUT_DIR=/home/dd/Projects/halium-9/out PRODUCT_SOONG_NAMESPACES= hardware/qcom/audio-caf/sdm845 hardware/qcom/display-caf/sdm845 hardware/qcom/media-caf/sdm845 ============================================
- ./halium/halium-boot/check-kernel-config ./kernel/realme/sdm710/arch/arm64/configs/RMX1901_defconfig -w
(I ran this 2 times and got the message "Config file checked, found no errors.") - code device/realme/RMX1901/BoardConfig.mk
Edited like below:
# # Copyright (C) 2019 The LineageOS Project # # SPDX-License-Identifier: Apache-2.0 # # Inherit from Xiaomi sdm710-common include device/realme/sdm710-common/BoardConfigCommon.mk DEVICE_PATH := device/realme/RMX1901 # Assert TARGET_OTA_ASSERT_DEVICE := RMX1901,RMX1901CN # HIDL DEVICE_MANIFEST_FILE := $(DEVICE_PATH)/manifest.xml # Kernel TARGET_KERNEL_CONFIG := RMX1901_defconfig BOARD_BUILD_SYSTEM_ROOT_IMAGE := true # Verified Boot BOARD_AVB_ENABLE := true BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flag 2 # Inherit from the proprietary version -include vendor/realme/RMX1901/BoardConfigVendor.mk BOARD_KERNEL_CMDLINE += console=tty0 BOARD_ROOT_EXTRA_FOLDERS := \ /firmware \ /dsp \ /persist
- mka mkbootimg
No error and got message "#### build completed successfully (55 seconds) ####" - export USE_HOST_LEX=yes
- mka halium-boot
It created halium-boot.img file with size 19M. But boot.img file in stock firmware size was 64MB.
What did I do wrong? Please help me.
-
I unpacked boot.img
Stock:
python ./unpack_bootimg.py --boot_img ./stock/boot.img boot magic: ANDROID! kernel_size: 13590538 kernel load address: 0x00008000 ramdisk size: 0 ramdisk load address: 0x01000000 second bootloader size: 0 second bootloader load address: 0x00f00000 kernel tags load address: 0x00000100 page size: 4096 os version: 9.0.0 os patch level: 2019-08 boot image header version: 1 product name: command line args: console=ttyMSM0,115200n8 earlycon=msm_geni_serial,0xA90000 androidboot.hardware=qcom androidboot.console=ttyMSM0 video=vfb:640x400,bpp=32,memsize=3072000 msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 service_locator.enable=1 androidboot.configfs=true androidboot.usbcontroller=a600000.dwc3 swiotlb=1 firmware_class.path=/vendor/firmware_mnt/image loop.max_part=7 buildvariant=user additional command line args: recovery dtbo size: 0 recovery dtbo offset: 0x0000000000000000 boot header size: 1648
My build:
python ./unpack_bootimg.py --boot_img ./halium-boot.img boot magic: ANDROID! kernel_size: 14909529 kernel load address: 0x00008000 ramdisk size: 4109941 ramdisk load address: 0x01000000 second bootloader size: 0 second bootloader load address: 0x00f00000 kernel tags load address: 0x00000100 page size: 4096 os version: 9.0.0 os patch level: 2022-01 boot image header version: 0 product name: command line args: console=ttyMSM0,115200n8 earlycon=msm_geni_serial,0xA90000 androidboot.hardware=qcom androidboot.console=ttyMSM0 video=vfb:640x400,bpp=32,memsize=3072000 msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 service_locator.enable=1 androidboot.configfs=true androidboot.usbcontroller=a600000.dwc3 swiotlb=1 firmware_class.path=/vendor/firmware_mnt/image loop.max_part=7 androidboot.selinux=permissive console=tty0 additional command line args:
-
I flashed vbmeta and dtbo before flash boot. Now it seems succeeded to boot. But it's in boot loop.
fastboot flash vbmeta vbmeta.img --disable-verity --disable-verification fastboot flash dtbo dtbo.img fastboot flash boot halium-boot.img
-
@almas said in realme X RMX1901 (CN Chinese version) Halium 9:
I unpacked boot.img
Unpacked out files:
Stock:
kernel 13M ramdisk 0B
My Build:
kernel 14M ramdisk 3.9M
-
- Downloaded the Halium 9.0, arm64 (64 bit): ubuntu-touch-android9-arm64.tar.gz (https://ci.ubports.com/job/xenial-hybris-android9-rootfs-arm64/)
- Downloaded and extracted the Halium 9 LXC container image (GSI). (Link on the manual https://docs.ubports.com/en/latest/porting/build_and_boot/Halium_install.html was broken. I downloaded halium_halium_arm64.tar.xz from https://ci.ubports.com/job/UBportsCommunityPortsJenkinsCI/job/ubports%252Fporting%252Fcommunity-ports%252Fjenkins-ci%252Fgeneric_arm64/job/main/)
- Downloaded and extracted https://gitlab.com/JBBgameich/halium-install
- I executed the following commands when I entered custom recovery and plugged the phone into the computer.
adb devices ./halium-install-master/halium-install -p ut -s ./ubuntu-touch-android9-arm64.tar.gz ./system/var/lib/lxc/android/android-rootfs.img
But currently, it's in a boot loop...
-
$ ./halium-install-master/halium-install -p ut -s ./ubuntu-touch-android9-arm64.tar.gz ./system/var/lib/lxc/android/android-rootfs.img
Here is the output:
D: Chosen rootfs is ./ubuntu-touch-android9-arm64.tar.gz D: Chosen android image is ./system/var/lib/lxc/android/android-rootfs.img D: Chosen release is ut D: Compress images before pushing: false I: Writing rootfs into mountable image I: Writing android image into mountable image I: Running post installation tasks enabling SSH ... [done] Please enter a new password for the user 'phablet': Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully I: Shrinking images e2fsck 1.45.5 (07-Jan-2020) resize2fs 1.45.5 (07-Jan-2020) The filesystem is already 138429 (4k) blocks long. Nothing to do! I: Unmounting images I: Pushing rootfs and android image to /data via ADB I: Pushing rootfs to /data via ADB .halium-install-imgs.DQXbh/rootfs.img: 1 file pushed. 32.9 MB/s (3221225472 bytes in 93.286s) I: Pushing android image to /data via ADB .halium-install-imgs.DQXbh/system.img: 1 file pushed. 32.7 MB/s (576184320 bytes in 16.791s) I: Renaming to system-as-root compatible system image real 1m50,149s user 0m0,650s sys 0m4,607s I: Cleaning up umount: .halium-install-rootfs.anHND: not mounted.
-