yashsingh1/xdaforums huggingface dataset:
[HD2 Android NAND Development] mishik:
I'm having exact same problem. Other than that my data connection is fine, but this one is quite irritating.
[HD2 Android NAND Development] kikisp:
about RMNET....i read somewhere that cotulla get it to work because he managed to load part of desire radio onto our hd2..so i think that someone with desire could help us..
[HD2 Android NAND Development] 2000impreza:
I have this issue every once in awhile. As a work around I'm using the script "killall pppd" in gscript lite. It seems to bring back the data connection every time for me.
[HD2 Android NAND Development] stirkac:
sounds much easier than is to actually do. probably cotulla only knows enough about it to actually make it happen. we're talking decompiling, patching actual radio software on the fly etc...
[HD2 Android NAND Development] Derek0228:
Clk v1.3.3 working like a dream here :D
[HD2 Android NAND Development] maxxpop:
Felicitari !

A very good job you are doing here! Congrats!!

Bravo! si multumim :)
[HD2 Android NAND Development] demon_da:
yes, read it here and some posts further
[HD2 Android NAND Development] cedesmith:
rmnet... again

i read the speculations that magldr replaces part of the radio software. if this is the case is probably illegal and in depending on contract with your operator you may be held liable by eventual damages/lose of profit caused by the use of a unauthorized device.

again if the speculations are correct.

as cotulla doesn't seam eager to share info don't expect rmnet on cLK, as i said before is out of my understanding. a magldr with some/all of the things you like on clk is more likely.
[HD2 Android NAND Development] M..N:
Would you try to improve ppp if you can?
[HD2 Android NAND Development] erestor6:
Please, please, please...

Can anyone create a very detailed guide on how to create the "RUU_signed.nbh" file in order to have everyone the chance to choose the size of system, cache ... as desired? Please, I ask you to create a guide that can help also those who can't use ubuntu (you have to include every single mouse click, and every single word we would type on the keyboard).

Thanks a lot, a lot of work would be appreciated.
[HD2 Android NAND Development] g30rg10u:
Hello M_N the ppp currently used is coming from LeTama

LeTama said that with proper logs and description PPP can be improved.

PPP is working really well for a lot of people, but in order to get it improved, people who have problems, should post issue with logcat and ask for help.

The nice thing about cLK, is that it is open source, and you can do whatever you want with it to improve it. But PPP has nothing to do with cLK source code.
[HD2 Android NAND Development] stirkac:
maybe tryin to talk with him and merge projects? loader that uses clk as a base and checks yaffs->boots to android and/or continues loading magldr parts would be a dream(one can have a dream:D). or is that impossible if lk source is based on gpl(or whichever license) that restricts that kind of stuff.
[HD2 Android NAND Development] arif-ali:
Compilation howto: Windows

before I start, don't forget to click THANKS

OK, two ways, first way is to do everything yourself, so follow the steps below, i.e. start from Step 1.

If you want the easy way, then download the following zip file from the llink, then unzip it, and then double click "setup.bat". This automatically do all the steps listed below in bullet points

cLK_win.zip

* install cygwin, and all dependancies

* download cLK from git

* download codesourcery toolchain

* download yang

and now skip to Step 2

Step 1: Prepare environment

Download, the following file, and execute it

http://www.cygwin.com/setup.exe

Click Next

Click "Install from internet" and click Next

Click Next (to accept the default directory to install)

Click Next (to accept the default directory for local Package directory)

Click "Direct Connection", and click Next

Select a "local mirror", and click Next

Now in the search bar, you need to search for the following things to install

gcc

make

git

wget

zip

unzip

Once selected click Next to continue, and Finish

Now you will have an icon for Cygwin on the desktop, double-click this

now in the window that appears, run the following command

git clone git://github.com/cedesmith/cLK.git

then run the following commands to download the codesourcery toolchain

