Skip to content

[device-port] [santoni] Xiaomi Redmi 4X #65

@bitrvmpd

Description

@bitrvmpd

Tree: halium-7.1

  • Create manifest - santoni
  • Boot image and system image build successfully
  • Device boots into rootfs, usb: Manufacturer: GNU/Linux Device appears in dmesg on host.
  • LXC container starts and does not crash
  • libhybris tests
    • test_gps
    • test_hwcomposer
    • test_lights
    • test_vibrator
    • test_wifi
    • test_sensors
    • test_audio
    • test_camera
    • test_input
    • test_nfc (not avaliable)
    • test_recorder

Troubleshooting:

  • libnativehelper ScopedPthreadMutexLock.h missing
    Added manually in libnativehelper/include/nativehelper download here.
    Maybe I'm missing a project in my manifest.xml?, I know there must be a better way to fix this.

    It was, Halium/android was missing android_libcore repo Add libcore android#17
  • signapk.jar was missing/not found
    Fixed by removing all .apk/.jar references inside proprietary-files.txt in device tree Loup-ROM/android_device_xiaomi_santoni@28243c1
    Loup-ROM/android_device_xiaomi_santoni@4d16924
  • failed to allocate "X" blocks, out of space?:
    error: ext4_allocate_best_fit_partial: failed to allocate "X" blocks, out of space?
    fixed after using this patch Make system.img the right size for the device halium-scripts#4
  • lxc crashing, /var/lib/lxc/android/rootfs Input/output error
    fixed after removing f2fs support in device tree Loup-ROM/android_device_xiaomi_santoni@07c073b
  • pm-service, dmesg being flooded with this:
    kernel: IPC_RTR: msm_ipc_router_bind: pm-service Do not have permissions
    fixed by applying this patch to the kernel Halium/android_kernel_lge_bullhead@a34bb3a...0b64b0c
    and adding pm-service to net_raw group Loup-ROM/android_device_xiaomi_santoni@46d4423
  • wifi
    for wifi to work I had to run this: echo sta > /sys/module/wlan/parameters/fwpath
  • Device reboots while installing a different rootfs: Installing a different rootfs (plasma,ubports,etc) causes a reboot because the extraction process fills all the RAM, so the installation never finishes. Sending a different busybox binary doesn't help.
    The solution is to add a swap device temporarily and reduce the aggressiveness of the LMK.
    Add these lines before echo "transfering rootfs tarball ... " in halium-install script
# Check if we have a swap device enabled
if [ $(do_shell "cat /proc/swaps | wc -l") -lt 2 ]
then
    echo "Enabling swap device"
    SWAP=1
    do_shell "dd if=/dev/zero of=/data/tmpswap bs=2048M count=1"
    do_shell "mkswap /data/tmpswap"
    do_shell "swapon /data/tmpswap"
    # We need to low the aggressiveness of LMK so the device doesn't reboot.
    echo "Reducing LowMemoryKiller agressiveness"
    do_shell "echo 9999 > /sys/module/lowmemorykiller/parameters/adj"
    do_shell "echo 1 > /sys/module/lowmemorykiller/parameters/minfree"
fi

Then add these inside cleanup_device function to remove the swap file.

if [ -n "$SWAP" ]
then
    do_shell "sync"
    do_shell "swapoff /data/tmpswap"
    do_shell "rm -rf /data/tmpswap"
fi

Sources

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions