Jump to content


Photo

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


  • Please log in to reply
10 replies to this topic

#1
backside

backside

    Newbie

  • Members
  • Pip
  • 36 posts
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, 06 December 2012 - 12:17 AM.

  • 0

#2
mack_

mack_

    Addict

  • Members
  • PipPipPipPipPip
  • 897 posts
  • Gender:Male
  • Location:London
  • Interests:Im a techy who tests phones to the max!!
  • Devices:Xperia SP
...

Edited by mack_, 06 December 2012 - 07:34 AM.

  • 0
I was once a noob like you.... until i bricked my G300. ^_^
If i helped you or you just like my topic/post ,give me some rep with the green button

#3
backside

backside

    Newbie

  • Members
  • Pip
  • 36 posts
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.

Attached Files


Edited by backside, 06 December 2012 - 12:51 AM.

  • 0

#4
backside

backside

    Newbie

  • Members
  • Pip
  • 36 posts
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, 06 December 2012 - 12:57 AM.

  • 0

#5
Dazzozo

Dazzozo

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 3,319 posts
  • Gender:Male
  • Location:York, UK
  • Devices:Crescent, G300, Y300, Nexus 5
  • Twitter:@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.

  • 1
Like my work? Give me rep!

Like my work a lot? Donate! Remember to leave your forum name if you want to be credited!

#6
samjam

samjam

    Addict

  • Members
  • PipPipPipPipPip
  • 557 posts
I'd like to present a 1.2G Linux mint ISO on my SD card as a CD

  • 0

#7
backside

backside

    Newbie

  • Members
  • Pip
  • 36 posts

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, 06 December 2012 - 08:13 PM.

  • 0

#8
Dazzozo

Dazzozo

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 3,319 posts
  • Gender:Male
  • Location:York, UK
  • Devices:Crescent, G300, Y300, Nexus 5
  • Twitter:@Dazzozo
I'll consider it :)

  • 0
Like my work? Give me rep!

Like my work a lot? Donate! Remember to leave your forum name if you want to be credited!

#9
backside

backside

    Newbie

  • Members
  • Pip
  • 36 posts
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/D...el_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, 07 December 2012 - 11:25 PM.

  • 0

#10
Dazzozo

Dazzozo

    Hardcore

  • Developer Team
  • PipPipPipPipPipPip
  • 3,319 posts
  • Gender:Male
  • Location:York, UK
  • Devices:Crescent, G300, Y300, Nexus 5
  • Twitter:@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/D...el_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.

  • 0
Like my work? Give me rep!

Like my work a lot? Donate! Remember to leave your forum name if you want to be credited!

#11
backside

backside

    Newbie

  • Members
  • Pip
  • 36 posts
Ok Dazz,

Please, begin to tag your releases. We like to use your great kernel & rom, and make patches.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users