wget http://www.codesourcery.com/sgpp/lite/arm/portal/package5354/public/arm-none-eabi/arm-2009q3-68-arm-none-eabi-i686-mingw32.tar.bz2
tar xvfj arm-2009q3-68-arm-none-eabi-i686-mingw32.tar.bz2
wget http://htc-flasher.googlecode.com/files/yang-1.1_win32.zip
cd cLK/bin
rm -rf yang
mkdir yang
unzip ../../yang-1.1_win32.zip yang/yang.exe
mv yang/yang.exe .
cd ..
sed -i s/yang/yang.exe/g compile

Step 2: Change partition sizes

To change your values for cache, system, boot etc... you need to change the following files

lk/target/htcleo/rules.mk

line 8 - system

lk/target/htcleo/init.c

line 28 - misc

line 32 - recovery

line 36 - boot

line 43 - cache

These will be located in c:\cygwin\home\<username>\cLK on your windows machine

Step 3: Compile cLK

Now you can compile by running the following command

export PATH=$HOME/arm-2009q3/bin:$PATH
cd cLK
./compile clean

Now your RUU_signed.nbh will be located in the following folder

bin/RUU_signed.nbh

Hopefully that should work, I have just tested this on my machine.

Anyone have any issues, let me know, I will amend the howto
[HD2 Android NAND Development] stirkac:
def must for 1.post. may even do an addendum to cLK for dummies with this in longer format.

...and hope partitioning support some time :p cede...;)

hmmm i wonder how long would it take to make exe or batch to do all that and msgbox to input wanted sizes of partitions..

i know c# & java (lame, i know but that's what school teaches us)
[HD2 Android NAND Development] arif-ali:
Compilation howto: Linux

before I start, don't forget to click THANKS

You need to install some packages to get things working, and the commands below will install the dependencies

Ubuntu:

sudo apt-get update
sudo apt-get install gcc make git wget unzip zip libc6-dev-amd64 libc6-dev

Fedora:

yum install gcc make git wget unzip zip

Open a terminal session, and create a directory called clk, change directory to clk, and run the following command to get the cLK git repository

git clone git://github.com/cedesmith/cLK.git

then run the following commands to download the codesourcery toolchain, and set-up environment

wget http://www.codesourcery.com/sgpp/lite/arm/portal/package5353/public/arm-none-eabi/arm-2009q3-68-arm-none-eabi-i686-pc-linux-gnu.tar.bz2
tar xvfj arm-2009q3-68-arm-none-eabi-i686-pc-linux-gnu.tar.bz2
export PATH=$HOME/clk/arm-2009q3/bin:$PATH

To change your values for cache, system, boot etc... you need to change the following files in the the $HOME/clk/cLK directory

lk/target/htcleo/rules.mk

line 8 - system

lk/target/htcleo/init.c

line 28 - misc

line 32 - recovery

line 36 - boot

line 43 - cache

Now you can compile by running the following command

cd cLK
./compile clean

Now your RUU_signed.nbh will be located in the following folder

bin/RUU_signed.nbh

Hopefully that should work.

Anyone have any issues, let me know, I will amend the howto
[HD2 Android NAND Development] sambafr:
Sorry for being noob but where do i find these ?

lk/target/htcleo/rules.mk

lk/target/htcleo/init.c

I guess the win version is easier but i would like to try on linux? thanx

EDIT : Well , i guess i found it and i'm feeling stupid : in clk...

BTW . SInce i ve updated Pongster's v11which is great i have very unstable ppp, should i retry the ppp fixs or are they outdated by tytungs .3?

thanx
[HD2 Android NAND Development] MontAlbert:
thanks for that- awesome. i love open source and sharing of knowledge.
[HD2 Android NAND Development] erestor6:
Thanks thanks thaaaaaaaaaaaaaaaaaaaaankss...
[HD2 Android NAND Development] francescozanghetta:
quick question

Hi arif-ali,

Thanks for your great tutorial. I have just a quick question.

Inside the file rules.mk which value i must change:

This DEFINES += SYSTEM_PARTITION_SIZE=150

or this #DEFINES += SYSTEM_PARTITION_SIZE=250 ????:confused:

