Skip to content
Permalink
Browse files

u8815: add script for determining libcm to be used

This script thanks to a modification to fs/proc/app_info.c links
the correct libcm.so to /system/lib/libcm.so based on which baseband
is being used. This is possible as the baseband can be identified
by what framebuffer memory has been allocated by the bootloader.

This is being done because many people have been suffering from
random reboots on any custom ROM on the 2030 baseband for some
unknown reason, and 109808 works fine. Asking everyone to move
back to the 109808 baseband would be unreasonable and having
to maintain 2 builds for 1 lib is unreasonable too. :P

Thanks kra1o5 for the libcm.so findings :D
  • Loading branch information
Dazzozo committed Mar 11, 2013
1 parent aeb67c7 commit 20ab3ecf1c68103fd44a2eed7c65199b066619f0
Showing with 29 additions and 0 deletions.
  1. +21 −0 configs/baseband.sh
  2. +1 −0 device.mk
  3. +7 −0 ramdisk/init.huawei.rc
@@ -0,0 +1,21 @@
#!/system/bin/sh

# Determined by arch/arm/mach-msm/hardware_self_adapt.c
cat /proc/app_info | grep -A1 "baseband_version:" | grep -q "109808"
baseband=$?

mount -o remount,rw /system

if [ -f /system/lib/libcm.so ]; then
rm /system/lib/libcm.so
fi

# Link the correct libcm.so to /system/lib/libcm.so depending on baseband.
if [ $baseband == 0 ]; then
ln -s /system/lib/109808/libcm.so /system/lib/libcm.so
mount -o remount,ro /system
exit 0
fi

ln -s /system/lib/2030/libcm.so /system/lib/libcm.so
mount -o remount,ro /system
@@ -72,6 +72,7 @@ PRODUCT_COPY_FILES += \
device/huawei/u8815/configs/AutoVolumeControl.txt:system/etc/AutoVolumeControl.txt \
device/huawei/u8815/configs/media_codecs.xml:system/etc/media_codecs.xml \
device/huawei/u8815/configs/media_profiles.xml:system/etc/media_profiles.xml \
device/huawei/u8815/configs/baseband.sh:system/etc/baseband.sh \
device/huawei/u8815/configs/vold.fstab:system/etc/vold.fstab

PRODUCT_COPY_FILES += \
@@ -137,6 +137,8 @@ on fs
# Imported from init.msm7627a.rc
write /sys/module/block2mtd/parameters/block2mtd /dev/block/mmcblk0p17

start libcm_link

# msm specific files that need to be created on /data
on post-fs-data
mkdir /data/misc/bluetooth 0770 bluetooth bluetooth
@@ -215,6 +217,11 @@ service port-bridge /system/bin/port-bridge /dev/smd0 /dev/ttyGS0
group system inet
disabled

service libcm_link /system/bin/sh /system/etc/baseband.sh
user root
disabled
oneshot

on property:ro.baseband="msm"
start port-bridge
# Enable BT-DUN only for all msms

3 comments on commit 20ab3ec

@Dazzozo

This comment has been minimized.

Copy link
Owner Author

Dazzozo replied Mar 12, 2013

Oops, it was fefifofum who discovered the libcm stuff. 🌴

@alanorth

This comment has been minimized.

Copy link
Collaborator

alanorth replied Mar 12, 2013

libcm?!

@Dazzozo

This comment has been minimized.

Copy link
Owner Author

Dazzozo replied Mar 12, 2013

Not CM as in CyanogenMod :p

Please sign in to comment.
You can’t perform that action at this time.