yashsingh1/xdaforums huggingface dataset:
[LG Optimus G Pro] thecubed:
In the other thread (or was it this one?) I have an excerpt of the boot log that I obtained by simply "fastboot boot boot.img" -ing the phone, pulling the battery, "fastboot flash boot boot.img" and "fastboot continue" then "adb pull /proc/last_kmsg".

The entire log file was full of "mdm_pblrdy_change: pbl ready: 0" and "pbl ready: 1" lines, as if it had repeated tens of thousands of times before I was able to pull the battery (space of about 1 second).

This tells me that for some reason, images booted over fastboot lose modem support somehow. My plan is to compile a kernel without modem support at all, just for CWM purposes. Once I have a kernel image that I know works and is versatile, I will use it with CWM, and then make a flashable CWM/Loki image.

The worry here is that if I continue to just use LG's kernel image and try to Loki-ify it, it will fail to boot as well, and I'll have to LGNPST my phone to get it working again.

First things first is to get a barebones kernel that boots in fastboot. After that, I can port Loki.
[LG Optimus G Pro] hkfriends:
Yes, I am using fastboot boot <kernel.img>

(btw, the only thing I modify is: E988 Stock kernel + patched tspdrv.c + ramdisk(init.d support))

I also tried modify nothing but only stock source code compile for booting... but no luck indeed

[youtube]hEtG98JipoE[/youtube]
[LG Optimus G Pro] Gotroot:
Just a werid question but i was doing some battery pulls and holding down a few combos . Do yall get a black screen with up and power?... i cant remember how i got it to go to cwm tho
[LG Optimus G Pro] thecubed:
What you're seeing is exactly what I was describing, the kernel is actually booted-- it's hanging on init of the modem in the kernel.

It seems like your custom kernel was actually booting (well, coming to the same issue as the stock kernel), whereas mine wasn't booting at all. Synergy informs me that I was using an incorrect toolchain to build my kernel, so I'll have to try that.

If you're playing along at home still, the next step is to grep the kernel source for the line "pbl ready:" and comment that line out.

Fastboot boot your kernel, unplug usb and power off the phone.

Boot the phone (no usb yet!), then fastboot flash the original boot.img back.

Once the phone is booted, do a cat /proc/last_kmsg > /sdcard/last_kmsg.txt, and adb pull that file to your desktop for easy reading.

Then you should be able to see why the kernel is hanging without having hundreds of thousands of "pbl ready:" lines filling up the log.
[LG Optimus G Pro] hkfriends:
Ok, i have my last_kmsg.txt

http://uploaded.net/file/v59dfjhs
[LG Optimus G Pro] thecubed:
Nice work there! Is that the your custom kernel with the "pbl ready" line patched out?

If so, it looks like the wireless module is what's causing your kernel to not boot. Is your phone the ATT Optimus G Pro, or a different one?

It would appear that there's two versions of the wireless chip in the phone, one has Qualcomm WLAN and the other has Broadcom. ATT apparently has Broadcom, but I don't know what the other versions have.

For now, just try disabling the wireless in the kernel, just so you can get boot working.

Nice work!

EDIT: Changed "Nice work there?" to "Nice work there!" in my first sentence... that's what I get for writing a post when I'm half awake. Hopefully that didn't come across as me being rude...
[LG Optimus G Pro] hkfriends:
thanks for looking my debug log. mine is international version G pro (E988)

I will try to disable wifi in config and recompile to see any different .
[LG Optimus G Pro] esimon311:
Jeopardy theme playing in the background.... :banghead:

This waiting is torture on a

flash-¤-holic like myself....

When the f*ck did we get ice cream??
[LG Optimus G Pro] Gotroot:
Lol
[LG Optimus G Pro] vinniemac84:
Haha that's how I was with my OG and my S2...totally just hummed the music for final jeopardy when I read ur post too haha
[LG Optimus G Pro] Gotroot:
Ya im sure we will get a update tonight some time... glad to see other verisons of this phone are being worked on as well...
[LG Optimus G Pro] ReggieSmith:
Wouldn't it be great if the bootloader gets broken on or before the 4th?? Then we could have our own Independence Day (from LG's tyranny) :)
[LG Optimus G Pro] jdk2:
That would be something to celebrate!