Thanks in advance
[HD2 Android NAND Development] arif-ali:
It's the first value. I will update the tutorial with the specifics later
[HD2 Android NAND Development] Dasf77:
Thanks for your hard work.

Now, we just need a Mac version :D
[HD2 Android NAND Development] hhhawasly:
thanks a lot for your effort.

Where is the nbgen ? I can't find it anywhere>
[HD2 Android NAND Development] arif-ali:
nbgen is automatically compiled by the compile script from nbgen.c, so you shouldn't have to worry about that
[HD2 Android NAND Development] MaXAiRO:
Wrong topic, Sorry!
[HD2 Android NAND Development] seadersn:
here are some layouts for everyone; normal cache size and small cache size version, based on v1.4, available @ github:

Normal Cache-size Version (usable for most cases):

boot 5M

cache 44MB

recovery 5MB

misc 1MB

system 80-160MB in 10MB steps, 180-400 in 20MB steps

userdata = rest of available NAND

Small Cache-size Version (requires initrd.gz which links /cache to userdata partition):

boot 5M

cache 5MB

recovery 5MB

misc 1MB

system 80-160MB in 10MB steps, 180-400 in 20MB steps

userdata = rest of available NAND

for most people 44MB cache partition size should be the one to take; use this if you're unsure about your cache-config in initrd.

grab it here. take the one you want to flash and copy it in a new folder together with CustomRUU.exe, then flash it in bootloader.
[HD2 Android NAND Development] pongster:
its a lot smaller than 1.3.3 :) What are the major changes that made it 130kb from 258kb? what does nbgen do exacty btw? :)
[HD2 Android NAND Development] D.O.C:
what if I change also system to 120 at lk/target/htcleo/init.c?
[HD2 Android NAND Development] arif-ali:
That shouldn't be a problem as long as your ROM is small enough
[HD2 Android NAND Development] seadersn:
don't know, why it's roundabout half the size; i believe, optimizations :) i'm using the 120-5 layout and all is working as it did before, so nothing is broken or sth like that.
[HD2 Android NAND Development] cedesmith:
generate .nb or .payload files :D, it replaces osnbtool and nbmerge exe files.

output is smaller because osnbtool inserted a unneeded empty block. 51Kb fit in 1 128Kb nand block.

another thing i am trying to achieve with nbgen is include recovery image in cLK.
[HD2 Android NAND Development] M..N:
That would be eaiser for some if they want to flash clk but are not good with fastboot :D
[HD2 Android NAND Development] vodkinagdan:
question about last 24mb. We can't use them because of restrictions of bootloader? Or because of partition table? If there is no restrictions in bootloader, can i somehow change partition sizes like here

misc 1mb

boot 5mb

system 130mb

userdata 270 mb

cache allsize

Last 24 mb are used for cache and everything is OK. This works for magldr.
[HD2 Android NAND Development] g30rg10u:
Q: Can i use last 24MB of nand with this?

A: NO, SPL will erase them. When i have some time i may try to fix it.

its not bootloader's restrictions but SPL's at the moment... you cant use it while in cLK. You can use it while in MAGLDR but still, SPL will erase it as well.
[HD2 Android NAND Development] vodkinagdan:
If SPL will erase my cache partition, I will not be offended))) The idea is to 'put' these 24 mb to cache partition.

So, I can use it, right? Then, how do I change the partition table? I know, there is a way to change size of partitions via HEX editor, but with my idea I need to change their order.
[HD2 Android NAND Development] arif-ali:
think about it, if the last 24M SPL was working then the userdata would have taken it up, according to your assumptions.

This needs to be coded into cLK for it to work.

Wait for cedesmith to add, or if you know how to, then code it in. :p
[HD2 Android NAND Development] KjKeyz:
Thanks

Does anyone know how to go about changing the partition sizes??
[HD2 Android NAND Development] vodkinagdan:
Understood already. I thought the size of the user partition is defined by it's size.

One more question. Is there a way to change clk boot animation?
[HD2 Android NAND Development] g30rg10u:
arif, how can i build the initrd file ?
[HD2 Android NAND Development] arif-ali:
clk doesn't not have a boot animation, it is the default from your phone.

