UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    realme X RMX1901 (CN Chinese version) Halium 9

    Scheduled Pinned Locked Moved Unsolved Porting
    6 Posts 1 Posters 1.3k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      This topic has been deleted. Only users with topic management privileges can see it.
      • A Offline
        almas
        last edited by

        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"
        index.jpeg

        I did following:

        1. mkdir halium && cd halium
        2. repo init -u https://github.com/Halium/android -b halium-9.0 --depth=1
        3. repo sync -c -j 16
        4. 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.

        1. 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
        2. ./halium/devices/setup RMX1901
        3. hybris-patches/apply-patches.sh --mb
        4. source build/envsetup.sh
          result was:
        including vendor/lineage/vendorsetup.sh
        
        1. 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
        ============================================
        
        
        1. ./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.")
        2. 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
        
        
        1. mka mkbootimg
          No error and got message "#### build completed successfully (55 seconds) ####"
        2. export USE_HOST_LEX=yes
        3. 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.

        A 1 Reply Last reply Reply Quote 0
        • A Offline
          almas @almas
          last edited by

          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: 
          
          A 2 Replies Last reply Reply Quote 0
          • A Offline
            almas @almas
            last edited by

            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
            
            1 Reply Last reply Reply Quote 0
            • A Offline
              almas @almas
              last edited by

              @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
              
              A 1 Reply Last reply Reply Quote 0
              • A Offline
                almas @almas
                last edited by

                1. Downloaded the Halium 9.0, arm64 (64 bit): ubuntu-touch-android9-arm64.tar.gz (https://ci.ubports.com/job/xenial-hybris-android9-rootfs-arm64/)
                2. 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/)
                3. Downloaded and extracted https://gitlab.com/JBBgameich/halium-install
                4. 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...

                A 1 Reply Last reply Reply Quote 0
                • A Offline
                  almas @almas
                  last edited by

                  $ ./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.
                  
                  
                  1 Reply Last reply Reply Quote 0
                  • A almas referenced this topic on
                  • First post
                    Last post