yashsingh1/xdaforums huggingface dataset:
[LG Revolution] majorpay:
ok, so here was the output (of what i assume is the relevant part):

rootfs / rootfs ro,relatime 0 0
tmpfs /dev tmpfs rw,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
/dev/block/mmcblk0p12 /system ext3 ro,relatime,data=ordered 0 0
/dev/block/mmcblk0p13 /data ext3 rw,nosuid,nodev,relatime,errors=continue,data=ordered 0 0
/dev/block/mmcblk0p6 /cache ext3 rw,nosuid,nodev,relatime,errors=continue,data=ordered 0 0
/dev/block/mmcblk0p5 /persist ext3 rw,nosuid,nodev,relatime,data=ordered 0 0
tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/extasec tmpfs rw,relatime,mode=755,gid=1000 0 0

So 12 is system, 13 is data, 6 is cache, and 5 is persist. What I'm not seeing is boot. Am I missing anything here?
[LG Revolution] thecubed:
To find unnamed partitions, you might want to dump them to your SD card and try mounting the partitions on your PC.

You can copy a partition to a file on your SD card by using "dd if=/dev/block/mmcblk0pX of=/sdcard/mmcblk0pX.img bs=1024"

Then on your desktop, you can try running fdisk to see what the partition type is and issue a "mkdir /mnt/test" then "mount -o loop -t <type of partition from fdisk> /path/to/mmcblk0pX.img /mnt/test".

From there, you should be able to investigate what's in those partitions by poking around in /mnt/test on your desktop. Once you're done, "umount /mnt/test" to close the image file.

Referring to your list of partitions and sizes, partitions of 2048 blocks or less are probably not worth your time investigating, however I may be wrong.

Also, quick tip: mmcblk0 (with no pX) is the entire onboard storage as one unit. Don't bother dumping that to your SD card, since it contains all partitions, but will be a really big file and a big mess to figure out the partitions and mount it.

Good luck!
[LG Revolution] majorpay:
Outstanding, and THANKS A MILLION for the help. I've been banging my head against the wall here...

I should probably hit the sack, but I had started pulling those already, so I've got a head start.
[LG Revolution] thecubed:
Okay, good luck! I don't have this device, but a friend is getting one here soon (not sure how soon though) so I'm interested in getting CWM ported and some groundwork laid for CM7/etc on it.

Whenever you get time, I'm interested in seeing what you find the partitions are...

Thanks!
[LG Revolution] majorpay:
Went ahead and put a little more time into it...

used your method for dumping each individual partition.

A listing with file sizes:

2048 mmcblk0p1 4096 mmcblk0p11 2048 mmcblk0p2 4 mmcblk0p4 24576 mmcblk0p8
4096 mmcblk0p10 12288 mmcblk0p14 7168 mmcblk0p3 4096 mmcblk0p7 8192 mmcblk0p9

My common fdisk result (for all files) is:

fdisk -l mmcblk0p11

Disk mmcblk0p11: 0 MB, 0 bytes
255 heads, 63 sectors/track, 0 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xf6908d66

Disk mmcblk0p11 doesn't contain a valid partition table

Maybe I need to look at this again when I'm a little less tired, but this is the result of every image file.
[LG Revolution] thecubed:
P11 looks to be just a placeholder partition. Try p3, p8, p9, and p14.

Usually /boot is a lower number partition...

If you could upload the dumps of those partitions somewhere, I may be able to tell you which is which. (PM the link, don't post public- I'm not sure how XDA would feel about that).

This shouldn't be too hard to identify which is which. If you're well versed in hex editing, you could run those images through a hex dumper and check the file's magic numbers. I'm not too familiar with this device, but I'd say it can't be much different than the HTC boot.img format. Grab a boot.img from somewhere and see if the first couple of bytes match up on the dumps you've got.

From there, that should give you a clue with which is which. I'm betting you'll find which is the kernel by just doing a "strings" on the dumps and looking for things like "kernel" or "linux".

Good luck!

EDIT: after doing some reading, looks like some of the partitions are the fastboot type. Fastboot images = kernel + ramdisk. And, at least one of those partitions will be the Qualcomm AMSS partition for the radio chipset. Do a "strings <filename> | grep -i qualcomm" (or replace qualcomm with things like 'amss' or 'radio') to find which is which.
[LG Revolution] thecubed:
Great work!

A few possible corrections:

Thought #1: From what I've read, AMSS (the radio) has multiple 'nvram partitions' where configuration is stored. The partitions with size 2048 look like those.

My updated guess:

P1 = hardware bootloader (like HBOOT on a HTC device)