There is a way to flash that separately, I can't remember the exact thread, but you can do it. I did it once before, but now is back to stock. Search the forums, trust me you'll find it
[HD2 Android NAND Development] arif-ali:
Can you explain, what you are trying do do exactly, PM me if you want me to give you the details.

The initrd has many files that are built and gzipped by ROM chefs. Some may be rom specific some are more general
[HD2 Android NAND Development] arif-ali:
There are at least 2 ways to change partition layouts

1. edit the NBH file with a hex editor, this was detailed by cedesmith earlier

@cedesmith, any chance if you putting those images back up

2. compile your own, from the howtos that have been provided in earlier posts
[HD2 Android NAND Development] vodkinagdan:
Searched the forum and did not found solution. As I know, in android we have 3 bootscreens. 1-st one is SPL bootscreen. 2-nd is from initrd.gz. And 3-rd is from bootanimation.zip. But after I flashed clk, I got 4-th bootscreen - white htc logo. It appears between 1-st and 2-nd bootscreens, and I don't know where it came from.
[HD2 Android NAND Development] seadersn:
http://xdaforums.com/attachment.php?attachmentid=520793&d=1298020497

here's one.
[HD2 Android NAND Development] vodkinagdan:
Thanks, but already found solution. Looks like magldr and clk replace different splashscreens. Used nbimg.exe from here http://xdaforums.com/showthread.php?t=895089 to compile 1-st and 2-nd bootscreens and no htc logo from now))
[HD2 Android NAND Development] pantect:
Thank you, i followed your guide and it work fine for me.
[HD2 Android NAND Development] pathologo:
1) For ROMs which don't use a special cache partition, wouldn't be a cache partition size of 1 or 2 MB sufficient??

2) I read somewhere that CWM needs 2 MB. Is that true? How much is *really* needed for CWM?

3) Then why are there still bootloader flash configs with a 5 MB cache partition???

4) Is there a CWM version which doesn't use a special cache partition or doesn't use a cache at all?
[HD2 Android NAND Development] Unconn:
Just FYI to who ever is following the cLK PPP problems: It seems to be a problem with the 2.3 builds and not with cLK nor the kernels. I can flash a 2.2 CM6 ROM (HD2One or CMN) that was made for NAND/CWM and then flash a cLK compatible kernel and I cannot get the data connection to stay dropped. It connects again just fine.

The PPP ril-wrapper thread:

http://xdaforums.com/showthread.php?p=12510038#post12510038
[HD2 Android NAND Development] stirkac:
umm i get:

panic(caller 0x280054d7): ASSERT FAILED at (target/htcleo/init.c;139): len >= 0

and

HALT:spinning forever...

everytime with your partitions.. i tried couple of times, task 29 etc..

EDIT: found the cause! HSPL4 3.03 no longer works with cLK :(
[HD2 Android NAND Development] drewestate:
Same observations for me. I commented on this same thing yesterday. Glad someone else is also realizing this.
[HD2 Android NAND Development] UbuntuBhoy:
Thanx for the how-to, works a treat.

Only but missing was the location of the .nbh file.

/cLK/bin for anyone interested.
[HD2 Android NAND Development] arif-ali:
1) yes, that is right. But for downloads in market, that actually uses the /cache folder, as long the ROM supports then it's not a problem. Or you can change the ROM for your liking in that case

2) CWM needs it for recovery, and afaik, even 1M should be sufficient for that, because it only writes a file to tell what CWM needs to do. but don't quote me on that. Then you need somehow /cache to be a place where the size is enough for app downloads from the market such as linking /cache to /data/cachemnt.

3) for reasons that cache is used my market to download partitions. This at least for not so big users will be sufficient for most applications.

4) afaik, CWM uses /cache/recovery, and that is what it looks for. Nobody is going to spend time changing the code so that CWM responds differently, as you will need to change codes for other applications that rely on this; one such application is ROM Manager.

I hope that answers your question

