[Guide] Android Cooking Guide for HD2 [Guide]

Search This thread

htcfreak

Senior Member
Feb 12, 2008
1,145
164
Mumbai/Belgaum
www.vishalconst.com
heartsurfer008 said:
Well I am desparetly trying to cook a NAND build for my HD2 but there is pretty much less info available for me [a big NOOB in cooking] to try out my luck at cooking..!!!

So I'll appreciate if someone would put some light on it..!!!

PS: - I would appreciate if somebody can provide a detailed info..!!! :D
Finally the tutorial

Make your own Android Build for the HD2 by domineus
I have always lived by these words- if you give a man a fish, he can eat for a day; but if you teach a man to fish you can eat for a lifetime. Android on the HD2 has always been an interesting thing for me and I know a lot of people that want to create their own builds, but have no idea how. If you ask a build creator or maybe someone in the htc-linux-chat how to get started, there may not be an answer. In fact, some of the perplexing behavior has left me puzzled in several ways - as if how to get an android build is a vaulted secret of knowledge like the holy grail. To be honest, it's not. It's a bit of hard work, a few nods in the right direction, and ultimately it's a community involved project. Just like miui development is a community project spanning actual continents to get this thing on our device every single week! It has led to a lot of questions, in my inbox, of how to begin. For a long time, the answer to the question was not answered until Cass helped me out. I want to do the same and contribute how to get a build of miui (or any android build) to the HTC HD2.