I question, though, if it's LG or AT&T that's holding the process in tow. My guess is LG couldn't care less about the bootloader where AT&T doesn't want the support hassles and has required LG to lock it down.
[LG Optimus G Pro] cynosure4sure:
hmmm...if its only AT&T then why models in other markets e.g. Korean version of LG OGP have their boot loaders locked??
[LG Optimus G Pro] Jammol:
They are locked by default.
[LG Optimus G Pro] Gotroot:
Bootloader is lock by the mfg ... I wish lg was more like htc.. they actually help people unlock there phones
[LG Optimus G Pro] cynosure4sure:
I just checked Korean forums for LG OGP if there is any bootloader progress and guess they have their eyes on this thread as well....

http://cafe.naver.com/develoid.cafe...23370764&search.menuid=683&search.boardtype=L

[MENTION=1157052]thecubed[/MENTION] the world has got its eye one you :cyclops:
[LG Optimus G Pro] Gotroot:
Lol no pressure !!!!!!
[LG Optimus G Pro] lazer77:
Locked by LG but as a request from AT&T. Which is why LG couldn't help unlock it.

Sent from my SGH-I727
[LG Optimus G Pro] esimon311:
Question? Has anyone asked LG about a bootloader unlock for off contract full purchase price OG Pro?

When the f*ck did we get ice cream??
[LG Optimus G Pro] lessthanzach:
I'm pretty sure if this were the case then the Korean version would not also be locked. But alas, it is.
[LG Optimus G Pro] mrfeuss:
Well thecubed mentioned in the other Bounty thread that LG locks their bootloaders by default. You can sometimes get them to unlock for you (based on the successful petition also found in the other thread) since it's their lock. In this particular case, AT&T also made a locked bootloader a condition of their contract with LG. That's why a petition wouldn't do any good for the US variant of the OG Pro-it would involve LG violating their contract with AT&T. It's still possible a user of the Korean variant (or another international variant) could ask for a bootloader unlock and get it.
[LG Optimus G Pro] esimon311:
*here is the reply I got from LG to the question. Can they help me unlock my boot loader on a off contract OP Pro.

Dear Eric,

Thank you for contacting LG Electronics. I will gladly assist you

You will need to download a program for that. I would not be able to tell which one will work best.

Once the Boot Loader is unlocked you can damage the phone and you will be voiding our 12 month limited warranty.

I will not be able to assist you in this process.

I hope this information is helpful. If you have other questions or concerns, please do not hesitate to contact us again either via email, or by calling our customer service division at your convenience. Have a wonderful day.

Sincerely,

Aimee H.

When the f*ck did we get ice cream??
[LG Optimus G Pro] Gotroot:
Trust me I have been all over Lg butt tring to get them to help me with the bootlaoder... They just keep replying we do not unlock sims cards .... LOL even talked to a few people on the dev staff...

---------- Post added at 01:40 PM ---------- Previous post was at 12:51 PM ----------

Just got off the phone with the dev super and as far as they are concern they will not support nor rls and bootloader for this phone... So sad guess I will have to start telling my customers to buy HTC products
[LG Optimus G Pro] Jammol:
WTF?! How nice of them not to at least tell you the name of the program, lol. Now that's interesting that there is a program that you can use. I'm wondering if it has anything to do with this: http://xdaforums.com/showthread.php?t=2224020
[LG Optimus G Pro] jdk2:
Would be nice but I doubt thecubed hasn't already given that the once over. It just seems too simple, but who knows.
[LG Optimus G Pro] Gotroot:
No this doesnt work its already been talked about a few times
[LG Optimus G Pro] dexim:
I'm sure that's just a standard answer they give, and really has no value.
[LG Optimus G Pro] vladutz2007:
I asked Lg to help me

Vlad: i was wonder if you can help me i own an lg optimus g pro and if you can guide me to unlock the bootloader

Daniel: Unfortunately we cannot guide you on that as it may damage the phone software

Vlad: so if we can tell me a method thank you

Daniel: I understand, but since we cannot guide the customers on this process I wouldn't have the information to guide you on this.
[LG Optimus G Pro] insanesteve:
Kinda wish I would have went HTC now, I'm stuck with an Apple OG Pro.

The Real Professional OG
[LG Optimus G Pro] esimon311:
LOL that made me chuckle.

When the f*ck did we get ice cream??
[LG Optimus G Pro] cynosure4sure:
So does this mean that there exists a program for unlocking the bootloader and the real challenge is to find it

let the treasure hunt begin :D
[LG Optimus G Pro] Gotroot:
LOL I got bored today

http://developer.lge.com/community/forums/RetrieveForumContent.dev
[LG Optimus G Pro] insanesteve:
Does not exist