P2 = second stage bootloader (references to android and wm_ldr)

The actual AMSS firmware is usually above 10MB in size, so the radio firmware is most likely a larger partition.

Thought #2: /boot is quite possibly a fastboot image. Those are usually compressed, hence you will not find any strings in it. It would be all binary.

If you can, run "hexdump -n 32 <filename>" on each of the dumps, and paste the output here.

With that hexdump information, I can tell you which partitions have the fastboot magic number and which are AMSS configuration partitions or ext3 filesystems.

As a side note, I wonder if this device supports fastboot commands... you could potentially try something like "fastboot reboot recovery" which should be harmless to see. Of course, you'd need Google's fastboot tools on your machine first though. (http://android-dls.com/wiki/index.php?title=Fastboot)

If it turns out that fastboot works, a nondestructive way of testing if the device is signed would be to extract the recovery image and replace it's ramdisk with one containing Clockwork. It may be as simple as "fastboot boot <newimage>" to boot the new image without actually changing anything on the phone.

Anyway, get those hex dumps, then we'll see where that leads...

Great work!
[LG Revolution] majorpay:
Alright - I'll get on that tonight when I get home (probably about another 2.5 hours from now including dinner).

The other thing that's been rattling around in my head, and I know I shouldn't be jumping this far ahead (nor do I want to derail this thread), is I (and the entire community) need to make some modifications to the android.policy.jar thus completing the migration from Bing on this phone. One string would make all the difference :D Unfortunately, it is odexed. I'm guessing this has many dependencies, and the best method to go about this would be to pretty much deodex the entire O.S.. Obviously, that's not something I feel comfortable with doing until we are completed with this, but my thought process is on track for what I need to do, right?

I also need to research if it is possible to dump my entire phone as an image as part of an Android AVM, so I don't end up bricking my phone. I had my entire phone lockup and go black last night. About had a heart attack.

Obviously, this takes precedence, but just wanted to throw all that out there while it was fresh in my mind (things get lost quickly - I have twenty browser windows open juggling about a dozen different thought processes).
[LG Revolution] majorpay:
Hex Dumps

P1:

0000000 dcd1 844b 1034 73d7 435a 7d0b ffff ffff
0000010 ffff ffff ffff ffff ffff ffff ffff ffff
0000020

P2:

0000000 000b 0000 0003 0000 0000 0000 0000 0450
0000010 31f8 0013 31f8 0013 31f8 0463 0000 0000
0000020

I'll have to do the fastboot install at home.
[LG Revolution] kalvinl:
I believe I saw that it has been deodexed on stetsonaw's Twitter page. You may want to get in touch with him
[LG Revolution] majorpay:
Yeah, I saw he had claimed that over on androidforums. I should start checking that area more often. I put a post out to feel it out and see if he might be willing to throw it my way :) I think ultimately he is waiting patiently in the wings waiting for us to get done with this so he can release the ROM he is working on.
[LG Revolution] Mr.Greeen:
Just wanted to say keep up the good work. I plan to look into this more when I get home but sounds like you are definitely on the right track. Excited to see more progress soon.

I just got into the scene as this is my first droid phone but I have been reading up as quickly as possible to contribute to making roms.
[LG Revolution] majorpay:
OK, so I am back in the saddle.

I have run a ./fastboot reboot, and as expected, no response. (says waiting for device) I believe I still need to modify my hosts.

I expect you've seen my hex dumps. Any thoughts?

Edit: Phone went into "Download is in progress. Do not disconnect cable."

Real? I don't know, but this is hindering me from moving forward.
[LG Revolution] thecubed:
Great- now I just need hexdumps of the other partitions I listed: P3, P8, P9, and P14.

P1 and P2 are of little interest to us, we're looking for the one containing recovery and the main kernel+ramdisk.

As soon as we identify which is the recovery partition, we'll be super close to finding whether recovery is signed and one step closer to porting CWM.

PS: Fastboot reboot may have put your phone in download mode. If you're stuck in it, just try using "fastboot reboot recovery", then from there you should be able to select "reboot" and end up in Android again...
[LG Revolution] majorpay:
p3

0000000 ffff ffff ffff ffff ffff ffff ffff ffff
*
0000020

p8

0000000 0000 0000 0000 0000 0000 0000 0000 0000
*
0000020

p9

0000000 4e41 5244 494f 2144 66ac 0038 8000 0020
0000010 fb21 002f 0000 0120 0000 0000 0000 0110
0000020

p14

0000000 4e41 5244 494f 2144 66ac 0038 8000 0020
0000010 8cd9 0033 0000 0120 0000 0000 0000 0110
0000020