Things you will need
In order to properly start android development, it would be a good idea to make sure you have the following (a lot of it is no duh when you think about it)
A computer running linux
I can't stress that enough. While there is a lot of things you can do in windows, you will need some sort of linux distro in order to get android properly running on your HD2. There are a lot of linux distros you can use; with many using ubuntu as it is the most user friendly. I use Fedora and I am quite happy with the results. It's simple and effective. It gets the job done. Get a distro that you feel can get the job done.
Android SDK - either windows or linux
Android SDK is something that can be freely accessed and downloaded from the following location:
http://developer.android.com/sdk/index.html
It is a developer environment, but probably the most important thing you can use here (for the time being) is logcat. Logcat provides you to visually see the libraries and files working together to get android to work as well as if you run into an issue, it is the first thing you should resort to. For instance, boot reloop? Take a look at your logcat and try again.
A kernel
There are quite a few kernels available for android previously and they are divided into evo kernel or nexus one kernel. Many builders have transitioned to an evo kernel for PPP and a few other nice details but it is totally up to you. I highly recommend hastarin's kernel. For most of the time, it works well. But as you have noted, on MIUI, it hasn't been working as fantastic on other builds.
Donor Files
This is a bit difficult to find because it appears that the files that work best are nexus one builds without CM6.1 modification. So far, only one chef has that and it is tytung's nexus one build. Regardless of whose files you're using (e.g. tytung or darkstone's system which is the preferred choice) you will need a well working android build. You will be pulling several files in order to port.
MIUI itself (well any build honestly just miui is a good example)
This is a given. However, if you download from miui.com you will probably have an untranslated rom with odex files. That's bad. And in Chinese! It would be a good idea to browse the English forum for a deodexed rom with appropriate english translation (apps and frameworks)
-If pulling files from windows, you will need this
system extractor
http://uranus.chrysocome.net/linux/explore2fs-old.htm
I use that if I download in windows. It's relatively straight forward and it allows you to pull the files you need from the system.ext2 you're using and copying them to folders necessary.
build.prop
This you will need. You can find one here:
http://www.multiupload.com/B59IU3S6XY
Patience
Probably the most important thing. One thing I have noticed is you need patience to make it through. Sometimes, your build works, sometimes it doesn't. And it is difficult to still keep going. But gotta pull it all in and keep trying...it does pay off.

Okay so you have your files, a nice linux distribution, your build you want to port (MIUI preferrably) and you're ready to go. Now it's time to begin the process!

Step One - The Setup

I usually grab my files in windows before transitioning to my linux distro to finish the process. If you using windows 7 and you are using explore2fs, you will definitely have to right click on the exe and make it compatible by selecting compatible with windows vista. The file should also need to be run by administrator. If you don't know how to do that you can google compatibility in windows 7.

First thing is first. Create a new folder, you can call it donor_files if you want because name is arbitrary. The most important thing is to just name it. Within that folder, create a new folder called system. Enter the system directory and create a new folder called etc. Within etc, select Once that is done, create a new folder within etc called firmware. Once completed, return back to the system folder, create the folder called lib. In the lib folder, create a new folder called hw. So your folder should look like this:

Folder Name
-system
--etc
---firmware
--lib
---hw

So far so good? Excellent. Now, if you're in windows you will need to do a few things. Extract the system.ext2 of your donor build and place it somewhere you will remember (like your desktop). Now open up explore2fs, select file, and open image file. Under files of type (drop down), select all files and navigate to your system.ext2 file. You should now see the ext loaded on the left side of the program's workspace. Located is a very small + that allows you to view all directories in your ext2 file. Click that.

You will see several system folders on the left and files on the root. Since you haven't selected a specific folder, in the right hand view, you should see the file build.prop. If you did select a folder (like app) you will see some files. And that's okay too. Get a feel of the program.

Now you will do a test file pull. On the left hand side, select the folder etc. On the right window, you will see several files. We want AudioBTID.csv. Once you see the file, right click on AudioBTID.csv and select export file. Navigate to the donor file folder (or whatever you named it) and place the file in system/etc of that folder. Congratulations you just pulled your first file! But you will need a lot more files. Within the same directory, pull gps.conf, hosts, media_profiles.xml and the ppp folder. Now, navigate to firmware and pull the following files:

BCM4329B1_002.002.023.0360.0362.hcd default_france.acdb htcleo.acdb
BCM4329B1_002.002.023.0436.0439.hcd default_nel.acdb yamato_pfp.fw
bcm4329.hcd fw_bcm4329_apsta.bin yamato_pm4.fw
default.acdb fw_bcm4329.bin

Ideally you should not be able to find htcleo.acdb. You can find it here

http://gitorious.org/xdandroid_leo/q...eo/htcleo.acdb

Now in explore2fs, go to the lib directory and pull these files and place them in your lib directory:

libcamera.so
libcamera_client.so
libcameraservice.so
libhtc_ril_wrapper.so
libmm-omxcore.so
liboemcamera.so
libomx_aacdec_sharedlibrary.so
libomx_amrdec_sharedlibrary.so
libomx_amrenc_sharedlibrary.so
libomx_avcdec_sharedlibrary.so
libomx_m4vdec_sharedlibrary.so
libomx_mp3dec_sharedlibrary.so
libomx_sharedlibrary.so
libomx_wmadec_sharedlibrary.so
libomx_wmvdec_sharedlibrary.so
libOmxCore.so
libOmxVdec.so
libOmxVidEnc.so
libqcomm_omx.so
libstagefright_omx.so

Once those files are pulled, navigate to the hw folder of the system and pull the following files:

sensors.htcleo.so
lights.htcleo.so

Once those files are pulled, you can save your donor files to a flash drive and then boot into your linux distro. Login to superuser in terminal. For fedora, the proper method involves typing in su --login and entering your password you set up. Minimize your terminal window.

Extract the miui (or any other build) to your desktop (the focus is the system folder). Ensure the rom is deodexed and in your own language (if its miui, you will have to apply the proper language translations). Now copy the files you pulled from your donor build and apply it to the appropriate folders (usually a copy and a paste-literally). In this instance there will be duplicate files, overwrite them. That's the point! Do not forget the build.prop file I linked to earlier. You should add that to system folder.

So the files are copied, the next step is to restore the minimized terminal window (the one that is logged in as root). cd to where your system is located (not to the system folder itself). Now you will have to enter the following commands in terminal

chmod -R 777 system/etc
chmod 755 system/bin/*
chmod 755 system/xbin/*
rm system/etc/firmware/default*acdb (if you have sound in call issues)
touch system/etc/ppp/active (If you have latest wrapper and need ppp)
chown root:2000 system/bin/pppd
chmod 4755 system/bin/pppd
chown root:root system/xbin/su
chmod 4755 system/xbin/su
chown root:root system/xbin/hci*
chmod 4755 system/xbin/hci*

dd if=/dev/zero of=system.ext2 bs=1048576 count=256
mke2fs -F system.ext2
sudo mount -o loop system.ext2 /mnt2
cp -rp system/* /mnt2
sudo umount /mnt2

A few words on this that I must bold. the /mnt2 directory may not exist. If not, try mnt, that usually works

Once this is done, you will have a nice system.ext2. The only thing you'd need now is a rootfs, a kernel, clrcad.exe and a startup.txt file. Once that is done, you can test your build out.

Any questions

Special thanks to Cass and the htc-linux-chat for the few pointers they gave me.

The guide is by "domineus - http://www.miui-dev.com/" & I take no credit what so ever​


Thanks to "white-energy" for giving us the link..!!!

Hope to have many more Chief's for our HD2, so that we [especially me] can satisfy our hunger to try different builds/ROM's..!!! ;)

Happy Cooking..!!!​

PLEASE PRESS THANKS IF YOU FOUND THIS THREAD USEFUL..!!!
 
Last edited:

velayo

Senior Member
May 23, 2010
528
98
Santa Isabel, Puerto Rico
I've been looking for something like this. I want to create my own build for the recovery flasher. I guess the only thing needed would be how to convert from regular nand to recovery.

Thanks bro.
 

deckoff

Senior Member
Mar 23, 2008
602
138
Sofia
Is there a way to edit system.bin files, that comes with the NAND builds. I suppose that is where the ROM is. I want to unpack, edit the included apps and repack. How it is done? How the bin file is done. Google does not give any satisfiable links, did a quick search, though...
 
  • Like
Reactions: Igr1

jhr5474

Senior Member
Sep 20, 2010
1,544
488
Holley, Oregon
i am confused

Which explore 2fs do I download? There are 3 different ones one for binary one for code and optional update source code. I am a noob and tired of not having roms I am happy with. I have windows 7 and xp. I realize this will take time and I am good with it everything thats worth anything takes time.
 

KillaHurtz

Senior Member
Aug 13, 2010
2,582
706
Albuquerque
Is there a way to edit system.bin files, that comes with the NAND builds. I suppose that is where the ROM is. I want to unpack, edit the included apps and repack. How it is done? How the bin file is done. Google does not give any satisfiable links, did a quick search, though...

I think you mean system.img not system.bin :)
You can extract them with the unyaffs.exe or with the unyaffs command under linux. I have written a guide with attatched utilities here
Additionally birksoffsjunk (seasoned WM guru & chef of ChuckyDroid, ChuckyROM, & Dexter) has made a batch program to make this process easier. It's a work in progress & somethings are still buggy so follow the thread ;)

Between the utility birkoffsjunk made & the tutorial I wrote you should be able to successfully edit & run your own build. Hope this helps.
 

KillaHurtz

Senior Member
Aug 13, 2010
2,582
706
Albuquerque
Is there a way to edit system.bin files, that comes with the NAND builds. I suppose that is where the ROM is. I want to unpack, edit the included apps and repack. How it is done? How the bin file is done. Google does not give any satisfiable links, did a quick search, though...

I think you mean system.img not system.bin :)
You can extract them with the unyaffs.exe or with the unyaffs command under linux. I have written a guide with attatched utilities here
Additionally birksoffsjunk (seasoned WM guru & chef of ChuckyDroid, ChuckyROM, & Dexter) has made a batch program to make this process easier. It's a work in progress & somethings are still buggy so follow the thread ;)

Between the utility birkoffsjunk made & the tutorial I wrote you should be able to successfully edit & run your own build. Hope this helps.
 
  • Like
Reactions: deckoff

af974

Retired Recognized Developer / Retired Forum Mod
Jan 22, 2008
4,934
1,683
Redmi Note 8
White-Energy use system.bin in his rom :)

Regarding initr and zimage, there is a guide that you can point me on ?

Thank you

I think you mean system.img not system.bin :)
You can extract them with the unyaffs.exe or with the unyaffs command under linux. I have written a guide with attatched utilities here
Additionally birksoffsjunk (seasoned WM guru & chef of ChuckyDroid, ChuckyROM, & Dexter) has made a batch program to make this process easier. It's a work in progress & somethings are still buggy so follow the thread ;)

Between the utility birkoffsjunk made & the tutorial I wrote you should be able to successfully edit & run your own build. Hope this helps.
 

misa.fisa

Member
Apr 9, 2009
13
0
I have only green HTC :(

Hello
I would like to use Android on my HD2. I was searching and testing many ROMS but I didn´t find any rom which is usable for me. I would like to have a ROM that is without Sense, has Multilanguage support and is on Android 2.2 version.

So I decided that I would make my own.
0) I was reading
HTML:
http://xdaforums.com/showpost.php?p=10291851&postcount=1
and made this procedure.

1)downloaded some ROM from here

2)unpacked this rom in linux with :
Code:
unyaffs system.img
then I got this directories:
Code:
app  bin  build.prop  etc  fonts  framework  lib  media  usr  xbin

3)I downloaded update-cm-6.1.1-N1-signed.zip from CyanogenMod Forum > Downloads > Stable Mod > Nexus One and unpacked. I got : META-INF system boot.img.

4)I copied everything what was described step 0 from directories from step 2 to directory system from step 3

5)I downloaded and copied build.prop from step 0 to system

6) I updated permition like it is described in step 0

7) I created system.img with command : mkyaffs2image . ../system.img :D

Then I copied this system.img from linux to my windows and put this file in directory in which was different NAND rom. (replaced system.img). After that I flashed my phone and it did not work. Screen was frozen after booting and only green HTC was on display.:mad:


Can somebody please help me and give me some advice or some small howto. Does anybody know what can be wrong?:confused:


Thank you
Michal Fichtner
 

chuckybrown

Member
Sep 21, 2010
31
0
Hi,

it is possible to combi the dropdown energy widget froom miui and the gingerbread lockscreen into Desire HD Build? :rolleyes:

Thats was awesome !

Sorry for my bad english :)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 91
    heartsurfer008 said:
    Well I am desparetly trying to cook a NAND build for my HD2 but there is pretty much less info available for me [a big NOOB in cooking] to try out my luck at cooking..!!!

    So I'll appreciate if someone would put some light on it..!!!

    PS: - I would appreciate if somebody can provide a detailed info..!!! :D
    Finally the tutorial

    Make your own Android Build for the HD2 by domineus
    I have always lived by these words- if you give a man a fish, he can eat for a day; but if you teach a man to fish you can eat for a lifetime. Android on the HD2 has always been an interesting thing for me and I know a lot of people that want to create their own builds, but have no idea how. If you ask a build creator or maybe someone in the htc-linux-chat how to get started, there may not be an answer. In fact, some of the perplexing behavior has left me puzzled in several ways - as if how to get an android build is a vaulted secret of knowledge like the holy grail. To be honest, it's not. It's a bit of hard work, a few nods in the right direction, and ultimately it's a community involved project. Just like miui development is a community project spanning actual continents to get this thing on our device every single week! It has led to a lot of questions, in my inbox, of how to begin. For a long time, the answer to the question was not answered until Cass helped me out. I want to do the same and contribute how to get a build of miui (or any android build) to the HTC HD2.

    Things you will need
    In order to properly start android development, it would be a good idea to make sure you have the following (a lot of it is no duh when you think about it)
    A computer running linux
    I can't stress that enough. While there is a lot of things you can do in windows, you will need some sort of linux distro in order to get android properly running on your HD2. There are a lot of linux distros you can use; with many using ubuntu as it is the most user friendly. I use Fedora and I am quite happy with the results. It's simple and effective. It gets the job done. Get a distro that you feel can get the job done.
    Android SDK - either windows or linux
    Android SDK is something that can be freely accessed and downloaded from the following location:
    http://developer.android.com/sdk/index.html
    It is a developer environment, but probably the most important thing you can use here (for the time being) is logcat. Logcat provides you to visually see the libraries and files working together to get android to work as well as if you run into an issue, it is the first thing you should resort to. For instance, boot reloop? Take a look at your logcat and try again.
    A kernel
    There are quite a few kernels available for android previously and they are divided into evo kernel or nexus one kernel. Many builders have transitioned to an evo kernel for PPP and a few other nice details but it is totally up to you. I highly recommend hastarin's kernel. For most of the time, it works well. But as you have noted, on MIUI, it hasn't been working as fantastic on other builds.
    Donor Files
    This is a bit difficult to find because it appears that the files that work best are nexus one builds without CM6.1 modification. So far, only one chef has that and it is tytung's nexus one build. Regardless of whose files you're using (e.g. tytung or darkstone's system which is the preferred choice) you will need a well working android build. You will be pulling several files in order to port.
    MIUI itself (well any build honestly just miui is a good example)
    This is a given. However, if you download from miui.com you will probably have an untranslated rom with odex files. That's bad. And in Chinese! It would be a good idea to browse the English forum for a deodexed rom with appropriate english translation (apps and frameworks)
    -If pulling files from windows, you will need this
    system extractor
    http://uranus.chrysocome.net/linux/explore2fs-old.htm
    I use that if I download in windows. It's relatively straight forward and it allows you to pull the files you need from the system.ext2 you're using and copying them to folders necessary.
    build.prop
    This you will need. You can find one here:
    http://www.multiupload.com/B59IU3S6XY
    Patience
    Probably the most important thing. One thing I have noticed is you need patience to make it through. Sometimes, your build works, sometimes it doesn't. And it is difficult to still keep going. But gotta pull it all in and keep trying...it does pay off.

    Okay so you have your files, a nice linux distribution, your build you want to port (MIUI preferrably) and you're ready to go. Now it's time to begin the process!

    Step One - The Setup

    I usually grab my files in windows before transitioning to my linux distro to finish the process. If you using windows 7 and you are using explore2fs, you will definitely have to right click on the exe and make it compatible by selecting compatible with windows vista. The file should also need to be run by administrator. If you don't know how to do that you can google compatibility in windows 7.

    First thing is first. Create a new folder, you can call it donor_files if you want because name is arbitrary. The most important thing is to just name it. Within that folder, create a new folder called system. Enter the system directory and create a new folder called etc. Within etc, select Once that is done, create a new folder within etc called firmware. Once completed, return back to the system folder, create the folder called lib. In the lib folder, create a new folder called hw. So your folder should look like this:

    Folder Name
    -system
    --etc
    ---firmware
    --lib
    ---hw

    So far so good? Excellent. Now, if you're in windows you will need to do a few things. Extract the system.ext2 of your donor build and place it somewhere you will remember (like your desktop). Now open up explore2fs, select file, and open image file. Under files of type (drop down), select all files and navigate to your system.ext2 file. You should now see the ext loaded on the left side of the program's workspace. Located is a very small + that allows you to view all directories in your ext2 file. Click that.

    You will see several system folders on the left and files on the root. Since you haven't selected a specific folder, in the right hand view, you should see the file build.prop. If you did select a folder (like app) you will see some files. And that's okay too. Get a feel of the program.

    Now you will do a test file pull. On the left hand side, select the folder etc. On the right window, you will see several files. We want AudioBTID.csv. Once you see the file, right click on AudioBTID.csv and select export file. Navigate to the donor file folder (or whatever you named it) and place the file in system/etc of that folder. Congratulations you just pulled your first file! But you will need a lot more files. Within the same directory, pull gps.conf, hosts, media_profiles.xml and the ppp folder. Now, navigate to firmware and pull the following files:

    BCM4329B1_002.002.023.0360.0362.hcd default_france.acdb htcleo.acdb
    BCM4329B1_002.002.023.0436.0439.hcd default_nel.acdb yamato_pfp.fw
    bcm4329.hcd fw_bcm4329_apsta.bin yamato_pm4.fw
    default.acdb fw_bcm4329.bin

    Ideally you should not be able to find htcleo.acdb. You can find it here

    http://gitorious.org/xdandroid_leo/q...eo/htcleo.acdb

    Now in explore2fs, go to the lib directory and pull these files and place them in your lib directory:

    libcamera.so
    libcamera_client.so
    libcameraservice.so
    libhtc_ril_wrapper.so
    libmm-omxcore.so
    liboemcamera.so
    libomx_aacdec_sharedlibrary.so
    libomx_amrdec_sharedlibrary.so
    libomx_amrenc_sharedlibrary.so
    libomx_avcdec_sharedlibrary.so
    libomx_m4vdec_sharedlibrary.so
    libomx_mp3dec_sharedlibrary.so
    libomx_sharedlibrary.so
    libomx_wmadec_sharedlibrary.so
    libomx_wmvdec_sharedlibrary.so
    libOmxCore.so
    libOmxVdec.so
    libOmxVidEnc.so
    libqcomm_omx.so
    libstagefright_omx.so

    Once those files are pulled, navigate to the hw folder of the system and pull the following files:

    sensors.htcleo.so
    lights.htcleo.so

    Once those files are pulled, you can save your donor files to a flash drive and then boot into your linux distro. Login to superuser in terminal. For fedora, the proper method involves typing in su --login and entering your password you set up. Minimize your terminal window.

    Extract the miui (or any other build) to your desktop (the focus is the system folder). Ensure the rom is deodexed and in your own language (if its miui, you will have to apply the proper language translations). Now copy the files you pulled from your donor build and apply it to the appropriate folders (usually a copy and a paste-literally). In this instance there will be duplicate files, overwrite them. That's the point! Do not forget the build.prop file I linked to earlier. You should add that to system folder.

    So the files are copied, the next step is to restore the minimized terminal window (the one that is logged in as root). cd to where your system is located (not to the system folder itself). Now you will have to enter the following commands in terminal

    chmod -R 777 system/etc
    chmod 755 system/bin/*
    chmod 755 system/xbin/*
    rm system/etc/firmware/default*acdb (if you have sound in call issues)
    touch system/etc/ppp/active (If you have latest wrapper and need ppp)
    chown root:2000 system/bin/pppd
    chmod 4755 system/bin/pppd
    chown root:root system/xbin/su
    chmod 4755 system/xbin/su
    chown root:root system/xbin/hci*
    chmod 4755 system/xbin/hci*

    dd if=/dev/zero of=system.ext2 bs=1048576 count=256
    mke2fs -F system.ext2
    sudo mount -o loop system.ext2 /mnt2
    cp -rp system/* /mnt2
    sudo umount /mnt2

    A few words on this that I must bold. the /mnt2 directory may not exist. If not, try mnt, that usually works

    Once this is done, you will have a nice system.ext2. The only thing you'd need now is a rootfs, a kernel, clrcad.exe and a startup.txt file. Once that is done, you can test your build out.

    Any questions

    Special thanks to Cass and the htc-linux-chat for the few pointers they gave me.

    The guide is by "domineus - http://www.miui-dev.com/" & I take no credit what so ever​


    Thanks to "white-energy" for giving us the link..!!!

    Hope to have many more Chief's for our HD2, so that we [especially me] can satisfy our hunger to try different builds/ROM's..!!! ;)

    Happy Cooking..!!!​

    PLEASE PRESS THANKS IF YOU FOUND THIS THREAD USEFUL..!!!
    3
    anyone know how to edit or anything about initrd.gz?

    Place unyaffs, mkyaffs2image and boot.img.old at the same folder on Ubuntu.

    unpack.sh
    Code:
    if [ -f boot.img.old ]; then
      rm -rf boot
      mkdir boot
      cd boot
      ../unyaffs ../boot.img.old
    
      cd ..
      rm -rf initrd
      mkdir initrd
      cd initrd
      gzip -dc ../boot/initrd.gz | cpio -i
    else
      echo cannot find boot.img.old
    fi

    Go to initrd folder and edit something.

    pack.sh
    Code:
    cd initrd
    find . | cpio -o -H newc | gzip -9 > ../boot/initrd.gz
    cd ..
    ./mkyaffs2image boot/ boot.img

    You will get a new file named boot.img.

    Regarding mkyaffs2image, you need to download the source and compile it to get the executable binary.
    Or here is my compiled mkyaffs2image for Ubuntu 10.10 x64.
    http://xdaforums.com/showthread.php?p=10237754&highlight=mkyaffs2image#post10237754

    Edit:
    unyaffs and mkyaffs2image can be used for boot.img and system.img
    2
    http://www.miui-dev.com/forums/showthread.php?481-Howto-Make-your-own-Android-Build-for-the-HD2

    Instead of making a ext image, you should make a yaffs image.. so it can work on Nand :)
    1
    I don't know if this help but you can try
    http://xdaforums.com/showthread.php?t=897940
    These kind of thread pop up once in awhile, but it's going no where, I've never seen well known chef show up in this kind of thread.
    knowledge is power, maybe they dont want to share the power :D
    1
    Is there a way to edit system.bin files, that comes with the NAND builds. I suppose that is where the ROM is. I want to unpack, edit the included apps and repack. How it is done? How the bin file is done. Google does not give any satisfiable links, did a quick search, though...