The Real Professional OG
[LG Optimus G Pro] bigfoot.kom:
The og pro received good reviews on performance and it is sad that att and lg locked it down so tight. I have been watching the progress on the bootloader and custom roms for this phone. Ive been waiting to upgrade, this lg phone might be out. I agree that if I wanted "just" a phone I would buy an apple or blackberry. Boring. Customizing is one reason people love their androids. Lg mobile division will be joining the ranks of blackberry on the stock market. :eek:
[LG Optimus G Pro] Gotroot:
Im sure it will be broken soon I just like pissing companies off lol... But I agree they should have never started locking there phones
[LG Optimus G Pro] thecubed:
Howdy everyone,

In regards to the two new questions: "Why has LG locked the bootloader??" and "Can LG unlock it for us if we whine enough??"

1.) LG has locked the bootloader at the behest of AT&T, for Verizon models, the same applies. For those of you saying that "at least HTC allows you to unlock your phone" you have clearly not owned any of the new HTC phones on AT&T. The unlock process does not officially work with AT&T branded HTC phones, as HTC has disabled unlocking as well at the request of the carrier.

Currently, most (if not all) HTC AT&T phones require some sort of hack/workaround to change the CID to a non-AT&T CID so that the bootloader unlock tool will work, and even then HTCDEV unlock is not a real unlock, it merely relaxes the security on the device just enough to install recovery and ROMs.

2.) No, LG will not unlock the bootloader simply by asking them, begging them, promising them your firstborn son/daughter, or sending them nastygrams.

Companies do not work like that, if we whine and complain like little children, they will treat us as such. Unfortunately, being adult-like and using a petition will not work either, as they have been asked imperatively to lock their lineups of phones down as best as they can.

LG has never taken phone locks seriously, this is shown by the current rooting methods that we use to gain root on these phones. They appear to recognize that the development community wants their phones unlocked, and they have added backdoors to allow us.

--

Now, back to topic:

Monday/Tuesday have been pretty busy for me, but it's nice and quiet at work today. I'm going to re-build my kernel with the proper toolchain this time (doh!) and see if I can get CWM booting from USB.

After that, it's going to be fairly simple to get LOKI working.

I can tell y'all are getting restless, just trust me, good things are around the corner.
[LG Optimus G Pro] Gotroot:
I highly agree and I for one understand your hard work and thank you for ur time..... I'm tring to make head way on roms ... cause I duno much about it but have learned a lot
[LG Optimus G Pro] esimon311:
[MENTION=1157052]thecubed[/MENTION] you my friend are my new hero....

When the f*ck did we get ice cream??
[LG Optimus G Pro] esimon311:
http://www.engadget.com/2013/07/04/...utm_source=Feed_Classic&utm_campaign=Engadget

Did You say vulnerability?

When the f*ck did we get ice cream??
[LG Optimus G Pro] thecubed:
That's an APK vulnerability itself, for system or user apps. We've got root already, so that article is irrelevant to us for now.
[LG Optimus G Pro] esimon311:
Thanks for the clarification.

When the f*ck did we get ice cream??
[LG Optimus G Pro] Gotroot:
I have killed myself tring to compile a simple rom but I keep getting error while compiling lol...
[LG Optimus G Pro] thecubed:
Quick update y'all:

I've got the kernel "booting" now, however it still dies for some strange reason.

Here's my kmsg http://pastebin.com/3PXnzACH just so y'all can follow along :)

I'll be posting all my sources and a build tree for CM here soon, it's basically the same as the Optimus G's tree.

Instructions will come soon too...

---------- Post added at 09:48 PM ---------- Previous post was at 09:40 PM ----------

Sorry for the double post --

WOOT WOOT WOOT WOOT

We now have a tethered CWM build. ADB works, and so does everything else.

More soon...
[LG Optimus G Pro] Gotroot:
Very very nice work thank you for all your work!!!
[LG Optimus G Pro] thecubed:
Video demo here:

[YOUTUBE]G8ls-2um7S0[/YOUTUBE]

Pardon the shaky camera work, I was excited, and the only notepad I had around was from work...

I'll be posting source and a quick howto when I get home tonight.

Looks like the next step is to get the modem fully booting (I just patched out the modem for now), and to get Loki ported.
[LG Optimus G Pro] Gotroot:
Can't wait lol might have to pull a all nighter so I can see how to do this...
[LG Optimus G Pro] trooper1414:
I'll be pulling an all nighter.... Just in sheer excitement
[LG Optimus G Pro] thecubed:
Alright everyone, I'm going to be putting up a new thread for this soon, but realize that it's still a work-in progress and not really something that is for general public use yet since getting to fastboot is a semi-dangerous process.

