New: XDA launches forum for app developers. Discuss coding, tools, marketing, and more.
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
bigbiff
Old
#1  
Recognized Developer - OP
Thanks Meter 1133
Posts: 1,257
Join Date: Jun 2010

 
DONATE TO ME
Default Bootloader - How does it know what partition to boot

Hello.

I am looking at fixing powerdown from TWRP on the Galaxy Note2 series of phones. I was able to get it to power down calling android_reboot(ANDROID_RB_POWEROFF, 0, 0); from libcutils. However when the phone powers on, it goes straight into recovery.

I was hoping someone might have an idea on where the bootloader gets it's information on what partition to boot so we can fix this to boot into system right away.

On the qualcomm Note1, we could run
Code:
echo 3 > /dev/block/mmcblk0p12
to boot into system.

I am looking forward to your ideas.
Phone: ATT Galaxy Note 2
ROM: CM 10.1
64 GB Class 10 Sandisk
Exfat works thanks to Andrew Nayenko!



If you need help please, please, please, please post recovery.log.
1. adb pull /tmp/recovery.log or Advanced->Copy Log to SDCard
2. Upload /tmp/recovery.log or /sdcard/recovery.log to http://paste.tinyw.in

How to submit a bug report!
 
Rebellos
Old
#2  
Elite Recognized Developer
Thanks Meter 2716
Posts: 1,252
Join Date: May 2009
Location: Gdańsk

 
DONATE TO ME
Maybe this can help you?
https://github.com/CyanogenMod/andro...s/sec-reboot.c
Feedback on my development is highly appreciated, but first you should read this GUIDE and watch this MOVIE.

If you like my work - you can help me getting various cool stuff by clicking donation link in my profile. It's not required while pressing is, just appreciated.

Pretty owsom Android/Kernel dev tips&tricks: http://omappedia.org/wiki/Android_How-tos

Git HOW-TO by eagleeyetom: http://forum.xda-developers.com/show...php?p=31304826
15-minutes GIT introduction: http://try.github.com
If you want to submit patches to my git projects - use the guides above and make a pull request.
The Following User Says Thank You to Rebellos For This Useful Post: [ Click to Expand ]
 
bigbiff
Old
#3  
Recognized Developer - OP
Thanks Meter 1133
Posts: 1,257
Join Date: Jun 2010

 
DONATE TO ME
Quote:
Originally Posted by Rebellos View Post
Hi, thanks for the pointer. Do you know how to pass the info to that sec reboot function to boot normally?
Phone: ATT Galaxy Note 2
ROM: CM 10.1
64 GB Class 10 Sandisk
Exfat works thanks to Andrew Nayenko!



If you need help please, please, please, please post recovery.log.
1. adb pull /tmp/recovery.log or Advanced->Copy Log to SDCard
2. Upload /tmp/recovery.log or /sdcard/recovery.log to http://paste.tinyw.in

How to submit a bug report!
 
thewadegeek
Old
#4  
thewadegeek's Avatar
Senior Member
Thanks Meter 584
Posts: 661
Join Date: Mar 2011
Location: Cedar Rapids
Default Re: Bootloader - How does it know what partition to boot

Based off a quick glance at the code from my phone you want to hit the reboot_mode_none case.

Sent from my SCH-R950 using Tapatalk 2
Search before asking for help.
Search again.
Once more.
And again.
Now post.
Oh and you ask for thanks? I say no.
 
bigbiff
Old
#5  
Recognized Developer - OP
Thanks Meter 1133
Posts: 1,257
Join Date: Jun 2010

 
DONATE TO ME
Quote:
Originally Posted by thewadegeek View Post
Based off a quick glance at the code from my phone you want to hit the reboot_mode_none case.

Sent from my SCH-R950 using Tapatalk 2
Yeah I was wondering how to pass that to some place from userland since you can't talk to the kernel without some facility interface.
Phone: ATT Galaxy Note 2
ROM: CM 10.1
64 GB Class 10 Sandisk
Exfat works thanks to Andrew Nayenko!



If you need help please, please, please, please post recovery.log.
1. adb pull /tmp/recovery.log or Advanced->Copy Log to SDCard
2. Upload /tmp/recovery.log or /sdcard/recovery.log to http://paste.tinyw.in

How to submit a bug report!
 
thewadegeek
Old
#6  
thewadegeek's Avatar
Senior Member
Thanks Meter 584
Posts: 661
Join Date: Mar 2011
Location: Cedar Rapids
Quote:
Originally Posted by bigbiff View Post
Yeah I was wondering how to pass that to some place from userland since you can't talk to the kernel without some facility interface.
Ah ok my bad, misunderstood the question. Beyond my are of expertise though.
Search before asking for help.
Search again.
Once more.
And again.
Now post.
Oh and you ask for thanks? I say no.
 
bigbiff
Old
#7  
Recognized Developer - OP
Thanks Meter 1133
Posts: 1,257
Join Date: Jun 2010

 
DONATE TO ME
Quote:
Originally Posted by thewadegeek View Post
Ah ok my bad, misunderstood the question. Beyond my are of expertise though.
I don't have my phone now to list running modules, but I am wondering if there is a module that might handle this. I will investigate tonight.
Phone: ATT Galaxy Note 2
ROM: CM 10.1
64 GB Class 10 Sandisk
Exfat works thanks to Andrew Nayenko!



If you need help please, please, please, please post recovery.log.
1. adb pull /tmp/recovery.log or Advanced->Copy Log to SDCard
2. Upload /tmp/recovery.log or /sdcard/recovery.log to http://paste.tinyw.in

How to submit a bug report!
 
thewadegeek
Old
#8  
thewadegeek's Avatar
Senior Member
Thanks Meter 584
Posts: 661
Join Date: Mar 2011
Location: Cedar Rapids
Quote:
Originally Posted by bigbiff View Post
I don't have my phone now to list running modules, but I am wondering if there is a module that might handle this. I will investigate tonight.
btlock.ko
cifs.ko
commkm.ko
dhd.ko
dns_resolver.ko
md4.ko
mvpkm.ko
pvtcpkm.ko
scsi_wait_scan.ko
vpnclient.ko

CyanogenMod 10.1.
Search before asking for help.
Search again.
Once more.
And again.
Now post.
Oh and you ask for thanks? I say no.


XDA PORTAL POSTS

What’s Possible with CASUAL & How to Make Your Own CASUAL – XDA Developer TV

XDA Elite Recognized Developer AdamOutler is known … more

Pearl Chen to Talk NFC Development at XDA:DevCon 2013

From HTML to LEDs or Android to Arduino, Hardware Hacking is a pastime of many people … more

Avoid Framework Bootloops on Xperias Running Jelly Bean

If you’re a Sony device owner running a stock Android Jelly Bean firmware and … more

Forum Added for the Samsung Galaxy Mega

What do you do when the Galaxy Note line is simply not big enough? You get theSamsung Galaxy Mega. … more