5,604,050 Members 48,105 Now Online
XDA Developers Android and Mobile Development Forum

Need help renaming Partitions in Dual Boot kernel!! Please Help!!

Tip us?
 
fishingfon
Old
#21  
fishingfon's Avatar
Senior Member - OP
Thanks Meter 253
Posts: 712
Join Date: Feb 2012
Location: Brisbane, QLD, Australia
I am having a problem getting the dual boot working.
I cloned the /data and /system to the /data/media/.secondrom/ folder like gokhan said, and I placed a file /.secondrom/media/.nextboot with the value of 2, which is supposed to get the to boot up in to the second Rom. But it still boots up in the first Rom.


Corey

Sent from my GT-N7100

If I helped you, please hit Thanks..
My Current Devices:
Galaxy Note II N7100
HTC 8x Windows Phone 8
Samsung Galaxy S2 I9100
Nexus 7


 
garyd9
Old
#22  
garyd9's Avatar
Recognized Developer
Thanks Meter 1875
Posts: 1,836
Join Date: Sep 2006
Location: Pittsburgh, PA
when you boot normally, does "/data/media/.secondrom" exist as a directory? Does "/data/media/.secondrom/system.img" exist as a file? What is the output of "ls -l /data/media/.secondrom/"?

I still don't know what that "/sbin/choose_rom" file is, what it does, etc. Is that a script or a binary? If it's a script, what is it doing? (If it's missing, based on the script in the OP, booting to a second firmware will fail.)

Gary

Donations: I don't accept donations, but if you are feeling charitable, help a child by going to http://www.shrinershospitalsforchildren.org/
and click the "Donate Now" link at the top.
The Following User Says Thank You to garyd9 For This Useful Post: [ Click to Expand ]
 
fishingfon
Old
(Last edited by fishingfon; 28th December 2012 at 01:23 AM.)
#23  
fishingfon's Avatar
Senior Member - OP
Thanks Meter 253
Posts: 712
Join Date: Feb 2012
Location: Brisbane, QLD, Australia
Quote:
Originally Posted by garyd9 View Post
when you boot normally, does "/data/media/.secondrom" exist as a directory? Does "/data/media/.secondrom/system.img" exist as a file? What is the output of "ls -l /data/media/.secondrom/"?

I still don't know what that "/sbin/choose_rom" file is, what it does, etc. Is that a script or a binary? If it's a script, what is it doing? (If it's missing, based on the script in the OP, booting to a second firmware will fail.)

Gary
Hi,
I manually created the /data/media/secondrom folder, and I also manually created the system image in it, as I don't have the custom dual boot recovery which normally crates them yet. So they are always there.


The choose Rom you can view here I think
https://github.com/gokhanmoral/ramfs-sgs3

Although I think it's just a binary. And yes the binary is in my kernel.

The output of that command is
Code:
 
u0_a142@android:/ $ export PATH=/data/local/bin:$PATH
u0_a142@android:/ $ su
u0_a142@android:/ # ls -l /data/media/.secondrom/
drwxrwx--x system   system            2012-12-28 09:24 data
-rw-rw-r-- root     sdcard_rw 2147483648 2012-12-28 10:36 system.img
u0_a142@android:/ #
Do u have any idea what it could be?, could the second system img I created not be getting mounted or anything?.
Here is a message I sent gokhan moral explaining the problem

"
Hi, i have cloned the /system and /data to the secondrom folder, and put a file in /.secondrom/media/.nextboot with the value of 2. But when I restart the phone, it still starts in to the default Rom. Could the problem be, that in the /sbin/init I changed the partitions names mmcblk0p13 and mmcblk0p13 to extra13, and extra16, so that they didn't clash with the partitions already on the note 2. Do u know if the was anything in the source binary or something that needed those partitions with the original name?.
I also changed the minors and majors so that they matched the note 2.

But when I don't put the nextboot file in ".secondrom" the folder /.secondrom in the root of the phone is empty, but when I put the nextboot file with the value of 2, and reboot the phone, the folder /.secondrom has the phone data in it. So it seems like the data is booting right ect, it's just the system that's not booting with the second Rom system.img

So could it be the system.img I put in the sd card isn't functioning correcting "


If I can get the dual boot working, it would only take about 2 min to get it working on the other n2 variants as well, as I think they all have the same partition layout.

Cheers
Corey



Sent from my GT-N7100

If I helped you, please hit Thanks..
My Current Devices:
Galaxy Note II N7100
HTC 8x Windows Phone 8
Samsung Galaxy S2 I9100
Nexus 7


 
garyd9
Old
#24  
garyd9's Avatar
Recognized Developer
Thanks Meter 1875
Posts: 1,836
Join Date: Sep 2006
Location: Pittsburgh, PA
does /sbin/choose_rom exist on your device? It should be a symbolic link to /sbin/busybox... which leads to the question of if /sbin/busybox exists and from where did you get the busybox binary?

This is probably going to be a long and painful thread of questions and answers. It'd probably be easier if you walk through the script, understand what each line does (and why), and work out what SHOULD be happening. It's possible you'll have one of those "oh.. yeah!" moments and find your own issue.

Donations: I don't accept donations, but if you are feeling charitable, help a child by going to http://www.shrinershospitalsforchildren.org/
and click the "Donate Now" link at the top.
 
fishingfon
Old
#25  
fishingfon's Avatar
Senior Member - OP
Thanks Meter 253
Posts: 712
Join Date: Feb 2012
Location: Brisbane, QLD, Australia
Quote:
Originally Posted by garyd9 View Post
does /sbin/choose_rom exist on your device? It should be a symbolic link to /sbin/busybox... which leads to the question of if /sbin/busybox exists and from where did you get the busybox binary?

This is probably going to be a long and painful thread of questions and answers. It'd probably be easier if you walk through the script, understand what each line does (and why), and work out what SHOULD be happening. It's possible you'll have one of those "oh.. yeah!" moments and find your own issue.
Hi,
When I repacked the ramdisk, the choose_rom file was in it, but in /sbin on my phone, it is not showing.
But /sbin/choose_rom is a binary, so I don't think it would show there anyway.

And the busybox binary was already in the ramfs source code.

I have read thru all the scripts already (quite a few times actually) but I still can't figure out why it's giving me my current issue

I will wait and see if gokhan moral has any idea what's wrong.

Thanks
Cheers
Corey

Sent from my GT-N7100

If I helped you, please hit Thanks..
My Current Devices:
Galaxy Note II N7100
HTC 8x Windows Phone 8
Samsung Galaxy S2 I9100
Nexus 7


 
garyd9
Old
#26  
garyd9's Avatar
Recognized Developer
Thanks Meter 1875
Posts: 1,836
Join Date: Sep 2006
Location: Pittsburgh, PA
Quote:
Originally Posted by fishingfon View Post
When I repacked the ramdisk, the choose_rom file was in it, but in /sbin on my phone, it is not showing.
But /sbin/choose_rom is a binary, so I don't think it would show there anyway.
You are insisting that it's a binary, but the github repo you pointed me to shows it as being a symbolic link to /sbin/busybox. (/sbin/busybox would be a binary.)

Your statement about it being a binary and therefore not showing up in /sbin is silly and incorrect. Does /sbin/adbd show there? That's a binary and it shows up. In fact, the script that you posted in the OP relies on /sbin/choose_rom existing. If that doesn't exist, the init script will revert to booting the primary firmware.
Quote:
Originally Posted by fishingfon View Post
I have read thru all the scripts already (quite a few times actually)
(Now I'm going to get on my soapbox) If you had actually read through and understood the init script, you'd understand what I just mentioned and it wouldn't have even occurred to you to think otherwise.

Donations: I don't accept donations, but if you are feeling charitable, help a child by going to http://www.shrinershospitalsforchildren.org/
and click the "Donate Now" link at the top.
 
fishingfon
Old
#27  
fishingfon's Avatar
Senior Member - OP
Thanks Meter 253
Posts: 712
Join Date: Feb 2012
Location: Brisbane, QLD, Australia
Quote:
Originally Posted by garyd9 View Post
You are insisting that it's a binary, but the github repo you pointed me to shows it as being a symbolic link to /sbin/busybox. (/sbin/busybox would be a binary.)

Your statement about it being a binary and therefore not showing up in /sbin is silly and incorrect. Does /sbin/adbd show there? That's a binary and it shows up. In fact, the script that you posted in the OP relies on /sbin/choose_rom existing. If that doesn't exist, the init script will revert to booting the primary firmware.

(Now I'm going to get on my soapbox) If you had actually read through and understood the init script, you'd understand what I just mentioned and it wouldn't have even occurred to you to think otherwise.
Hi,
Look, here is a photo of the choose_rom binary:



There u can see that it's a binary.


The is also loads of other binary files that don't show up in /sbin/ either, so that's why I was saying that it's probably not showing there cos it's a binary.

Cheers
Corey
Sent from my GT-N7100

If I helped you, please hit Thanks..
My Current Devices:
Galaxy Note II N7100
HTC 8x Windows Phone 8
Samsung Galaxy S2 I9100
Nexus 7


 
garyd9
Old
#28  
garyd9's Avatar
Recognized Developer
Thanks Meter 1875
Posts: 1,836
Join Date: Sep 2006
Location: Pittsburgh, PA
Quote:
Originally Posted by fishingfon View Post
Look, here is a photo of the choose_rom binary:
...
There u can see that it's a binary.
I'm sure someone is reading your reply and waiting for me to start flaming you. I'm not going to. At least not yet. (I might get a bit sarcastic, but not too much.)

First, you just showed me a picture of a GUI showing a directory, but didn't mention which directory it is. Second, please don't show me pictures of pretty GUI's. Show me pictures of pretty command lines instead. Actually, I'm not a big fan of pictures to display textual information anyway. Here's what you need to do with your phone connected:
Code:
adb shell
su
ls -l /sbin/choose_rom
If the file is there, it should show as a symbolic link to /sbin/busybox. If it's not a symbolic link or not showing at all, you messed up packing the initramfs.

(BTW, in that picture you included, see that little black arrow in the lower left corner of the icon representing choose_rom? Are you a little curious what that arrow is representing?)

Donations: I don't accept donations, but if you are feeling charitable, help a child by going to http://www.shrinershospitalsforchildren.org/
and click the "Donate Now" link at the top.
The Following 2 Users Say Thank You to garyd9 For This Useful Post: [ Click to Expand ]
 
fishingfon
Old
(Last edited by fishingfon; 28th December 2012 at 05:03 AM.)
#29  
fishingfon's Avatar
Senior Member - OP
Thanks Meter 253
Posts: 712
Join Date: Feb 2012
Location: Brisbane, QLD, Australia
Quote:
Originally Posted by garyd9 View Post
I'm sure someone is reading your reply and waiting for me to start flaming you. I'm not going to. At least not yet. (I might get a bit sarcastic, but not too much.)

First, you just showed me a picture of a GUI showing a directory, but didn't mention which directory it is. Second, please don't show me pictures of pretty GUI's. Show me pictures of pretty command lines instead. Actually, I'm not a big fan of pictures to display textual information anyway. Here's what you need to do with your phone connected:
Code:
adb shell
su
ls -l /sbin/choose_rom
If the file is there, it should show as a symbolic link to /sbin/busybox. If it's not a symbolic link or not showing at all, you messed up packing the initramfs.

(BTW, in that picture you included, see that little black arrow in the lower left corner of the icon representing choose_rom? Are you a little curious what that arrow is representing?)
Hi,
Here is the result from the terminal:

export PATH=/data/local/bin:$PATH
u0_a142@android:/ $ export PATH=/data/local/bin:$PATH
u0_a142@android:/ $ su
1|u0_a142@android:/ # ls -l /sbin/choose_rom
lrwxrwxrwx root root 1970-01-01 10:00 choose_rom -> busybox
u0_a142@android:/ #

That result from the terminal looks correct to me.

And no I never noticed that little black arrow before, as I don't really use the file explorer in Linux. Do u know what it means?, cos I don't.

Thanks


Cheers
Corey
Sent from my GT-N7100

If I helped you, please hit Thanks..
My Current Devices:
Galaxy Note II N7100
HTC 8x Windows Phone 8
Samsung Galaxy S2 I9100
Nexus 7


 
fishingfon
Old
(Last edited by fishingfon; 28th December 2012 at 05:13 AM.)
#30  
fishingfon's Avatar
Senior Member - OP
Thanks Meter 253
Posts: 712
Join Date: Feb 2012
Location: Brisbane, QLD, Australia
Ps,
I just tried booting In to the second Rom again, and I noticed that when I boot in to the second Rom, it boots in to the first Rom still, but all the data from /data also gets mounted in /.secondrom
So it seems that that part of the dual boot is working, but the system img isn't getting mounted or something.

Corey
My Current Devices:
Galaxy Note II N7100
HTC 8x Windows Phone 8
Samsung Galaxy S2 I9100
Nexus 7



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes