[HD2 Android NAND Development] Rick_1995:
1.5.x (Experimental)

19/Jan/2012 - FIRST alternative suggestion

Link

25/Jan/2012 - UPDATE #1

Link

26/Jan/2012 - UPDATE #2

New format option leaves recovery partition untouched. So yeah, no pc needed after formatting !:)

Basically it erases all the other existing partitions one by one. At the end recovery partition is intact so we can enter recovery interface and flash our preferred rom.

Set userdata as 'auto-size' partition . So default partition table is:

Revised the 'Enable/Disable ExtROM' option.

If enabled it will automatically be used for 'cache' partition .

If disabled 'cache' will automatically return to 5MB size .

28/Jan/2012 - UPDATE #3

Cleaned some code that was not used .

Added option to convert 'auto-size' partition to 'fixed-size' .

Added option to set a partition as 'auto-size' if one doesn't already exist (just decrease its size to zero).

Small fixes to some features I previously added.

29/Jan/2012 - UPDATE #4

Revised the 'rearrange partitions' menu.

We cannot move recovery , cause then we'll have to re-flash it via pc .

How it works:

Lets say we have this layout:

And we want to change it to:

Enter 'REARRANGE PARTITIONS'

Select 'userdata' -> Scroll DOWN to 6 -> Select it

