Jump to content

Patches for: [ICS][CM9][4.0.4] CyanogenMod 9.1 for the Huawei Ascend G300 [ROM] from Dazzozo


Guest backside

Recommended Posts

Guest backside

Hi,

I like to open this thread for contribute to the good effort from Dazzozo to port and patch CM9 for the G300.

This thread is for posting PATCHES or CONTRIBUTIONS. Please, don't post for requests or suggestions, or for report bugs; use the main thread to do it. This is a DEV thread.

Next two posts include some contributions by myself.

Backside!

Edited by backside
Link to comment
Share on other sites

Guest backside

PATCH #1: Fix Compcache (AKA zram) disabled

Explanation: The current compcache service isn't started in CM9. The source uses the file "/system/etc/init.local.rc" to declare at boot the service, but this file is NEVER called at the boot process. The file "/init.rc" has the import, but the filesystem isn't mounted (/system) when the "/init" parser reads the import. You can check that this an unresolved bug of cyanogenmod. If you like to check: open an ADB session and see "/dev/block/zram0".

Solution: Execute the file "/system/bin/handle_compcache". This initializes the compcache using the correct values of the interface. To execute this file, you have two options:

  • Option 1: Modify the file "/init.rc" to include the lines from file "/system/etc/init.local.rc". This is a hard work because you need to edit the "boot.img" file and write it to flash. I suggest to Dazzazo to include this on next release. This creates the service compcache inside the Android.
  • Option 2: Add a "init.d" file that call to "/system/bin/handle_compcache". I add an attachment with one of this files. You only need to set RW of SYSTEM and copy the file to "/system/etc/init.d/".

Note: The same patch apply to any other custom ROM based on CM9. This problem is derived from cyanogemod.

89zram.zip

Edited by backside
Link to comment
Share on other sites

Guest backside

PATCH #2: CDROM.ISO (AKA automount) enabled

Explanation: Stock ICS firmwares for G300 have the hability to provide a virtual CDROM drive with an ISO file that contains the driver for the device. When you use a Windows computer connected to the mobile in the Mass Storage (UMS) mode, a CDROM unit appears on the host. This is done because the stock ROM provides the file "/system/cdrom/autorun.iso", a simple ISO image file that contains the drivers. You can replace this file with ANY other file (in ISO format) and you see your CDROM content from the phone. Nevertheless, the CM9 ROM by Dazzozo don't have support to this file... after now!

Solution: If you modify the file "/init.huawei.usb.rc" and include the next lines you can restore this functionality (remember that edit "init.rc" files is a hard work!):

# USB google mode configuration

on property:sys.usb.config=autorun,mass_storage

	write /sys/class/android_usb/android0/enable 0

	write /sys/class/android_usb/android0/idVendor 12d1

	write /sys/class/android_usb/android0/idProduct 1037

	write /sys/class/android_usb/android0/f_mass_storage/nluns 3

	write /sys/class/android_usb/android0/f_mass_storage/cdrom_index 2

	write /sys/class/android_usb/android0/f_mass_storage/lun2/file /system/cdrom/autorun.iso

	write /sys/class/android_usb/android0/functions mass_storage

	write /sys/class/android_usb/android0/enable 1

	setprop sys.usb.state $sys.usb.config


on property:sys.usb.config=autorun,mass_storage,adb

	write /sys/class/android_usb/android0/enable 0

	write /sys/class/android_usb/android0/idVendor 12d1

	write /sys/class/android_usb/android0/idProduct 1038

	write /sys/class/android_usb/android0/f_mass_storage/nluns 3

	write /sys/class/android_usb/android0/f_mass_storage/cdrom_index 2

	write /sys/class/android_usb/android0/f_mass_storage/lun2/file /system/cdrom/autorun.iso

	write /sys/class/android_usb/android0/functions mass_storage,adb

	write /sys/class/android_usb/android0/enable 1

	start adbd

	setprop sys.usb.state $sys.usb.config

Include this code after the "on boot" section at the begining. This don't complete the trick, you need to execute in ADB the command "setprop sys.usb.state autorun,mass_storage,adb", and after that if you have a file at "/system/cdrom/autorun.iso" you show the content in your workstation!

Note: If you like you can use a GUI to do the task to select the ISO file, use the great free APP "DriveDroid" (search for it on the Market). Please, note that this software is developed thinking in use images as USB MASS STORAGE (like a pendrive), not for PURE ISO (CDROM emulation). The proposed hack works with ANY ISO, and you don't need at all any hybrid support. You can boot any bootable OS (not only Linux!) or use any type of CDROM. To mount as CDROM choose as the logical unit "F Mass Storage 3".

Edited by backside
Link to comment
Share on other sites

Guest Dazzozo

The cdrom is known. I removed it intentionally because it was such a pain in the ass. To install CM you have to have installed these drivers already.

The zram issue is also known -- a friend fixed it a few weeks ago for the U8185. I can have it implemented for R6.

Link to comment
Share on other sites

Guest backside

The cdrom is known. I removed it intentionally because it was such a pain in the ass. To install CM you have to have installed these drivers already.

The zram issue is also known -- a friend fixed it a few weeks ago for the U8185. I can have it implemented for R6.

Hi Dazzozo,

Good news about patching the bug of zram in R6!

Related to CD-Emulation: You don't need to include the file "automount.iso" in the ROM. You only need to add support for it! If you see about the DriveDroid tool, you can mount ANY iso that you like. In any case, the definition of the "autorun,..." don't has any interference with the current rom. It's only for add a new mode (automount), and anyone has to worry about it. Please, update the file "/init.huawei.usb.rc" with the new code for the next release! I ask for this because patching init.rc files is difficult (modify the "boot.img" it's risky and time consuming). Remember: you only ADD a new definition mode without collateral effects.

Edited by backside
Link to comment
Share on other sites

Guest backside

Thank you, Dazz!

You'll consider also to "patch" the values of auto-brightness in the R6?

And one more question: What branch I need to use from your git tree of the kernel that you use for compatibility with R5 (and future releases)?

https://github.com/Dazzozo/android_kernel_huawei_u8815

I like to compile some other modules and patch some of them. Can you provide some simple instructions? Can you publish for each release the tag used for kernel?

Best!

Edited by backside
Link to comment
Share on other sites

Guest Dazzozo

Thank you, Dazz!

You'll consider also to "patch" the values of auto-brightness in the R6?

And one more question: What branch I need to use from your git tree of the kernel that you use for compatibility with R5 (and future releases)?

https://github.com/Dazzozo/android_kernel_huawei_u8815

I like to compile some other modules and patch some of them. Can you provide some simple instructions? Can you publish for each release the tag used for kernel?

Best!

You want the ics branch for CM9. Yeah, I can probably start tagging it.

I've been given some brightness values in IRC that seem to fix the button backlight issues.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.