For anyone thinking of pulling an all-nighter for an unlock, don't wait up just quite yet haha.

There's a series of discussions that me and Shelnutt2 need to have now about how we think we should handle the unlocks.

We have two options:

1) do this exactly like LOKI, and just deal with having to have bootloader-dependent ROMs

The problem with this is we never really get a fastboot prompt unless we remove a boot/recovery image from the phone.

This means that recovering from a bad flash is limited to LGNPST or my Python replacement. I'm okay with this, however it makes testing ROMs harder, since you now have to flash it instead of just booting it from fastboot.

The advantage is it's fairly simple and fast to do. I can get LOKI ported in a matter of a few days once I figure out the safest way for me to flash the test images.

2) port Moboot to this device, store the boot images in /cache and chainload them that way.

The problem with this is *time*. It will take a matter of weeks and possibly a month or so for me to get Moboot ported over.

We'd boot Moboot as a 'second bootloader' via LOKI and the stock bootloader. From there, we'd have full fastboot access and the ability to have multiple boot images and whatnot.

--

The third and more long term goal is to actually crack SBL3. This would allow us to load the Nexus 4 (mako)'s bootloader onto this device which would give us full fastboot access and a normal Nexus-style bootloader with no security enabled.

I haven't looked into this option too deeply. I *do* have an idea how to accomplish this, however it really requires me to have a C disassembly of SBL3 from someone with ARM Hexrays Decompiler. I'm just getting by right now off of the assembly code that I have and LOTS of paper notes.

Anyway guys, thanks for the kind words!
[LG Optimus G Pro] hkfriends:
For me, I prefer option 1 first, which I can start building my kernel... currently I am still stuck in fastboot mode... I know it would be more complicated for testing, but at least can start it first..

For middle/long term, of course option 2 or 3 is more perfect
[LG Optimus G Pro] thecubed:
Alright guys, whomever is looking to get a headstart building stuff, look here:

http://xdaforums.com/showthread.php?p=43277118#post43277118

Instructions for building your own kernels and CM10.1 is now up!

:D

I'll post a guide there for how to get into fastboot.

For now, if you are alright with having a tethered boot, you could in theory compile AOSP for yourself and be happy (provided you don't have to reboot your device away from a computer)
[LG Optimus G Pro] Gotroot:
Very nice work !!! cant wait to get home from work now lol ..
[LG Optimus G Pro] HellfireXD:
TWRP / FreeGee

Personally i would like to get TWRP Recovery loaded on my Optimus G Pro. I did try running FreeGee on it but it came back unsupported (not surprised). If there is anything you need to help further along your work please let me know and i will try to get it for you.
[LG Optimus G Pro] andygold:
Embarrassed to say, but its all Greek to me! From my personal perspective, if given the choice, I'd prefer whatever is the safest and easiest solution for the end user. If I had to choose between safer or easier, I'd choose safer.

As someone that knows nothing about coding (I'm not even sure if that's the right word), in a perfect world I'd prefer an automated process similar to those used for jailbreaking Apple products. Either it works or it doesn't, but if the JB didn't work, at least it doesn't leave you stuck.
[LG Optimus G Pro] MrDSL:
The 3rd would hopefully be something we could get.
[LG Optimus G Pro] ricco333:
+1, number 3 would be great!! Thanks for the hard work.

Erik
[LG Optimus G Pro] chakdere:
+1
[LG Optimus G Pro] dexim:
I think everyone agrees that the third option would be the most desirable, but the first might be good short-term until the third could be completed.
[LG Optimus G Pro] thecubed:
So, on my schedule today I need to:

1) Fix my sources to build with CM10.1 instead of CM10 that I had specified incorrectly (oops!)

2) Work more on LOKI. I have identified the function that I want to patch with LOKI's code, however testing this is going to be a pain in the ass, since I can't just fastboot boot my test images, I have to actually flash them, and if they don't work, I have to power down the phone, reboot to fastboot and erase the partition again.