other opinions???
[HD2 Android NAND Development] FrAsErTaG:
is there a ppp compatable .zip of r8.3?
[HD2 Android NAND Development] tytung:
Download cLK_tytung_r8.3_callrec_PPP_update.zip.

tytung_r8.3_callrec means r8.3 + two-way call recording patch

I don't install cLK bootloader to test it yet.

Besides, this cLK flashable zip includes NexusHD2-Gingerbread's initrd.gz in boot.img, so it may be not compatible with other ROM.
[HD2 Android NAND Development] Satyan:
I have a problem with installation on my phone.

First of all, i was never able to install ROM using MAGLDR on phone, on DFT flash it use to stop at BAD sector. (even CWM flash would have stop at boot)

With clk now, at least some ROMS do work (Hyperdroid, Nexus, MIUI)

However if i managed to get a ROM booting, it would stop after some market installs or may be even a sync with google. on the next reboot , it will go to a boot loop and never boot up.

This has happenned on [retty mush every ROM .

I think may be it is caus of bad sectors which always end up in userdata partition.

<4>[ 3.109161] ###BAD BLOCK 4349 21FA0000###

<4>[ 3.165557] ###BAD BLOCK 4772 25480000###

<4>[ 3.517791] ###BAD BLOCK 7428 3A080000###

<4>[ 3.572875] ###BAD BLOCK 7843 3D460000###

Can some body confirm, should yaffs driver not be able to manage bad sectors if there are.

Can these bad sectors be re-initialized ? (on some fs they can tested and re-initialised)

Lastly if i have to live with bad sectors, i can somebody help with re-mapping data partition to a ext4 may be (i guess something need to be done with initrd )

Can somebody help ? really appreciate

Thanks !!!
[HD2 Android NAND Development] karendar:
Good to know the ppp disconnect issue is being worked on! It's so annoying and the only reason I'd go back to magldr!
[HD2 Android NAND Development] karendar:
Hi,

After reading up on bad blocks, some people have had success with riffboxes (Used to access lower level functions of phone) but your safest bet would be to flash the phone with a stock WinMo ROM and start fresh... You'd be surprised how many things this fixes. mtty16 is the riffbox app used to fix the HTC HD2, here's a thread about HD2 fixing in case you're technically inclined: http://forum.gsmhosting.com/vbb/f634/riffbox-please-fix-htc-leo-hd2-512-a-1069875/

As for Data2SD, you can try and install app2sd+ by darktremor, it has the possibility of moving the entire data partition to the sd-ext... Otherwise, can't help you much with that. ;) sorry.
[HD2 Android NAND Development] velayo:
I got a question> Do I need to connect the phone to the computer everytime I want to flash or can I start cwm from withing the loader by pressing a button?

Sorry if its been asked before.
[HD2 Android NAND Development] karendar:
If you have cLK and you use clockwork recovery, you have to hold the home button when booting the phone to access Clockworkmod and the back key to access fastboot.
[HD2 Android NAND Development] FrAsErTaG:
Thanks
[HD2 Android NAND Development] Satyan:
I have tried flashing the Stock rom from the SDcard, then going with magldr / Clk, that did not help.

Interesting when flashing with recovery zip it does not flash all the files to the system.

But have found some success with flashing from fastboot.

Hardware riffboxes seems too much of a work.

The mtty16 you referring to is it the same from HD2 mtty thread ?

Which does a task 29 basically or if it is different please let me know.

apps2sd .. seems gud idea. but not sure cause cwm flash does not flash the system also correctly.

so is it bad sectors or seomthing else goin on... not really sure...
[HD2 Android NAND Development] Blubster:
Weird i had the very same issue (bad blocks error in logcat, and uncomplete /system) when i was copying the .zip rom with CWM or Magldr... Make sure you are using a card reader to copy it, or do that (when you have a working rom) inside android as CWM and Magldr are corrupting files when used to transfer files in UMT mode! ;)
[HD2 Android NAND Development] piipo4:
i really like CLK fast start, and power off battery charging are good stuff but ppp disconection botherig me too much ...i've tried all possible roms no one works ...so i go back to magldr :(
[HD2 Android NAND Development] Satyan:
I have tried without the sdcard as well.. still the device resets...

