Post Reply

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

24th December 2012, 12:27 AM   |  #11  
fishingfon's Avatar
OP Senior Member
Flag Brisbane, QLD, Australia
Thanks Meter: 253
 
712 posts
Join Date:Joined: Feb 2012
More
Quote:
Originally Posted by garyd9

What I'm NOT seeing is the mmcblk0p13 and mmcblk0p16 devices that are supposedly made by the init script on the dual boot s3. Any idea why not?

Hi,
No I have no idea :P

Also I can't find anything in the script about the 3 devices that are made, so i have absolutely no idea.

I asked Gokhan moral about them, and here is my message and then his:

" Hi,
I have spent the last day or two trying to figure out how to change the names of theses partitions that are referenced in /sbin/init
mknod /dev/block/mmcblk0p13 b 179 9
mknod /dev/block/mmcblk0p16 b 179 12

But well I was doing that (I still haven't worked it out :P). I noticed that when the dual boot is installed on a galaxy S3, the is 3 extra devices in dev/block
they are:
brw------- root root 179, 16 2012-12-22 12:53 mmcblk0boot0
brw------- root root 179 32 2012-12-22 12:53 mmcblk0boot1
7 1 1572864 loop1

I have already been thru the scripts lots of times, and I never noticed any partitions named this. I was just wondering if you could explain what files theses partitions are referenced in?. as I cant find them anywhere."

And here is his response:

" They are not referenced in any of my modifications because they are not needed for any of my customizations. I only create devices that I want to mount and mount them to some directories and try to understand the rom type. Once I get the rom type I initialize the corresponding init sequence by moving init files to the original location, move innt to init and exec it. That is all and there is no more in those scripts. Now try to read them once again and try to map my descriptions to that script. When I say init script I mean the symbolic link from /init to /sbin/init. "

Do u have any idea what I should do?, as i am a bit stuck :P


Thanks

Cheers
Corey


Sent from my GT-N7100
24th December 2012, 03:24 AM   |  #12  
garyd9's Avatar
Recognized Developer
Flag Pittsburgh, PA
Thanks Meter: 1,984
 
1,951 posts
Join Date:Joined: Sep 2006
Okay...

First, the mmc*boot? device nodes are for the boot loaders - please ignore those device nodes. Act like they don't exist. Don't mess with them. Ever. If there's one way to brick a samsung phone, it's by messing up the bootloaders. (Thanks to people like Adam Outler, you might still be able to recover, but only via hardware tinkering.)

So, let's back up and not be concerned about what the device nodes are named, but more concerned about what the device nodes are USED FOR (in relation to dual booting.) If I'm correct, you really aren't concerned about those device node names, but are more concerned about getting the dual boot working.

Is that init script in the OP unmolested? The reason I'm asking is that parts of it aren't making sense to me. For example, it's mounting the /system directory either via an image file OR from mmcblk0p13. However, you've stated that the SGS3 has the SYSTEM partition on mmcblk0p9. It almost appears as if you (or someone else) might have started editing the init script to make it work with a device that has the system partition on p13 (such as the note2.) That would also match with the fact that p16 on the Note2 is the data (userdata) partition...

Actually, that might be exactly what's going on here. The mknod parameters are creating device nodes to the existing p9/p12 partitions, but giving them different names that just happen to match the names used on the Note2...

You could, in theory, do something similar to what you suggested in your OP, but you'd need to do it a bit differently.... Instead of making device nodes with unused names and minors of 9/12, you'd want to use unused names and minors of 13 and 16. Let me explain...

Here is the code you said was in the sgs3 init script (along with comments followed by "//")
Code:
mknod /dev/block/mmcblk0p13 b 179 9 // creates a device node called p13 but is identical to p9
mknod /dev/block/mmcblk0p16 b 179 12 // creates a device node called p16 but is identical to p12
So, in your init script, /dev/block/mmcblk0p13 is referencing the EXACT SAME DEVICE as /dev/block/mmcblk0p9 (and the same for the created p16 device and the already existing p12 device.)

Wow, I really hope that not only am I making sense, but also that you are following me. I'm going to start rambling even more.

You kind of have to understand how device nodes work, etc. The NAME of the device node doesn't matter. What matters is if it's a block or character device, the MAJOR number and the MINOR number. For block types of MAJOR 179, it's referring to a MMC device. For block/MMC (b 179). the minor number specifies the partition of the device. (I'm simplifying here - it's actually a masked value that includes a partition and device - and gets more interesting with > 16 partitions that require different majors)

So, you could (in theory) go into that script that works fine on the sgs3 and rename every occurrence of "mmcblk0p16" with "i_like_sex" and it'll still work on the sgs3 (even if you didn't like sex.)