(You should see the change in the order of the partitions immediately! Don't worry nothing is committed. If you exit and re-enter SETTINGS menu everything will be reset.)

Select 'COMMIT CHANGES' -> Select 'APPLY'

(Of course you still have the option to re-order and re-size the partitions via pc, if the default layout doesn't fit your needs)

WARNING ! If you change the order of the partitions then have in mind that the same /dev/block/mtdblock<

n

>, n=0,1,2,... point to different mount points.

Clean up some code

01/Feb/2012 - UPDATE #5

Added new info when booting

After the partition table you should see a list with the existing bad blocks IF ANY. (CONFIRMED)

IF there are any bad blocks inside recovery,misc,boot,sboot,cache THEN they will be auto-re-sized by adding 1MB to each one.

Changed some output messages

02/Feb/2012 - UPDATE #6

Changed the function regarding auto-resizing:

IF there are any bad blocks inside recovery,misc,boot,sboot,cache THEN 1MB per 1bad block will be added to each partition with bad block(s). (CONFIRMED)

Changed some output messages

Default partition table is:

06/Feb/2012 - UPDATE #7

Minor fixes/changes

Changed some output messages

08/Feb/2012 - UPDATE #8

If you press&hold the middle [MENU] button during (re)booting you can immediately boot android from sdcard(emmc), assuming that you have flashed sboot partition with the appropriate image and you have the required folder in the root of your sdcard.

Process of having dual boot(without using pc):

Prerequisite: The folder(usually named 'Android' or 'ics') with the SD version of Android exists in the root of your sdcard

Boot the device in cLK pressing [BACK] button, having the sdcard inserted

Go to MAIN MENU/SETTINGS - Select ADD sBOOT

Select BOOT RECOVERY from MAIN MENU

Select 'install zip from sdcard' and use something like this(this is an example) flash_sboot.zip

Select 'reboot system now' and press&hold [MENU] button to directly boot Android (emmc)

After each change(resize/rearrange parts, add/remove sboot, enable/disable ExtROM) is committed there is no longer the need to reboot. clk will just auto return to main menu, and from there you can select your next action.

14/Feb/2012 - UPDATE #9

Changed cpu speed to 998MHz.

Added option to show/hide info(ptable and bbtable) at start-up under MAIN MENU/INFO.

If you invert screen colors, the change will remain after rebooting.

The speed of reading/writing or erasing is improved a bit.

Cleaned up some code.

22/Feb/2012 - UPDATE #10

Removed showing bad block info during startup. Bad blocks can be checked from SETTINGS/PRINT BAD BLOCK TABLE(if any bad blocks exist).

Added chipset info in header.

Cleaned up more unused code.

13/Apr/2012 - UPDATE #11

Ported Rick's latest commit.

Added ability to triple boot. It works like secondary boot 'sboot'; you can add a tertiary boot partition named 'tboot' and the rest work the same.

Added "USB" mark for usb detection; if your device is connected to the pc via usb you should see 'USB' at the bottom of the screen.

Cleaned up more unused code. (EXPERIMENTAL)

06/Jun/2012 - UPDATE #12

[U]Default partition table:[/U] recovery=5,misc=1,boot=5,system=150,userdata=0,cache=5
[U]Included recovery:[/U] CWM Recovery Touch Beta 8 Release Candidate 1

[U]ExtRom:[/U] Disabled

Added CID, IMEI , BT Mac Addr and WiFi Mac Addr under Device Info (Getting WiFi Mac doesn't work correctly:( ).

Revised the 'Enable/Disable ExtROM' option.

If enabled, a partition named "null" (which will be only 1 block in size) will be created after 'userdata' and the rest 191 blocks will automatically be used for 'cache' partition .

If disabled, 'cache' will automatically return to 5MB size .

Added ability to resize partitions by giving size in blocks too .

NOT TESTED

fastboot oem part-resize name:size:b
where size is in blocks
i.e. fastboot oem part-resize misc:9:b => will resize 'misc' part to 9 blocks

Added ability to add partitions by giving size in blocks too .

NOT TESTED

fastboot oem part-add name:size:b
where size is in blocks
i.e. fastboot oem part-add misc:8:b => will add 'misc' part with size 8 blocks (= 1MB)

Added option to enable/disable usb detection ("USB" mark at the bottom of the screen if device connected to pc) .

Changed version to LK_1.5black to avoid confusion regarding latest version of main cLK.

21/Jun/2012 - UPDATE #13

[U]Default partition table:[/U] recovery=5,misc=1,boot=5,system=150,userdata=0,cache=5
[U]Included recovery:[/U] CWM Recovery Touch Beta 8 Release Candidate 1

[U]ExtRom:[/U] Disabled

cLK can now be updated through fastboot* using a 'proper' image file**

*:In order to update use :

fastboot flash lk lk.img

**:In order to create the lk.img, use nbgen :

nbgen -b:lk.bin -o:lk.img

-Note that the partition table will not be overwitten.

-Also you can update clk from recovery or from android.

Bug fixes

20/Jul/2012 - UPDATE #14

[U]Default partition table:[/U] recovery=5,misc=1,boot=5,system=150,userdata=0,cache=5
[U]Included recovery:[/U] CWM Recovery Touch Beta 8 Release Candidate 1

[U]ExtRom:[/U] Disabled

Added option to reset ANY settings you have modified.

(RESET SETTINGS under SETTINGS MENU = 'fastboot oem reset' ,previously cmd was 'fastboot oem format_vptable')

Fixed errors caused by some partition changes, so it should be stable now!

26/Jul/2012 - UPDATE #15

[U]Default partition table:[/U] recovery=5,misc=1,boot=5,system=150,userdata=0,cache=5
[U]Included recovery:[/U] CWM Recovery Touch Beta 8 Release Candidate 1

[U]ExtRom:[/U] Disabled

Ported some commits from LK mainline.

(https://github.com/travisg/lk/commit/a95146ec5aef73b49e37045f96a26c10431d37d4,

https://github.com/travisg/lk/commit/6f28039866ddeb272e8660dd89a34208fc988896,

https://github.com/travisg/lk/commit/fc20e231dbabecb612343aa6784705086844052f,

https://github.com/travisg/lk/commit/ac8b88eefe9067fb0881e15435dce1bbc797d71b,

https://github.com/travisg/lk/commit/836375f779308d868515d43fbd7979f07874b6de,

https://github.com/travisg/lk/commit/c2a298970d74dca7c7d738b5e7e3ec04bee00984,

https://github.com/travisg/lk/commit/c32135b7e5972ec77f0883f55dd8b866b3c07c0d,

https://github.com/travisg/lk/commit/18559782b3335682310fdfd77b4ccb1563982d2a,

https://github.com/travisg/lk/commit/06d781f162ff3b35f806de59d7f0bf5bf87fdabd,

https://github.com/travisg/lk/commit/4bea031527e6d0153e61b7ffd4696df8a30f006c)

2nd attempt at fixing errors caused by some partition changes.

Edited nbgen so that it is possible to add recovery as a second partition.

11/Sep/2012 - UPDATE #16

[U]Default partition table:[/U] recovery=5,misc=1,boot=5,system=150,userdata=0,cache=5
[U]Included recovery:[/U] CWM Recovery Touch Beta 8 Release Candidate 1

[U]ExtRom:[/U] Disabled

Added option to set the default boot partition. At start default is 'boot', but you can change it.

Added option to show or not a MULTIBOOT MENU at startup. Default behavior is to be hidden.

The MULTIBOOT MENU will show any existing boot partitions

and will boot from the default selection in 10s if you don't select something else.

supported_boot_partitions[] =
{
{"boot",},
{"sboot"},
{"tboot"},
{"vboot"}, //no uboot :D
{"wboot"},
{"xboot"},
{"yboot"},
{"zboot"},
{""},
};

As you see we have the primary boot + 7 extra boot partitions.

However there is NO change to the MAX_NUM_PART (max number of the partitions) which is 12, so

you can eventually add 5 (of the 7 extra)

different boot partitions,

(

unless

you don't have a NAND installation and you have deleted 'system' and 'userdata' so you can use all 7 extra, but I think it will be a mess :p).

Added ability to control menu navigation through fastboot:

'fastboot oem key 8' ==> KEY_VOLUMEUP
'fastboot oem key 2' ==> KEY_VOLUMEDOWN
'fastboot oem key 5' ==> KEY_SEND
'fastboot oem key 0' ==> KEY_BACK

Removed option to enable/disable usb detection ("USB" mark at the bottom of the screen if device connected to pc) . By default it will be disabled .

18/Sep/2012 - UPDATE #17

[U]Default partition table:[/U] recovery=5,misc=1,boot=5,system=150,userdata=0,cache=5
[U]Included recovery:[/U] CWM Recovery Touch Beta 8 Release Candidate 1

[U]ExtRom:[/U] Disabled

acpuclock that Rick wrote and I managed to break:o, works again. So you have a new option under SETTINGS: SET MAX/DEFAULT CPU FREQ.

Changed the menus. Rearranged SETTINGS and INFO and their entries.

Fixed the charging while off problem that the last version had. Plus you don't need to unplug the cable in order to turn your phone on. Just press once the [CALL] button.

Fixed errors regarding partition rearrangement.

Also from that menu you can remove 'system' and 'userdata' from the partition table, by setting their order to 0. This will give you the chance to add 2 more extra boot partitions. If you went crazy and did that, but something doesn't work well, and you want back 'system' and 'userdata' you just have to RESET SETTINGS and the partition will return to default.

Fixed some errors regarding add/remove %x%boot.

Changed how the countdown in multiboot menu works. If you interact then the countdown is canceled.

Added option whether to fill the bad block table at startup or not, FILL/SKIP FILLING BBT @ STARTUP under SETTINGS.

Remember the option PRINT BAD BLOCK TABLE? If you don't select to FILL BBT @ STARTUP, then you won't see a BAD BLOCK TABLE because it will not be created. In simple words this means a little faster boot into cLK menu.

At a (re)boot event the way LK is determining what to do is:

First checks if any key was pressed, then checks the boot reason.

For example, if you selected 'Reboot to bootloader' from android but in the process you want to boot to recovery, you can just press&hold the [HOME] button until the phone vibrates.

Removed the function regarding auto-resizing small partitions which have bad blocks.

Added a fading animation before booting any kernel or recovery.

18/Sep/2012 - UPDATE #18

[U]Default partition table:[/U] recovery=5,misc=1,boot=5,system=150,userdata=0,cache=5
[U]Included recovery:[/U] CWM Recovery Touch Beta 8 Release Candidate 1

[U]ExtRom:[/U] Disabled

Fixed messed up menus if more than one extra boot partition exists.

20/Sep/2012 - UPDATE #19

[U]Default partition table:[/U] recovery=5,misc=1,boot=5,system=150,userdata=0,cache=5
[U]Included recovery:[/U] CWM Recovery Touch Beta 8 Release Candidate 1

[U]ExtRom:[/U] Disabled

Fixed messed up menus if the order of the extra boot partitions is changed from default.

24/Oct/2012 - UPDATE #20

[U]Default partition table:[/U] recovery=6,boot=5,misc=1,system=150,userdata=0,cache=5
[U]Included recovery:[/U] CWM Recovery Touch Beta 8 Release Candidate 1

[U]ExtRom:[/U] Disabled

Increased default size of 'recovery' partition to 6MB and changed layout.

Removed fading effect.

Added back option to enable/disable usb detection ("USB" mark at the bottom of the screen if device connected to pc).

Some platform code changes.

29/Oct/2012 - UPDATE #21

[U]Default partition table:[/U] recovery=6,boot=5,misc=1,system=150,userdata=0,cache=5
[U]Included recovery:[/U] CWM Recovery Touch Beta 8 Release Candidate 1

[U]ExtRom:[/U] Disabled

Leds work. If you boot into cLK menu and your device is connected to a pc the led will go green. If not connected the led will stay turned off.

Screen brightness can be adjusted. Added option under SETTINGS. The selected level will be the default at each boot.

Entering cLK menu is slightly slower than before.

Added an option to change UDC settings at will. This is an attempt to solve any usb issues you might have (fastboot errors) without having to re-compile cLK's binary with different udc settings. 1st set is the default one. 2nd is the set that cLK used to have initially (1.5_rc1). 3rd is not working for me either, but left it for testing. So lets see how this goes...

When in cLK menu you can select items with the [MENU] button too(added this for those with broken [CALL] button).

11/Nov/2012 - UPDATE #22

[U]Default partition table:[/U] recovery=6,boot=5,misc=1,system=150,userdata=0,cache=5
[U]Included recovery:[/U] CWM Recovery Touch Beta 8 Release Candidate 1

[U]ExtRom:[/U] Disabled

Changed some options under SETTINGS.

Added option to use inbuilt off-mode charging under SETTINGS/SET DEFAULT OFF-MODE CHARGING. From that menu you can select it (option USE INBUILT OFF-MODE CHARGING) and try it out.

If using inbuilt off-mode charging the device wakes up if you press POWER [button].

This is an experimental feature! Only tested with original battery and charger.

High Voltage (as measurement) is set to 4.2 V.

Use at your own risk! Otherwise stick to the default way of charging (option USE RECOVERY'S OFF-MODE CHARGING).

Usb detection function changed (option under SETTINGS/ENABLE USB DETECTION). "USB" mark at the bottom of the screen if device connected to pc is replaced by turning led on/off if connected/disconnected.

Added some code as an experiment for a potential off-mode alarm application.

More info in this thread.

Warning :

I didn't know java or how to use eclipse and make an android app. Seriously, I still don't. But after some days I managed to write this application mostly because I wanted to know if this idea was possible. So consider it as an example. Any criticism accepted:o. I just hope that someone may find it useful and make the best out of it.

19/Nov/2012 - UPDATE #23

[U]Default partition table:[/U] recovery=6,boot=5,misc=1,system=150,userdata=0,cache=5
[U]Included recovery:[/U] CWM Recovery Touch Beta 8 Release Candidate 1

[U]ExtRom:[/U] Disabled

Added option to set the voltage threshold for inbuilt off-mode charging under SETTINGS. It can be set from 3.8 to 4.2 V.

Changed the code for the off-mode alarm application based on Rick's suggestions. In order to work you need to have a patched kernel like this one. More info on off-mode alarm in this thread.

Added some code for another project, a multiboot android app. More info here.

Small fixes.

23/Nov/2012 - UPDATE #24

[U]Default partition table:[/U] recovery=6,boot=5,misc=1,system=150,userdata=0,cache=5
[U]Included recovery:[/U] (a)CWM Recovery Touch Beta 8 Release Candidate 1 Or (b)TWRP 2.2.2.0 with new zImage (patched tytung's latest GB-kernel)

[U]ExtRom:[/U] Disabled

Voltage threshold for inbuilt off-mode charging can be set from 3.7 to 4.2 V.

First attempt to fix problem with suspend mode.

Each included recovery is edited to fix the problem with the limitation of total mtd partitions(before edit the max was 11 - now I've set it to 20)

1.5.0 (Stable)

Added GUI (Graphical User Interface)

Added Flashlight support

Added partitioning support

Added on device paritioning support

Added support for device poweroff from device itself

Added support for "Use Last 24MB NAND"

Added stable CWM recovery in the NBH for those with broken USB port

Added support for Linux kernel fonts in lk framebuffer driver.

Added Power Down support in bootloader.

Few cherry picks from mainline lk at newos.org and codeaurora.org

Few bug fixes

This is not an exhaustive list of changelog, it will be updated in the coming days.

1.4.0.1 (Legacy)

Added clk=xxx as part of the /proc/cmdline

1.4

nbgen for making .nb file

1.3.3

small fix on get_boot_reason

cwm off charge fully implemented, inspired by dan1j3l's code

1.3.2

ROMHDR base addr is spl virtual 0x80000000 = 11800000 physical, LK will relocate to correct address (MEMBASE)

save reboot reason at 0x2FFB0000 (ramconsole - 0x1000 (PAGE_SIZE)) and @0x2FFB0004 XOR 0x004b4c63 (cLK signature)

added oem cmd to fastboot and oemcmd.bat for PC. supported commands are:

dmesg - kernel debug messages

smesg - spl messages

pwf addr len - dump memory

set[c,w,s] addr value - set char(1byte), word(4 byes), or string

17.03.2011

small fix on get_boot_reason

cwm off charge fully implemented, inspired by dan1j3l's code (http://gitorious.org/htc-hd2-android.../master/cmon.c)

15.03.2011

kernel patch to save reboot reason so is available on bootloader

old patched in zip as pushed in most branches

25.02.2011

CWM patch for charging, unpatched CWM code is not properly reading kernel cmdline because /proc/cmdline file size is always 0 resulting in a always empty cmd line. I also changed the code to wait for key press then reboot phone to normal android.

20.02.2011

cLK_power_clllapse patch adds detection of cLK to kernel and puts the reset vector at 0x11800000 where cLK will jump (+4) at power_collapse_exit

off_mode_charging just prevents the kernel from BUG() if off mode charging and panel is off ( and not detectable )

both of this patches are compatibile with current SD and magldr builds, please push them to your git trees

- Cedesmith

- Martijn Stolk

- Cotulla

- seadersn

- stirkac

- Dan1j3l

- xdmcdmc

- arif-ali

- kokotas