And ./fastboot devices consistently shows nothing. I added the device per Ubuntu guide, and restarted udev, but still nada.

Edit... I missed something on fastboot (I added the wrong device). I'll go back and recheck.

Edit 2: Still no luck.
[LG Revolution] majorpay:
As an update, it appears that holding the power button with the volume button up puts the device into what looks like a fastboot state (only when plugged into usb).

Edit: Maybe this is just a recovery mode / Emergency mode.

It is designated by a sign that reads: "Download is in progress. Do not disconnect cable."

According to my usb device information, it shows up as a LGE USB CDMA Modem.

lsusb
Bus 001 Device 025: ID 1004:6200 LG Electronics, Inc.

51-android.rules

SUBSYSTEM=="usb", SYSFS{idVendor}=="1004", MODE="0666", OWNER="<my username>"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1004",ATTR{idProduct}=="6200", OWNER="<my username>"

"./fastboot devices" shows nothing
[LG Revolution] bwhxeon:
no tegra either was last I heard as well. I do remember reading the phone would go into some form of linux instead of the stock android OS and it didn't run well enough to be worth it. It should have been more of a padphone solution instead of a laptop dock. Sad thing is the evo 4g can be turned into a mini pc and it was done by devs that aren't on anyones payroll.
[LG Revolution] majorpay:
If we can flip this unit, we might have the same ability (assuming we have someone knowledgeable in that area). This unit has more RAM than the Bionic will have, and has the same HDMI port, so.....
[LG Revolution] majorpay:
We make or break these devices in these forums. There's a reason LG left BusyBox on this unit and didn't sign any of their crap. They'll tell you they don't support developers modding their device, but they're under contract to feel that way. It's the nod to the developer while behaving in front of Verizon.
[LG Revolution] bwhxeon:
Shouldn't really be much to do, I don't know for sure, but I think the phone should have native support for keyboard and mice.
[LG Revolution] majorpay:
BT 3.0 built into this device. It's a done deal.
[LG Revolution] thecubed:
I'm baaaaack!

Anyone ready?

Meet me on IRC if you're ready and willing to test...
[LG Revolution] bwhxeon:
I'll be home in the next hour or two, plans did change tonight stupid rain..........so I'll jump on IRC later tonight, want to try and get this done before the verizon store closes, if not guess I can use my fascinate for a day or two.
[LG Revolution] thecubed:
EPIC WIN!

c:\android\adb>adb devices
99000044XXXXXX recovery

Now, to add things like "sh" to the recovery image, since we can't do adb shell without /sbin/sh :)

Later tonight, I should have a recovery image up and ready for testing that should include busybox but no recovery, so we can push clockwork to test.
[LG Revolution] Squiz0329:
Splendid work. Thanks for making mine the first to be recovered! ;-)
[LG Revolution] majorpay:
And thank you for being the guinea pig :D
[LG Revolution] bwhxeon:
so this returned him to stock? like removed root returned to stock?
[LG Revolution] thecubed:
Yes, the mod that I made to the recovery ONLY enabled ADB during restore.

That was just a test to make the least amount of changes to see what was possible.

Now, we go whole hog. I'm building a full clockworkmod recovery right now.
[LG Revolution] majorpay:
That wasn't really the point of it. It was to test a dummy recovery to make way for a CM recovery.
[LG Revolution] thecubed:
Slight bump in the road-- looks like the stock LG recovery binary (/sbin/recovery) resets the "FACT_RESET_3" to "FACT_RESET_6" in mmcblk0p8 after restore is done, like I thought.

Not a big deal, just means I can't cheat and re-use the clockwork binaries from the tbolt.

Also means that I've gotta figure out a script that can change that byte from "3" to "6" on reboot.

Shouldn't be that hard :)
[LG Revolution] Squiz0329:
Still rooted. Just a stock recovery flashed without brickage.
[LG Revolution] thecubed:
Woot!

Building Clockworkmod right now from source...

A few things needed to be modified, of course...

Should have a private test build tonight. Any volunteers?

I should have _something_ built by 11PM Pacific time (I'm still out and about, away from my desktop)

Willing to give it a try? Meet me on IRC on #lgrevolution around 10PM.

Thanks all!
[LG Revolution] majorpay:
I'm in there now, and when is 10pm... 1 hour from now?
[LG Revolution] Carbon_Rink:
2am Est.. so an hour and 22 minutes from right now :)
[LG Revolution] majorpay:
10pm PST would be 30 mins from now, right?
[LG Revolution] OmiDroid:
11 your time Major.
[LG Revolution] Squiz0329:
Midnight in CO
[LG Revolution] OmiDroid:
My bad. Thought CO was on MTN...
[LG Revolution] Squiz0329:
Yep. Eastern, Central, Mountain, Pacific.
[LG Revolution] majorpay:
It depends on which part of the message you read:

First mention of time says 11pm PST - that would be 12am here

Second mention says 10pm - assuming same time zone, that would be 11pm
[LG Revolution] gimpcell:
It should be...

<Pacific, Mountain, Central, Eastern> like on a map. =p
[LG Revolution] OmiDroid:
Was basing it on the last post cubed sent...

[Edit] i meant 2nd mention. It's late... i'm goin ya bed. GL guys...
[LG Revolution] thecubed:
ok ok ok i'm back!

haha

So, i'm re-creating my build environment and trying to figure out what I did wrong last time... now just to make the makefiles correct this time..

Talking with some of my NookColor friends and geniuses, they'll set me straight.
[LG Revolution] thecubed:
IIIIT IIIIS FIIINISHED!!

Okay, so it's 5:00AM Pacific time. Here I am staring at a terminal window "Build Finished."

Wow.

Really?

I check my hexdump and compare it to the stock recovery dump.. yep, only the ramdisk size changed, and the SHA1 sum of it.

I check the filesize- yep, that's good too.

I run through the recovery.c source to make sure I spelled "ignorebootmessage" right.. yep (I think so!)

I check the ramdisk.. does it unpack? Yep. Does it have what I want? Yep.

Could it be? Is it.. finished?

Nah, so I check the recovery.fstab one more time.

Yep. It's finished.

ClockworkMod Recovery for the Revolution 4G is HERE!

tyler@thinserver:/home/tyler/android_dev/android/system/out/target/product/revolution# md5sum recovery-final.img
7649476a6e869c2370bd8d8a12f5eee9 recovery-final.img

Yep. Indeed.

Okay, so off to bed with my delirious self, I'll see 'ya all in the afternoon.

Testers needed!
[LG Revolution] Squiz0329:
Volunteer numero uno, if I wake up early enough!
[LG Revolution] gimpcell:
Lets get the party started!! Who needs sleep when you have death to look forward to for eternal rest. I will be on irc when you kids are ready for the big leagues. =)
[LG Revolution] juicehead9:
Link? Ill test it.
[LG Revolution] gimpcell:
Lets hope he its still alive after last night. I left the convoy last night after some happy pills and read what they were taking about this morning... Lets say they were sleep deprived.
[LG Revolution] juicehead9:
Thats awesome lets hope they get some well deserved sleep
[LG Revolution] majorpay:
Alright... Whenever you're awake this morning, hit me up. Make the suspense stop! :D:D:eek:
[LG Revolution] thecubed:
Okay, so after a long conversation with myself, I think I'm awake.

Meet at the usual place and let's get this tested!

Quick update: it works!

But!! We need help fixing the framebuffer issue.. right now we see no UI, but ADB access works perfectly.

Error we're getting is "active fb swap failed: invalid argument"
[LG Revolution] thecubed:
Okay, so semi-sweet successful test!

Good news: no bricks!

Close call: turns out my postrecoveryboot.sh script somehow managed to erase p8. Luckily I checked before we rebooted else we would have had a brick.

So, things that need fixing:

1) somehow, we don't have the proper framebuffer configuration.

This would be easy to fix if we had the LG kernel source and whatnot.

But that 'aint gonna happen, so I've got a few other ideas.

2) I need to fix that postrecoveryboot.sh script.. I have no idea why it worked on my desktop, but not in android.

I suspect busybox is to blame this time (it usually is).

So I'm going to compile a binary that just fixes the boot command. Should be easy as pie. (assuming that pie is easy).

Anyway, those are two pretty big blocks in the road right now, but with enough manpower, we should be able to overcome!

In short, I'm off to go watch a movie and let my brain recover. I'll post back here when I'm back!
[LG Revolution] majorpay:
Well this ought to help your brain recover: We've got the original firmware now!
[LG Revolution] lazarus2297:
but what program do we use to flash that file? I downloaded it this afternoon just to have it, but I haven't ever flashed LG's.. I have used the upgrade tool, but the files I used for that had a different extension
[LG Revolution] majorpay:
LGNPST - I have a copy, but my concern isn't being able to flash it, but rather to extract from it. That's what I'm trying to figure out.
[LG Revolution] stetsonaw:
join us in the IRC man! Page 17 has the info, towared the bottom.
[LG Revolution] lazarus2297:
i guess i could have done my own research first so apparently you need LGNPST and it does use .TOT files
[LG Revolution] majorpay:
Yes