Okay... so back to the script. Keep in mind that I'm basing EVERYTHING on that one script and haven't seen anything else related to this multi-boot thing. It'd probably help if someone gave me a link (I'm too lazy to search) to something that installs this multi-boot stuff.

Anyway, that script. I'm going to do something here for clarity. Instead of referencing the misleading "mmcblk0p13" and "mmcblk0p16" device node nodes, I'm just going to call them "extra13" and "extra16" (because they are NOT referencing partitions 13/16.)

So, in that script, extra13 is actually pointing to partition9 which (based on your information) is the SYSTEM partition (mmcblk0p9) and extra16 is actually pointing to partition12 which (again based on your info) is the USERDATA partition.

In other words, extra13 is pointing to what is normally mounted as "/system" and extra16 is pointing to what is normally mounted as "/data". However, at least for getting the dual boot stuff kick started, it's mounting extra16 in "/.secondrom" instead of "/data".

THAT should be enough information to get you going towards solving your issue.

Personally, I think that whoever decided to use mmcblk0p13 and mmcblk0p16 as fictional device node names on the sgs3 should be thumped in the head for either intentionally or unintentionally creating confusion. It might be due to one of the other dependencies of the dual booting system (what is "/sbin/choose_rom"?) that they were unwilling (or unable) to fix. It might also just be a way to try and make the stuff a pain to port. I don't know their intentions/motives.

I will offer this: If my explanation didn't make sense, you might want to take a few steps back and learn what all of it means before you keep going with the porting effort. Some of the concepts here are important to know, and some basic understanding of device nodes is important when mounting file systems.

Take care
Gary
24th December 2012, 07:28 AM   |  #13  
fishingfon's Avatar
OP Senior Member
Flag Brisbane, QLD, Australia
Thanks Meter: 253
 
712 posts
Join Date:Joined: Feb 2012
More
Quote:
Originally Posted by garyd9

Okay...

First, the mmc*boot? device nodes are for the boot loaders - please ignore those device nodes. Act like they don't exist. Don't mess with them. Ever. If there's one way to brick a samsung phone, it's by messing up the bootloaders. (Thanks to people like Adam Outler, you might still be able to recover, but only via hardware tinkering.)

So, let's back up and not be concerned about what the device nodes are named, but more concerned about what the device nodes are USED FOR (in relation to dual booting.) If I'm correct, you really aren't concerned about those device node names, but are more concerned about getting the dual boot working.

Is that init script in the OP unmolested? The reason I'm asking is that parts of it aren't making sense to me. For example, it's mounting the /system directory either via an image file OR from mmcblk0p13. However, you've stated that the SGS3 has the SYSTEM partition on mmcblk0p9. It almost appears as if you (or someone else) might have started editing the init script to make it work with a device that has the system partition on p13 (such as the note2.) That would also match with the fact that p16 on the Note2 is the data (userdata) partition...

Actually, that might be exactly what's going on here. The mknod parameters are creating device nodes to the existing p9/p12 partitions, but giving them different names that just happen to match the names used on the Note2...

You could, in theory, do something similar to what you suggested in your OP, but you'd need to do it a bit differently.... Instead of making device nodes with unused names and minors of 9/12, you'd want to use unused names and minors of 13 and 16. Let me explain...

Here is the code you said was in the sgs3 init script (along with comments followed by "//")

Code:
mknod /dev/block/mmcblk0p13 b 179 9 // creates a device node called p13 but is identical to p9
mknod /dev/block/mmcblk0p16 b 179 12 // creates a device node called p16 but is identical to p12
So, in your init script, /dev/block/mmcblk0p13 is referencing the EXACT SAME DEVICE as /dev/block/mmcblk0p9 (and the same for the created p16 device and the already existing p12 device.)

Wow, I really hope that not only am I making sense, but also that you are following me. I'm going to start rambling even more.

You kind of have to understand how device nodes work, etc. The NAME of the device node doesn't matter. What matters is if it's a block or character device, the MAJOR number and the MINOR number. For block types of MAJOR 179, it's referring to a MMC device. For block/MMC (b 179). the minor number specifies the partition of the device. (I'm simplifying here - it's actually a masked value that includes a partition and device - and gets more interesting with > 16 partitions that require different majors)

So, you could (in theory) go into that script that works fine on the sgs3 and rename every occurrence of "mmcblk0p16" with "i_like_sex" and it'll still work on the sgs3 (even if you didn't like sex.)

