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

Search This thread

ketut.kumajaya

Recognized Developer
Apr 28, 2011
4,935
14,138
Bekasi
How do you manage nandroid create/restore of secondrom then?

Gesendet von meinem Note II mit Tapatalk 2
By manipulating block devices.
Code snipped:
Code:
  losetup /dev/block/loop0 /.secondrom/media/.secondrom/system.img
  # Delete /system block device
  rm -f /dev/block/mmcblk0p20
  # Delete /cache block device
  rm -f /dev/block/mmcblk0p19
  # Link /system block device to /dev/block/loop0
  ln -s /dev/block/loop0 /dev/block/mmcblk0p20
  # Link /cache block device to /dev/block/mmcblk0p16
  ln -s /dev/block/mmcblk0p16 /dev/block/mmcblk0p19
My English not good enough to explain, feel free to unpack my PhilZ Touch repack from http://xdaforums.com/showpost.php?p=47342530&postcount=2 . I have no chance to build Android from source before, this limitation has made me creative to reuse existing resource (PhilZ Touch, AROMA, etc).
 

DerTeufel1980

Inactive Recognized Developer
Jul 31, 2011
10,368
27,668
That's enough, but unfortunately not working for us. We don't have enough block devices large enough to have data partition on it.
I need to share default data partition between both roms by bind mounting (Well I could use data.img, but then the size would be fixed, what I don't like)

Edit: what's the size of your p16?

Gesendet von meinem Note II mit Tapatalk 2
 
Last edited:

ketut.kumajaya

Recognized Developer
Apr 28, 2011
4,935
14,138
Bekasi
My solution based on gokhanmoral's solution with different implementation, strictly follow his "rule" but simpler. Used bind mounted /data/media/.secondrom/data as 2nd ROM data storage and hidden partition p16 as /cache partition. My dual boot works on Tab 2 (OMAP4) and Tab 3 8.0 (Exynos 4212), there's no reason not work on another device.
 

DerTeufel1980

Inactive Recognized Developer
Jul 31, 2011
10,368
27,668
I see, but then there is no block device for secondary data. How do you manipulate/nandroid it? (I initially thought you are using hidden part for data)

Gesendet von meinem Note II mit Tapatalk 2
 

ketut.kumajaya

Recognized Developer
Apr 28, 2011
4,935
14,138
Bekasi
Nandroid backup for emulated sdcard device recursive copy /data excluding /data/media, so what the problem? I used scripting mount replacing mount binary for 2nd recovery, always lock /data (/data/media/.secondrom/data actually) for safety. To prevent a bad flashable zip wrong mounting /data partition.
 

kkemp31

Member
Mar 1, 2012
22
0
If you get this to work what's the chance of creating a hijacking at the beginning of booting like safe strap for phones with out unlocked bootloader

Sent from my SCH-I605 using XDA Premium 4 mobile app
 

Top Liked Posts

  • There are no posts matching your filters.
  • 6
    Hi all,

    I am in the process of porting the dual boot ramfs from the Galaxy S3 Siyah kernel to our Note II smartphones.

    I have finished editing the ramfs, and changing the init files ect.
    But the is still two files I have left to edit, and I am a bit stuck on them.

    In the files /sbin/init and /sbin/ueventd the is quite a few references to theses partitions:





    mknod /dev/block/mmcblk0p13 b 179 9
    mknod /dev/block/mmcblk0p16 b 179 12

    the problem is this, on the Galaxy S3 (which is what that ramfs was designed for) those partitions dont exist as far as I can see.
    But on the note 2, those partitions are the /DATA and /SYSTEM partitions.

    So I need to change thoses partitions to something else, but I dont know what.
    I have copied the contents of the two files which thoses partitions are referenced in, and a table showing the Note 2 partitions and the coresponing S3 partitions, below

    Could someone please help me find out what I should do here, as I cant do any more on the dual boot kernel till I get that sorted.

    Here is the question I asked gokhan moral:





    “I have edited all the files in the ramfs, apart from two files.
    In the files /sbin/init and /sbin/ueventd the is 2 partitions referenced thru out them, they are:
    mknod /dev/block/mmcblk0p13 b 179 9
    mknod /dev/block/mmcblk0p16 b 179 12v
    On the Galaxy S3, thoses partition names are un-used (as far as i know)
    But on the Galaxy Note 2, thoses partitions are the /DATA and /SYSTEM partitions.
    can i just change the partition names in thoses 2 files to soemthing like:
    mknod /dev/block/mmcblk0p17 b 179 9
    mknod /dev/block/mmcblk0p18 b 179 12v
    or do i need to do something else to rename thoses two partitions?.”

    And here is Gokhan Morals Response:





    “block devices are created using the major and minor id's specific to your device (those do not change normally but you need to check anyway). so if they are mounted and needed you create them. if they are not needed in the script you don't have to create them. you have to try to keep the same functionality in the script. if you mount /system then you will need the block device that corresponds to /system with the correct major and minor numbers.”

    but I still dont understand what I am supposed to do (I am not really a developer, I am more of a web designer ect)


    Could someone please explain in simpler steps what I should do to rename thoses two partitions.



    Here are the file contents (both files have the same contents, so i have only copied one here)

    INIT:





    #!/sbin/busybox sh
    cd /

    busybox mount -t proc proc /proc
    busybox mount -t sysfs sysfs /sys

    if busybox grep -q 1 /sys/class/power_supply/battery/batt_lp_charging ; then
    # low power mode
    echo 0 > /proc/sys/kernel/rom_feature_set
    cp -a /res/misc/init.41/* /
    chmod 755 /innt
    chmod 644 /*.rc
    chmod 644 /*.prop
    exec /sbin/init2
    fi

    SECONDROM=1
    NOBOOTLOGO=0
    mkdir -p /dev/block
    mkdir /dev/input
    mkdir /dev/graphics
    mknod /dev/graphics/fb0 c 29 0
    mknod /dev/input/event1 c 13 65
    mknod /dev/input/event2 c 13 66
    mknod /dev/input/event8 c 13 72
    mknod /dev/input/event9 c 13 73
    mknod /dev/ashmem c 10 60
    mknod /dev/block/mmcblk0p13 b 179 9
    mknod /dev/block/mmcblk0p16 b 179 12
    mknod /dev/block/loop0 b 7 0

    mkdir /mnt
    chmod 755 /mnt
    mkdir /.secondrom
    mount -t ext4 /dev/block/mmcblk0p16 /.secondrom

    NEXTBOOT=`cat /.secondrom/media/.nextboot`
    rm -f /.secondrom/media/.nextboot
    DEFAULTROM=`cat /.secondrom/media/.defaultrom`

    if grep -q bootmode=2 /proc/cmdline ; then
    NEXTBOOT=0
    fi

    if [ "$NEXTBOOT" == "0" ]; then
    mv -f /res/etc /
    umount /.secondrom
    echo 0 > /proc/sys/kernel/rom_feature_set
    mv -f /res/misc/init.41/* /
    mv -f /res/misc/recovery/* /
    chmod 755 /innt
    chmod 644 /*.smdk4x12
    chmod 644 /*.rc
    chmod 644 /*.prop
    chmod -R 755 /lib
    exec /sbin/init2
    fi

    SECONDROM=1
    NOBOOTLOGO=0
    [ -f /.secondrom/media/.secondrom/system.img ] || SECONDROM=0
    [ -f /.secondrom/media/.nobootlogo ] && NOBOOTLOGO=1

    if [ "$SECONDROM" == "0" ];then
    if [ "$NOBOOTLOGO" == "0" ];then
    /sbin/choose_rom $SECONDROM
    fi
    else
    if [ "$NEXTBOOT" == "1" ];then
    SECONDROM=0;
    elif [ "$NEXTBOOT" == "2" ];then
    SECONDROM=1;
    else
    if [ "$NOBOOTLOGO" == "1" ];then
    SECONDROM=$DEFAULTROM
    elif [ "$DEFAULTROM" == "1" ];then
    /sbin/choose_rom $SECONDROM
    if [ "$?" == "1" ]; then
    SECONDROM=0
    else
    SECONDROM=1
    fi
    else
    /sbin/choose_rom $SECONDROM
    if [ "$?" == "1" ]; then
    SECONDROM=1
    else
    SECONDROM=0
    fi
    fi
    fi
    fi

    if [ "$SECONDROM" == "1" ]; then
    mount -t ext4 /.secondrom/media/.secondrom/system.img /system
    else
    mount -t ext4 /dev/block/mmcblk0p13 /system
    fi


    AOSP=0
    MIUI=0
    CM10=0
    JB=0

    [ -f /system/framework/framework2.jar ] || AOSP=1
    [ -f /system/framework/miui-framework.jar ] && MIUI=1
    [ -f /system/lib/ssl/engines/libkeystore.so ] && JB=1
    [ -f /system/framework/seccamera.jar ] || CM10=1

    if [ "$JB" == 1 ];
    then
    if [ "$CM10" == 1 ];
    then
    echo 3 > /proc/sys/kernel/rom_feature_set
    mv -f /lib/modules/dhd_cm.ko /lib/modules/dhd.ko
    mv -f /res/misc/init.cm10/* /
    else
    echo 2 > /proc/sys/kernel/rom_feature_set
    mv -f /res/misc/init.41/* /
    fi
    fi

    if [ "$SECONDROM" == "1" ];then
    mv /init.smdk4x12.rc.2 /init.smdk4x12.rc
    mv /init.rc.2 /init.rc
    mv /fstab.smdk4x12.2 /fstab.smdk4x12
    else
    rm -f /init.rc.2 /init.smdk4x12.rc.2 /fstab.smdk4x12.2
    fi

    umount -f /system
    umount -f /.secondrom

    rm -rf /res/misc/init*
    chmod 755 /innt
    chmod 644 /*.smdk4x12
    chmod 644 /*.rc
    chmod 644 /*.prop
    chmod -R 755 /lib

    # misc mods for i9300
    insmod /lib/modules/m0_mods.ko
    # cpu undervolting interfaces
    insmod /lib/modules/cpu_undervolting.ko
    # mali (gpu) interfaces
    insmod /lib/modules/mali_control.ko
    # additional CPU governors
    insmod /lib/modules/cpufreq_hotplug.ko
    insmod /lib/modules/cpufreq_lulzactiveq.ko
    # additional I/O schedulers
    insmod /lib/modules/sio-iosched.ko
    insmod /lib/modules/vr-iosched.ko
    # audio enhancements
    insmod /lib/modules/kscoobydoo.ko devicename=scoobydoo_sound

    exec /sbin/init2


    And here is the partition layouts:





    PARTITION: ` Galaxy S3 Galaxy Note 2
    /BOOT mmcblk0p5 mmcblk0p8
    /BOTA0 mmcblk0p1 mmcblk0p1
    /BOTA1 mmcblk0p2 mmcblk0p2
    /CACHE mmcblk0p8 mmcblk0p12
    /EFS mmcblk0p3 mmcblk0p3
    /HIDDEN mmcblk0p10 mmcblk0p14
    /OTA mmcblk0p11 mmcblk0p15
    /PARAM mmcblk0p4 mmcblk0p7
    /RADIO mmcblk0p7 mmcblk0p10
    /RECOVERY mmcblk0p6 mmcblk0p9
    /SYSTEM mmcblk0p9 mmcblk0p13
    /TOMBSTONES unknown mmcblk0p11
    /USERDATA mmcblk0p12 mmcblk0p16

    I think i copied thoses partitions right from my pc, but i may have got one mixed up or something



    Please can someone help, as i have been searching for days, and asking lots of different people on xda, but no response

    Thanks in advance

    Cheers
    Corey
    5
    Any success bro? Lot of people looking forward to this :)!

    Hi,
    I have been busy studying for university, and Microsoft exams, and I have been packing to move back to England in 3 weeks, and I have had some websites that I was building that needed finishing for people, so I haven't been able to do any of The kernel the last week or two.
    Also I have had to rebuild my PC.

    The kernel is still freezing on boot up of the second ROM.
    But I have found some lines of code in the ftab.2 and init.2 files in /sbin/misc/init.41 that could be causing the problem, and I will try changing them as soon as I get time.

    But its all very hectic here at the moment, and my WiFi and speaker on my note 2 have broken, so I also need to send it to a service center aswell. So I don't know when I will be able to get round to it, but I will try as soon as I can.

    Cheers
    Corey Bacon

    Sent from my GT-N7100

    If I helped you, please hit Thanks..
    4
    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..
    4
    Hi,
    Yes i didnt think of that, i will try that later.
    Thanks

    Corey






    Hi,
    Yes I found out what the contents of choose_ROM is, and its a symbolic link to busy box.
    But I can't find anything wrong with the choose ROM thing ect.

    I fixed the first problem of not being able to select the second ROM on boot, but now I have a new problem.
    When I boot The phone up, with the value of 2 in .nextboot, and select the second ROM, the second ROM trys to boot, but it freezes as soon as I select the second ROM.

    I am thinking something might be wrong with my second system.img
    Cos I created a 1gb ext4 system img, and placed it in /data/media/.secondrom
    But when I clone the second ROM to it, instead of using the 1gb of space already created, it seems to try and expand the system img, so if I clone a 500mb ROM to the IMG the system IMG will expand to 1.5gb.

    I know the second system.img is getting mounted, cos if I leave the img empty, the phone will loop on the choose rom screen, but if I put a system.img with a cloned rom, the choose ROM screen freezes when it trys to boot the second rom.
    I really need someone with a s3 to install a n2 ROM with the s3 update script etc as there second rom, and then send me the system.IMG but I can't seem to find anyone :(

    Cheers
    Corey



    Sent from my GT-N7100

    If I helped you, please hit Thanks..

    I can do this, but it won't be until Sunday. I need my phone all through most the weekend. Toss me some links and I'll get on it either Saturday night or Sunday daytime.
    3
    Ok the last 5-10 post are very confusing....do I understand right that you have dualboot working

    It was easier for me to understand the code you was posting and my development skills are limited to mainly apps

    Sent from my GT-N7100 using xda app-developers app

    Hi,
    No I haven't got dual boot working yet.
    I am editing some things in various fstabs and init files, and I will test it soon hopefully.
    The second ROM still freezes on boot at the moment.

    Cheers
    Corey

    Sent from my GT-N7100

    If I helped you, please hit Thanks..