tried changing over to MDj kernel... still resets.
[HD2 Android NAND Development] letama:
You're changing kernel and bcm4329.ko module in /system/lib/modules ?

It would be interesting to have ram console dump, however I don't know how it could be done with this bootloader.
[HD2 Android NAND Development] Satyan:
Yes changing all the mods in /system/lib/modules... making a new boot img...

i tried getting with adb logcat.. but looks like the device goes to hang and does not really dump anything...

edit:

tried prj kernel.. too same result... the device resets....
[HD2 Android NAND Development] letama:
Ok...

Logcat won't give any clue, we need dmesg but you'd be able to get it only through ram_console.

I know that some bootloaders are implementing fastboot command to dump memory, but it's missing here as far as I can see in code, so I don't know how we could dump ram_console buffer.
[HD2 Android NAND Development] Satyan:
i c... tried a different build... MIUI... the data works in this.. not the wifi..

Also no black screen on text console mode and Recovery mode.

hopefully cedesmith can figure out...

Let me know if i provide any data ...

-----------

TMOUS HD2
[HD2 Android NAND Development] cedesmith:
i figured why no reboot, no atag to tell kernel is running from nand.

also rmnet seams to work now and then.

as for ppl with problems with text what panel type you have ?
[HD2 Android NAND Development] dan1j3l:
i fixed atag by modifying kernel (just set nand_boot = 1) in magldr atag check, also with this set wireless works (patch was introduced before for nand boot).

Also regarding coold boot, i will try to add delay before lk jups to kernel (get some time for amss to initialize like magldr does), and boot kernel without restarting...

Anyway we should put source to public repo (Gitorious, or something)...
[HD2 Android NAND Development] cedesmith:
atags.c

//cedesmith: from kernel board-htcleo.
#define MSM_EBI1_BANK0_BASE 0x11800000
//#define MSM_EBI1_BANK0_SIZE 0x1E800000 /* 488MB */
//CONFIG_USING_BRAVOS_DSP
//#define MSM_EBI1_BANK0_SIZE 0x1CFC0000 /* 488MB - DESIRE DSP - 0x00040000 RAM CONSOLE*/
#define MSM_EBI1_BANK0_SIZE 0x1E7C0000 /* 488MB - 0x00040000 RAM CONSOLE*/

unsigned* target_atag_mem(unsigned* ptr)
{
//tell is a nand boot
*ptr++ = 4;
*ptr++ = 0x4C47414D;
*ptr++ = 0;
*ptr++ = 0;

// set memory tag
*ptr++ = 4;
*ptr++ = 0x54410002;
*ptr++ = MSM_EBI1_BANK0_SIZE;
*ptr++ = MSM_EBI1_BANK0_BASE;

return ptr;
}

and add in init.c after dprintf(INFO, "htcleo_init\n"); to show dmesg

if (keys_get_state(KEY_BACK) != 0)
{
dprintf(ALWAYS, "dmesg dump\n");
char* c= (char*) 0x2FFC0000;
for(char* cc=c; cc< (char*)(0x2FFC0000+0x00040000); cc++)
{
if(*cc=='\n')
{
*cc=0;
dprintf(ALWAYS, c);
dprintf(ALWAYS, "\n");
c=cc+1;
}
}
dprintf(ALWAYS, c);
dprintf(ALWAYS, "\n");

}
[HD2 Android NAND Development] MontAlbert:
sorry cedesmith, what do you mean by panel? I am new to HD2 but been around android for a couple years. I bought my HD2 to test new stuff and live on the edge so am happy to test anything you want.

I cannot see the text in any of the screens.
[HD2 Android NAND Development] Satyan:
Cedesmith, i think i have TMOUS HD2 .. not sure if more specific panel type u asking ?

Also: ..can you put a new compiled nbh.. with new atags.c...

thanks for everything !
[HD2 Android NAND Development] hamdir:
so is the version in the first post updated with this fix?