Time consuming :(

How much work gets done today depends on how much IRL work I have on my plate...

I'm most definitely going to go for option #1 for now, as it can be done fairly quickly.

I'll make a flashable CWM first, then a security-off boot.img that can be used for deodexed and custom ROMs.

Please note, all of this will be AT&T ONLY for a little bit, since all the variants have different bootloader versions.

Don't fret though, I will work on multiple variants once I get the basics sorted out.
[LG Optimus G Pro] insanesteve:
[MENTION=1157052]thecubed[/MENTION]

No Hommo, but, I love you, thanks for doing this, once done I will send you money.

The Real Professional OG
[LG Optimus G Pro] st1114g:
Take your time and do what you do best - Unleash The Dragon !!!

Your hard work is tremendously appreciated!!!?
[LG Optimus G Pro] DeMoN0iD:
Will try to make a light weight rom

I'm a noob at all of this developing but have some Linux experience. For my better understand of the whole Linux Kernel I will be attempting to create a custom Kernel. Due to the lack of support of the LG Nitro, their should be more people out their developing. So I may sound retarded more then half the time, because i'm a noob at all this. If any one could help me in the future, or at least point me in the right direction with developing. I'll be working with Centos 6.4 and working on what TheCubed had posted about Building Android / Kernels.

Thanks all
[LG Optimus G Pro] hkfriends:
can't wait to see you fix ATT then look into international model E988 or KR version F240 :good:
[LG Optimus G Pro] thecubed:
So, today a very kind soul was nice enough to convert Shelnutt2's IDA dump of ABOOT to C for me, however it looks like the IDA dump was set up incorrectly since the disassembly is a little wonky (strings like "Secure boot start" are "ecure boot start" in the dump)

Expect things to move a little slower here in the next few days -- this is a giant learning curve for me.

The two things I need to find to make Loki work are:

1) Where ABOOT loads the boot.img header into RAM

2) The location of the 'check_signatures' function in ROM, or any of the functions that I can easily patch with Dan's code

These two things are relatively easy to find with a good disassembly, however the learning curve to get there is quite immense.

I do plan on writing a "howto" once I've figured it out, since I'm always in favor of sharing information as much as possible.

I've already got some nice graphics put together for an explanation of how Loki works to better explain it to people. Maybe it'll be helpful for other fellow bootloader-unlockers once I get it done.

Thanks everyone for your patience... good things come with time :D
[LG Optimus G Pro] hkfriends:
Thanks dude , you are so nice to share information... as I am really interesting what is this doing :)
[LG Optimus G Pro] adobian:
Thanks for this development. i ordered my optimus G pro already, and it's being delivered.
[LG Optimus G Pro] DeMoN0iD:
keep up the good work, great job on the kernel development tutorial btw. Trying to make a kernel similar to Franco's Mako 3.4 Kernel.
[LG Optimus G Pro] thecubed:
0x88F54418

"What is that??" you ask.

That, my friends, is Part 1 of 2 to port Loki to this phone.

It's the pointer to where ABOOT loads the boot.img header into RAM.

Technical reference for anyone following along at home--

When ABOOT reads the boot.img file, it loads 0x800 (possibly 0x400) bytes of the header into RAM.

From there, it looks at header+8 bytes to find out how big the kernel is, header+16 bytes to find out where it should go. This is defined by the mkbootimg.h file in the android source (struct boot_hdr).

"Okay, so why do we need that?"

Part of porting Loki involves telling the Loki shellcode where to find the boot.img's header in RAM so it can un-mangle it.

This needs to be done since Loki changes the ramdisk load address to point to the code in ABOOT that it wants to overwrite. Loki needs to take the sane values it stored elsewhere and put them back in the right place so the boot_linux() function can do it's job as normal.

"Aiight. Cool. What's next?"

Good question. Now I need to figure out where the function "check_signature" lives. LG probably named it something else, but the name doesn't matter. The gist is I need to find where it lives in memory so we can tell ABOOT to put our custom "ramdisk" payload right on top of it.

Hopefully that makes sense, it's taken a while for me to get this far haha.

Dan Rosenberg, if you're reading this, you're a very smart man. Kudos.
[LG Optimus G Pro] Gotroot:
Very nice work makes me wish I never stopped working on Cm back in the day...
[LG Optimus G Pro] mbruster:
Is Dan still really smart even if he is not reading this? ;)
[LG Optimus G Pro] slaxer:
Keep up the spirit! Really hope it could come true and also available for LG Optimus G Pro E988 version :)
[LG Optimus G Pro] turilo:
put me down for a $50 Donation once this baby's bootloader gets unlocked :)
[LG Optimus G Pro] djrbliss:
What's the verdict on whether or not bypassing the bootloader signature checking with Loki counts as "unlocking" for the sake of the bounty? I'm tempted to spend the time porting Loki to this device, but I'd prefer to know what happens to the bounty first (I'd be donating at least half to charity).
[LG Optimus G Pro] mrfeuss:
I can't speak for everyone, but I think it probably counts. Most people just want to start loading up custom ROMs. In fact, I believe Loki is the route thecubed is currently exploring.