Okay... so back to the script. Keep in mind that I'm basing EVERYTHING on that one script and haven't seen anything else related to this multi-boot thing. It'd probably help if someone gave me a link (I'm too lazy to search) to something that installs this multi-boot stuff.

Anyway, that script. I'm going to do something here for clarity. Instead of referencing the misleading "mmcblk0p13" and "mmcblk0p16" device node nodes, I'm just going to call them "extra13" and "extra16" (because they are NOT referencing partitions 13/16.)

So, in that script, extra13 is actually pointing to partition9 which (based on your information) is the SYSTEM partition (mmcblk0p9) and extra16 is actually pointing to partition12 which (again based on your info) is the USERDATA partition.

In other words, extra13 is pointing to what is normally mounted as "/system" and extra16 is pointing to what is normally mounted as "/data". However, at least for getting the dual boot stuff kick started, it's mounting extra16 in "/.secondrom" instead of "/data".

THAT should be enough information to get you going towards solving your issue.

Personally, I think that whoever decided to use mmcblk0p13 and mmcblk0p16 as fictional device node names on the sgs3 should be thumped in the head for either intentionally or unintentionally creating confusion. It might be due to one of the other dependencies of the dual booting system (what is "/sbin/choose_rom"?) that they were unwilling (or unable) to fix. It might also just be a way to try and make the stuff a pain to port. I don't know their intentions/motives.

I will offer this: If my explanation didn't make sense, you might want to take a few steps back and learn what all of it means before you keep going with the porting effort. Some of the concepts here are important to know, and some basic understanding of device nodes is important when mounting file systems.

Take care
Gary

Hi,
Thanks for your reply, i think i uderstand what i need to do.
Just to be sure tho (i would rather not brick my phone if i dont have to ), is this what u think i should do?:

Change these lines:
Code:
mknod /dev/block/mmcblk0p13 b 179 9
mknod /dev/block/mmcblk0p16 b 179 12
To:
Code:
mknod /dev/block/extra13 b 179 13
mknod /dev/block/extra16 b 259 0
Cos if u look at the Minor and majors for the data partition (p16) u see that they have thoses ids:
Code:
 
 u0_a160@android:/ # ls -l /dev/block/mmc*
 brw------- root     root     179,   0 2012-12-22 08:35 mmcblk0
 brw------- root     root     179,   1 2012-12-22 08:35 mmcblk0p1
 brw-rw---- system   radio    179,  10 2012-12-22 08:35 mmcblk0p10
 brw-rw---- system   radio    179,  11 2012-12-22 08:35 mmcblk0p11
 brw------- root     root     179,  12 2012-12-22 08:35 mmcblk0p12
 brw------- root     root     179,  13 2012-12-22 08:35 mmcblk0p13
 brw------- root     root     179,  14 2012-12-22 08:35 mmcblk0p14
 brw------- root     root     179,  15 2012-12-22 08:35 mmcblk0p15
 brw------- root     root     259,   0 2012-12-22 08:35 mmcblk0p16
 brw------- root     root     179,   2 2012-12-22 08:35 mmcblk0p2
 brw------- root     root     179,   3 2012-12-22 08:35 mmcblk0p3
 brw-rw---- system   radio    179,   4 2012-12-22 08:35 mmcblk0p4
 brw-rw---- system   radio    179,   5 2012-12-22 08:35 mmcblk0p5
 brw-rw---- system   radio    179,   6 2012-12-22 08:35 mmcblk0p6
 brw-rw---- system   root     179,   7 2012-12-22 08:35 mmcblk0p7
 brw------- root     root     179,   8 2012-12-22 08:35 mmcblk0p8
 brw------- root     root     179,   9 2012-12-22 08:35 mmcblk0p9
 brw------- root     root     179,  16 2012-12-22 08:35 mmcblk1
 brw------- root     root     179,  17 2012-12-22 08:35 mmcblk1p1

Does that look right to you?.

Here are the links to the dual boot kernel:
Here is the link to the ramfs i used to edit:
https://github.com/gokhanmoral/ramfs-sgs3
Here is the full kernel source code:
https://github.com/gokhanmoral/siyahkernel-sgs3
Here is the Completed kernel for the S3:
http://www.gokhanmoral.com/

the init scipt i sent was completely un-molested. it came from the source code provided by gokhanmoral, and it hadnt been edited or anything.

Thanks again for your help.

Cheers
Corey
24th December 2012, 07:30 PM   |  #14  
garyd9's Avatar
Recognized Developer
Flag Pittsburgh, PA
Thanks Meter: 1,984
 
