5,594,221 Members 44,089 Now Online
XDA Developers Android and Mobile Development Forum

Bootloader - How does it know what partition to boot

Tip us?
 
bigbiff
Old
#1  
Recognized Developer - OP
Thanks Meter 3185
Posts: 3,403
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: Tmobile Galaxy Note 3 Sim unlocked
ROM: Touchwiz stock SELINUX Enforcing
64 GB Class 10 Sandisk



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!

Support: Click http://webchat.freenode.net/?channels=twrp for support or join us in #twrp on Freenode IRC servers
 
Rebellos
Old
#2  
Senior Recognized Developer
Thanks Meter 3384
Posts: 1,334
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 3185
Posts: 3,403
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: Tmobile Galaxy Note 3 Sim unlocked
ROM: Touchwiz stock SELINUX Enforcing
64 GB Class 10 Sandisk



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!

Support: Click http://webchat.freenode.net/?channels=twrp for support or join us in #twrp on Freenode IRC servers
 
thewadegeek
Old
#4  
thewadegeek's Avatar
Senior Member
Thanks Meter 728
Posts: 694
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 3185
Posts: 3,403
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: Tmobile Galaxy Note 3 Sim unlocked
ROM: Touchwiz stock SELINUX Enforcing
64 GB Class 10 Sandisk



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!

Support: Click http://webchat.freenode.net/?channels=twrp for support or join us in #twrp on Freenode IRC servers
 
thewadegeek
Old
#6  
thewadegeek's Avatar
Senior Member
Thanks Meter 728
Posts: 694
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 3185
Posts: 3,403
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: Tmobile Galaxy Note 3 Sim unlocked
ROM: Touchwiz stock SELINUX Enforcing
64 GB Class 10 Sandisk



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!

Support: Click http://webchat.freenode.net/?channels=twrp for support or join us in #twrp on Freenode IRC servers
 
thewadegeek
Old
#8  
thewadegeek's Avatar
Senior Member
Thanks Meter 728
Posts: 694
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.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

Google ATAP Reveals Project Ara Developer Kits and 100K Prize Challenge

Today, Paul Eremenko from Google’s Advanced Technology and … more

Configure Your System Settings on a Per-App Basis

Do you ever like to make sure that certain device settings are enabled prior to entering a … more

How to Hack An Android App (Don’t Try This at Home) – XDA Developer TV

Listen, don’t cheat in your games. So don’t … more

Windows Phone 8.1 Developer Preview Now Available!

About two weeks ago at the BUILD conference in San Francisco, Microsoft unveiled Windows … more