../10chars
[LG Revolution] lazarus2297:
after looking for LGNPST i remember back before i had smart phones I do remember flashing LG's using some version of this tool.. guess i gotta polish those skills again :)
[LG Revolution] thecubed:
Okay, so thanks to Nemith and VeryGreen of the NookColor developers, I think they may have given me a very simple solution to the screen corruption issue...

They also suggested a fix for my almost-bricking script :)

I'm going to give that a try, then make some builds...
[LG Revolution] thecubed:
New recovery image built.. ready for testing after dinner :)

root@thinserver:/home/tyler/android_dev/android/system/out/target/product/revolution# md5sum recovery-cwm-take2.img
7ecce97b9949b93dde35d7c99ff213b5 recovery-cwm-take2.img

Edit: testing now!

Okay, so still having LCD issues...
[LG Revolution] thecubed:
Ooh Pretty!

http://i.imgur.com/v9jOU.jpg

We have on screen display! I think we've got the wrong BITS_PER_PIXEL set, hence the resolution.

Keybindings seem to work also... Good news cometh soon!
[LG Revolution] stetsonaw:
That's so epic!

Sent from 1885
[LG Revolution] thecubed:
We're SO close, we just have to fix the framebuffer now..

We're having an issue with the framebuffer stride, we're getting 4 copies of everything on screen now, but aside from that, CWM is totally usable (without testing things like backups/restore yet).
[LG Revolution] OmiDroid:
It's amazing what you guys have accomplished in seven days (and late nights).
[LG Revolution] majorpay:
Because it was 2010, we don't know for sure what was implemented in CM since then, but I can tell you that ruotal's method for making the memory surface width match the stride was not fully realized.

I'm sure you already have ideas, and I will be gone for a most of the day until early afternoon. If you have extra time on your hands, maybe you could make a build with that change, and a build for each one of your ideas, and we can test it when I get back (that way you don't have to rebuild and recode in between each test)? If we fail on all of those then we'll have to go back to you hacking away and rebuilding between each :)

Just an idea, of course ... :D
[LG Revolution] thecubed:
Okay, I think I have an idea as to how to speed up testing.. instead of making a full recovery image, I'll just build the binary that changes.

Hopefully that should make testing easier!
[LG Revolution] majorpay:
Yeah, and if you want, you could always write a script and transfer it to my dev machine (tis ok with me) for the push/md5sum/zero and partition overwrite. Of course, there'd have to be a programmed break on the md5, but it'd save you a heck of a lot of typing (unless you enjoy that part) :)

Working directory: ~/Downloads/android-sdk-linux_x86/platform-tools
[LG Revolution] majorpay:
Omw home... Be ready in 10 mins or so.
[LG Revolution] thecubed:
Okay, i'm here.. just re-setting up my build environment on my servers after a power outage...

Edit: no builds for today... my build server seems to have experienced severe memory loss (read: 11 power outages since last night does not a happy EXT4 filesystem make).
[LG Revolution] thecubed:
Okay, build environment back in action.

Sorry about that guys. Nothing was lost except for time.

I've got a few more suggestions from some people smarter than I on the framebuffer issue, and they suggest a few variables need to be changed.

Majorpay: that patch for the SE Xperia won't do us any good, it appears that as a side effect of changing to 32-bit color, we need to allocate more memory per line, hence the doubling. I'm not exactly sure, but it's an idea.

I'm working on figuring out Github, so we can get a project together and everyone have access to the source files. If there's no one around to test, I'll just work on getting that set up.

Thanks guys for sticking around- as always, we're close, just a few bugs to squash and we're good!
[LG Revolution] thecubed:
TODAY, we have WON!

http://i.imgur.com/DYfNK.jpg

http://i.imgur.com/Q7qE4.jpg (thanks majorpay!)

Working (graphically) UI,

Working buttons.

Now, all that's left is to test the features/etc.

Special thanks to Majorpay for being a Major help!

He volunteered his phone to the cause, and after a few scary almost-bricked moments is still with us :)

Expect public builds tomorrow!

New thread here: http://xdaforums.com/showthread.php?p=14676930

Let's move the talk about CWM there, and leave this for boot-related problems.

I'm going to post a full article on how this was accomplished as soon as I get a public build out.
[LG Revolution] thecubed:
Looks like P9 and P14 are fastboot images... my guess is P9 is recovery since it's small.

If you can put P9 on a hosting site somewhere, I can extract it and see what can be done about porting CWM. I think we may be able to enable ADB in recovery-- then we can go about trying clockwork's recovery.

Great work!