Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,738,819 Members 40,994 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 3545
Posts: 3,997
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:
Select 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 3421
Posts: 1,339
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 3545
Posts: 3,997
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 753
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 3545
Posts: 3,997
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 753
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 3545
Posts: 3,997
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 753
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

Browse the Internet with the Innovative Atlas Web Browser

For the most part, Chrome, Firefox, and Dolphin Browser have no real rivals among … more

Choose from Over a Thousand Battery Styles with 3Minit Battery Mod

The battery style in stock Android looks pretty dull. It doesn’t … more

Organize Your Cloud Storage Files with Unclouded

Cloud storage services like Dropbox or Google Drive have grown in popularity dramatically … more

XDA Xposed Tuesday: Blur Your System Notification Panel – XDA Developer TV

Listen, we love innovative applications and modules that … more