1,951 posts
Join Date:Joined: Sep 2006
It looks okay... obviously you'll have to change the script and perhaps some other stuff. I can't download the linked stuff right now (I'm on my phone) but will look more later.

Sent from my SAMSUNG-SGH-I317 using Tapatalk 2
24th December 2012, 10:35 PM   |  #15  
fishingfon's Avatar
OP Senior Member
Flag Brisbane, QLD, Australia
Thanks Meter: 253
 
712 posts
Join Date:Joined: Feb 2012
More
Quote:
Originally Posted by garyd9

It looks okay... obviously you'll have to change the script and perhaps some other stuff. I can't download the linked stuff right now (I'm on my phone) but will look more later.

Sent from my SAMSUNG-SGH-I317 using Tapatalk 2

Ok thanks. So do u mean I need to change the partition layout on all the scripts, and change any reference of thoses partitions mentioned earlier?. Or do u mean something else?.
Gokhan moral said I just needed to change the partition layout, and try it and see if it boots, and if it doesn't I can play around with the init file to try
And get it booting (he also said he would give me a copy of his modded recovery which has all the dual boot options if I get the dual boot booting via adb )

Thanks again
Cheers
Corey

Sent from my GT-N7100

If I helped you, please hit Thanks..
Last edited by fishingfon; 25th December 2012 at 03:38 AM.
26th December 2012, 03:24 AM   |  #16  
garyd9's Avatar
Recognized Developer
Flag Pittsburgh, PA
Thanks Meter: 1,984
 
1,951 posts
Join Date:Joined: Sep 2006
Quote:
Originally Posted by fishingfon

Ok thanks. So do u mean I need to change the partition layout on all the scripts, and change any reference of thoses partitions mentioned earlier?. Or do u mean something else?.

You'd have to change the references to the device nodes in the scripts (and anything else that might use device nodes that reference sgs3 partitions.)

take care
Gary
26th December 2012, 03:54 AM   |  #17  
fishingfon's Avatar
OP Senior Member
Flag Brisbane, QLD, Australia
Thanks Meter: 253
 
712 posts
Join Date:Joined: Feb 2012
More
Quote:
Originally Posted by garyd9

You'd have to change the references to the device nodes in the scripts (and anything else that might use device nodes that reference sgs3 partitions.)

take care
Gary

Hi,
Yes I have already done that, although I will go thru all the scripts again to check I haven't missed one before I repack the ramdisk.

Thanks

Cheers
Corey

Sent from my GT-N7100

If I helped you, please hit Thanks..
27th December 2012, 05:20 AM   |  #18  
fishingfon's Avatar
OP Senior Member
Flag Brisbane, QLD, Australia
Thanks Meter: 253
 
712 posts
Join Date:Joined: Feb 2012
More
Great news, I just flashed the kernel, and it didn't brick my phone .
The first rom booted fine, with the only bug being that the external sd doesn't work (but i know what i did wrong with that).
I have cloned the data to the second rom system img, but i am still figuring out how to boot in to the second rom, as the one boot user promt doesn't work without the custom dual boot recovery (i think)

Corey

Sent from my GT-N7100

If I helped you, please hit Thanks..
The Following 4 Users Say Thank You to fishingfon For This Useful Post: [ View ]
27th December 2012, 04:42 PM   |  #19  
garyd9's Avatar
Recognized Developer
Flag Pittsburgh, PA
Thanks Meter: 1,984
 
1,951 posts
Join Date:Joined: Sep 2006
Quote:
Originally Posted by fishingfon

If I helped you, please hit Thanks..

What would be more helpful is for you to post not only that you've had successes, but also to post the details of those successes to share with the community. What did you have to change with the scripts, what does the end result look like, etc.

It's annoying to see "I got it working" posts without details of HOW a person got it working. As well, the details will help the next person who tries to port it to another platform.

Take care
Gary
27th December 2012, 04:50 PM   |  #20  
fishingfon's Avatar
OP Senior Member
Flag Brisbane, QLD, Australia
Thanks Meter: 253
 
712 posts
Join Date:Joined: Feb 2012
More
Quote:
Originally Posted by garyd9

What would be more helpful is for you to post not only that you've had successes, but also to post the details of those successes to share with the community. What did you have to change with the scripts, what does the end result look like, etc.

It's annoying to see "I got it working" posts without details of HOW a person got it working. As well, the details will help the next person who tries to port it to another platform.

Take care
Gary

Hi,
I haven't finished getting it working yet, as only the first Rom is booting, i am still setting up the ext4 images ect for the second rom. i didn't really see much point in writing what u said till I had got the actual dual boot working. But when I have got the dual boot working I will write what u said.

Cheers
Corey

Sent from my GT-N7100

If I helped you, please hit Thanks..

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes