[TOOL][WIN,LIN,AND,DARW] Super image tools | extract or make partitions RW in super partition

Search This thread

munjeni

Senior Member
Jun 2, 2011
9,305
21,927
Yeah it works on my device.
But the original magisk img that you would get if you flash magisk on the boot.img with the app doesn't work. The provided magisk img was already repacked with android image kitchen as stated by the uploader https://github.com/topjohnwu/Magisk/issues/3752#issuecomment-814410901
Hi, I'm made new repack with the right tools.

This is repacked and fstab modified -> https://easyupload.io/27e8zp
This one is repacked without any modification -> https://easyupload.io/xa4lnb

If you get it working with modified fstab try superrepack tool and let me know!
 
Last edited:
  • Like
Reactions: lebigmac

pandavova

Senior Member
  • Feb 9, 2016
    116
    16
    I'm expected this! And I'm wasted my time for what??
    I'm sorry, I just got home, I was busy yesterday. Will flash the images now.

    Edit:
    The unmodified.img booted without problems.
    The repacked.img booted too!
    I executed the script 4 times in total, after the 3 time, the log didn't change.
    I synced, rebooted and the phone is stuck at the Sony logo.

    Btw, should I sync in the adb shell after every script run or just one time at the end?
     
    Last edited:

    munjeni

    Senior Member
    Jun 2, 2011
    9,305
    21,927
    Ok, you should sync after every run, but I think problem is not sync but something which I am unable to figure out & I don't owning phone with android 11 and super partition to test the things so this is hard for me to figure out. I dodn't know realy, have no idea
     

    munjeni

    Senior Member
    Jun 2, 2011
    9,305
    21,927
    Do you can somehow catch lastlog (bootloop log)? Don't ask how I don't know, maybe cat /proc/last_kmsg ? Or if you have something in /data/tombstones folder?
     
    • Haha
    Reactions: pandavova

    pandavova

    Senior Member
  • Feb 9, 2016
    116
    16
    I just found out my phone has a OrangeFox Recovery Port, never knew about OrangeFox, used only CWM and TWRP. Looks like data is decrypted (my phone is still in the bootloop state), without formating data, I will test soon if thats because of your boot img or because of something else.
     
    • Like
    Reactions: munjeni

    munjeni

    Senior Member
    Jun 2, 2011
    9,305
    21,927
    There is also some logs which might help too, for example logs which is keept inside trim area partition on every boot, maybe you get me your trim area dump via pm?
     

    munjeni

    Senior Member
    Jun 2, 2011
    9,305
    21,927
    I just found out my phone has a OrangeFox Recovery Port, never knew about OrangeFox, used only CWM and TWRP. Looks like data is decrypted (my phone is still in the bootloop state), without formating data, I will test soon if thats because of your boot img or because of something else.
    Maybe encryption is problem here? Maybe things work when phone is not encrypted?
     
    You say screen? I told that on the first post that "stop" command must be sent to device before use our tool! When you do "stop" device get into black screen and all activity is stopped, but since you say that your device flashed-blinked thats indication that you didn't folow command from the first post. Version 15 is out, you should use 15 instead of 14. Further without logs and I not going to waste my time!
    I did use stop, and there was no way to retrieve a log. The screen went black, and was flashing like the backlight was flickering. For two hours it did this. Upon forcing a power down, it wouldn't boot. Not like a brick, literally without holding volume down to get to the bootloader, it would not do a thing. On my g stylus, rip, it somehow separated it self from the encrypted files, so it wouldn't boot to anything and getting to twrp, it sat there in twrp screen but adb was accessible, all I could see was encryptions for everything. But I'm back up, second time around is a lot more noticable what has changed with Android 10.
    Again I couldn't get a log i had to fastboot flash the rom at which point I did flash vbmeta with flags disable-verity and verification, but that didn't even with. I have the rom and a flash.bat file setup to do it automatically if anybody wants to try.
    But I'm ready for another round
     
    You say screen? I told that on the first post that "stop" command must be sent to device before use our tool! When you do "stop" device get into black screen and all activity is stopped, but since you say that your device flashed-blinked thats indication that you didn't folow command from the first post. Version 15 is out, you should use 15 instead of 14. Further without logs and I not going to waste my time!
    Is 15 ran multiple times like 13 and 14?
     
    If there are clone errors, then of course several times until the errors go away.
    ok good sir, i am officially calling timeout. flashed 15 3 times. errors fading to just each partition, 6. No errors in logcat which ran the whole time. upon hitting no errors, i ran syncand then reboot, not boot stuck at first screen after bootloader warning, had to reflash, but i did fgure 3 things out.
    1. We are trying to convert everything on encrypted device, thats why it bricks.
    2. We are attempting to change partitions that are not needed to be rw, and actually throws errors no matter what we enable/disable and in turn prevents change
    3. i do have dm-verity and verification disabled. i flashed the vbmeta with the --disable-verity-disable-verification.
    what i would like to try, even if its a super secret version of the script, that allows us to choose the mounts to be rw/ro. like 1= /, 2=/system, ect.... pick and choose, one of the partiontions is leaving phone bricked by kicking the user out and keeping the encrypted device files.

    your script tho in the end was successful everything was rw.

    Update. Twrp is up and running, said screw it after a dead phone wouldnt get past boot screen, havent ran script since reflashing entire rom, yet it seems to have survived the formating and erasing and flashing....weird but hey i can see what happens and better what happened for failures of past
     
    Last edited:

    munjeni

    Senior Member
    Jun 2, 2011
    9,305
    21,927
    I have no idea, but I have hope that somebody with some experience get involved here. You say you can't catch log? Try adb! Log is inside adb window! And you can pull seccond log from /data/local/tmp with command:

    adb pull /data/local/tmp/script.log
     

    munjeni

    Senior Member
    Jun 2, 2011
    9,305
    21,927
    I have no idea, but I have hope that somebody with some experience get involved here. You say you can't catch log? Try adb! Log is inside adb window! And you can pull seccond log from /data/local/tmp with command:

    adb pull /data/local/tmp/script.log

    You no need screen for it!

    Thats first step for things figuration. Seccond step would be catching kernel last_kmsg log (bootloop log) if possible, probably not possible. Third step (if seccond step fail) would be disasembling phone (at least it would be in my stile) finding out uart ports and making connection for debuging, more info how it looks e.g. on Sony -> https://developer.sony.com/develop/open-devices/guides/access-uart-ports Without booloop log we can't figure out why device not boot. One should make custom kernel for it e.g. compile custom kernel with enabled LAST_KMSG, in that case last_kmsg can be catched after every unsucesfull boot e.g. your boot fail, next boot you boot recovery and catch last_log, just idea. I will not waste my time with "how can I do it", what I need is 1. superrepack logs (main window log + script.log) and 2. in case superrepack logs is clean and without errors but device not boot I will need last_kmsg, there is no other way for me to figure out things.
     
    Last edited:
    ok good sir, i am officially calling timeout. flashed 15 3 times. errors fading to just each partition, 6. No errors in logcat which ran the whole time. upon hitting no errors, i ran syncand then reboot, not boot stuck at first screen after bootloader warning, had to reflash, but i did fgure 3 things out.
    1. We are trying to convert everything on encrypted device, thats why it bricks.
    2. We are attempting to change partitions that are not needed to be rw, and actually throws errors no matter what we enable/disable and in turn prevents change
    3. i do have dm-verity and verification disabled. i flashed the vbmeta with the --disable-verity-disable-verification.
    what i would like to try, even if its a super secret version of the script, that allows us to choose the mounts to be rw/ro. like 1= /, 2=/system, ect.... pick and choose, one of the partiontions is leaving phone bricked by kicking the user out and keeping the encrypted device files.

    your script tho in the end was successful everything was rw

    I have no idea, but I have hope that somebody with some experience get involved here. You say you can't catch log? Try adb! Log is inside adb window! And you can pull seccond log from /data/local/tmp with command:

    adb pull /data/local/tmp/script.log

    You no need screen for it!

    Thats first step for things figuration. Seccond step would be catching kernel last_kmsg log (bootloop log) if possible, probably not possible. Third step (if seccond step fail) would be disasembling phone (at least it would be in my stile) finding out uart ports and making connection for debuging, more info how it looks e.g. on Sony -> https://developer.sony.com/develop/open-devices/guides/access-uart-ports Without booloop log we can't figure out why device not boot. One should make custom kernel for it e.g. compile custom kernel with enabled LAST_KMSG, in that case last_kmsg can be catched after every unsucesfull boot e.g. your boot fail, next boot you boot recovery and catch last_log, just idea. I will not waste my time with "how can I do it", what I need is 1. superrepack logs (main window log + script.log) and 2. in case superrepack logs is clean and without errors but device not boot I will need last_kmsg, there is no other way for me to figure out things.
    Here is the last one, as i said no errors, adb log, logcat and dmesg all froze as soon as my phone did. no errors. as a matter after i flashed, it wass stuck on motirola m screen, got it back with rw after a fresh install after the freeze all but magisk folders and it looks like boot partitions but i got rw where it counts
     

    Attachments

    • script.log
      2.6 KB · Views: 4
    • mount.txt
      7 KB · Views: 2

    munjeni

    Senior Member
    Jun 2, 2011
    9,305
    21,927
    got it back with rw after a fresh install after the freeze all but magisk folders and it looks like boot partitions but i got rw where it counts
    You just reflashed and rw stayed? Thats strange! I don't know whats going on with motorola devices but this might be isue -> https://forum.xda-developers.com/t/...s-rw-in-super-partition.4120963/post-84936075 -> FEC!

    Also some reports about motorola fec isues -> https://forum.xda-developers.com/t/...-dirty-port-for-g7-play.3947205/post-81989031
     
    Last edited:

    Top Liked Posts

    • There are no posts matching your filters.
    • 1
      Sde28 I'll find out, my super is sde26 I'm thinking that's the roll back or if possible another slot, b perhaps.
      But let me see what I can find out
      You can do it with:

      ls -l /dev/block/bootdevice/by-name
    • 27
      Disclaimer:

      Super image tools was made for testing and educational purposes, ME is not responsible for what you do on/with your device using our tools, you must agree that you using our tools on your own risk, I am not responsible for anything else!


      How to use superunpack:

      - First step, unpack super.sin using my tool or use @IgorEisberg unsin tool
      - Step two, Superunpack. On windows just drag and drop unpacked super image onto our exe to start extraction. Also you can use it from command line, from script or from etc. On Linux use it from command line. No need to set slot like it was a case on lpunpack, our tool will auto extract all slot images for you, enjoy!
      - If you need to unpack partition images in RW mode add parameter 1 at the end of command line e.g. "superunpack super.img 1", than resize partition using resize2fs, repair and unshare blocks using e2fsck. Or if you unpack without rw you no need to resize or repair it, just mount it ro.

      Note that, superunpack is a tool for extract all logical partitions from super image or directly from super partition.

      How to use superrepack:

      adb push superrepack.arm64_pie /data/local/tmp
      adb shell
      su
      cd /data/local/tmp
      mv superrepack.arm64_pie superrepack
      chmod 755 superrepack
      stop
      ./superrepack /dev/block/bootdevice/by-name/super system_a
      sync
      reboot

      Note that, superrepack is a tool to convert logical RO partitions iside your phone super partition to RW mode. In this example system_a partiton is converted to the rw mode, if you need other partitions to rw just change system_a argument. Or if you need all partitions to rw mode do it without partition rw argumet e.g: "./superrepack /dev/block/bootdevice/by-name/super". YOU MUST RUN TOOL 4-5 TIMES UNTIL ALL ERRORS DISAPEARS!!! One of the well known errors is: "Couldn't clone file: Could not allocate block in ext2 filesystem". Look at /data/local/tmp/script.log each time and make sure it not contain any error otherwise you are not done things right and partition is not repaired yet!!! More info -> https://forum.xda-developers.com/t/...s-rw-in-super-partition.4120963/post-84966715

      Platform:

      - Superunpack is working on Windows, Linux, Android, Darwin11, just chose right binary.
      - Superrepack is working only under android


      Changelog:

      - version 1 (21.Jun.2020), initial version
      - version 1.1 (22.Jun.2020), dump file format detection, partition size correction in case ext4, partition group detection, have extraction progress bar, improvements
      - version 2 (03.04.2021) implemented possibility to extract partition images to rw mode using Superunpack & I have made new tool called Superrepack
      - version 2 (04.04.2021) implemented arguments so you would do conversion on single partition instead of doing it on all partitions
      - version 3 (04.04.2021) implemented return codes and implemented output logs to be more scripting friendly
      - version 4 - not released
      - version 5 (08.04.2021) implemented resize and repair partitions after switching to rw mode. Implemented build script for building resize2fs, e2fsck, simg2ims, img2simg, lptools
      - version 6 (08.04.2021) better loop device detection and setup
      - version 7 (08.04.2021) fix selinux status detection
      - version 8 (15.04.2021) fix loop device setup in superrepack
      - version 9 (16.04.2021) make losetup android compatible
      - version 10 - not released
      - version 11 (01.05.2021) simplified, removed needs for parameter rw, implemented dm-verity disabler
      - version 12 (05.05.2021) make old logs always deleted before fresh log is created, this prevent concentation with old logs
      - version 13 (06.05.2021) make linux version so you should do the things on your super partition dump in linux machine
      - version 14 (07.05.2021) fix compilation mess between linux and android
      - version 15 (08.05.2021) use libselinux to determine and set selinux to permissive mode instead of popening getenforce-setenforce tools

      Credits:

      - me and me :)


      Source code:

      - source code -> https://github.com/munjeni/super_image_dumper
      14
      I'm not one of those who make paid software and promote on xda, my work is always free. Even I'm always providing source code for free, source code of this tool is here -> https://github.com/munjeni/super_image_dumper , enjoy! ;)
      3
      Version 7 is out! V6 had error detecting slinux status. I do not have device with super partition for test my tool but I have only hope that all is ok. Let me know! :)
      3
      Pixel 4a, working. V13
      2
      New version is out, v11, it now detect file format, partition size correction in case ext4, partition group detection, have extraction progress bar, and it looks like:

      Code:
      ---------------------------------------------------------
      Super image dumper v_11 (by expert :) munjeni @ xda 2020)
      ---------------------------------------------------------
      
      LpMetadataGeometry magic = 0x616c4467
      LpMetadataGeometry struct size = 0x34
      LpMetadataGeometry sha256 = 12FF55F0ABA7B506F25CB5DA5DCA09344234E8DF1D9C93AE82A499D98019467E
      LpMetadataGeometry metadata_max_size = 0x10000
      LpMetadataGeometry metadata_slot_count = 0x3
      LpMetadataGeometry logical_block_size = 0x1000
      
      LpMetadataHeader magic = 0x414c5030
      LpMetadataHeader major_version = 10
      LpMetadataHeader minor_version = 0
      LpMetadataHeader header_size = 0x80
      LpMetadataHeader header sha256 = CCF4F5D07842AAAE7C1B87F0E025512CF7AEA426D477B1E5175DA3D74F9B1C8C
      LpMetadataHeader tables_size = 0x2e8
      LpMetadataHeader tables sha256 = 52578668F89D8BCDA1BD1F748F2F69ED874C10A7062C85EF9970EE05D90161B1
      LpMetadataHeader partitions offset = 0x0
      LpMetadataHeader partitions num_entries = 0x8
      LpMetadataHeader partitions entry_size = 0x34
      LpMetadataHeader extents offset = 0x1a0
      LpMetadataHeader extents num_entries = 0x5
      LpMetadataHeader extents entry_size = 0x18
      LpMetadataHeader groups offset = 0x218
      LpMetadataHeader groups num_entries = 0x3
      LpMetadataHeader groups entry_size = 0x30
      LpMetadataHeader block_devices offset = 0x2a8
      LpMetadataHeader block_devices num_entries = 0x1
      LpMetadataHeader block_devices entry_size = 0x40
      
      Partitions = 5 used, 3 not used, total 8
      
        partition_1_name = system_a
          attributes = 0x1
          first_extent_index = 0x0
          num_extents = 0x1
          group_index = 0x1
          partition_group = somc_dynamic_partitions_a
          extent num_sectors = 0x336390 (0x66c72000 bytes total)
          extent target_type = 0x0
          extent target_data = 0x800 (dumping offset = 0x100000)
          extent target_source = 0x0
            Filetype EXT4. EXT4 size = 0x6526c000
            Dumping system_a.ext4 ...
            ....................................................
            ....................................................
            ....................................................
            ..............................................
        partition_2_name = system_b
          attributes = 0x1
          first_extent_index = 0x1
          num_extents = 0x1
          group_index = 0x2
          partition_group = somc_dynamic_partitions_b
          extent num_sectors = 0xab178 (0x1562f000 bytes total)
          extent target_type = 0x0
          extent target_data = 0x337000 (dumping offset = 0x66e00000)
          extent target_source = 0x0
            Filetype EXT4. EXT4 size = 0x150b3000
            Dumping system_b.ext4 ...
            ..........................................
        partition_3_name = product_a
          attributes = 0x1
          first_extent_index = 0x2
          num_extents = 0x1
          group_index = 0x1
          partition_group = somc_dynamic_partitions_a
          extent num_sectors = 0x2b62b8 (0x56c57000 bytes total)
          extent target_type = 0x0
          extent target_data = 0x3e2800 (dumping offset = 0x7c500000)
          extent target_source = 0x0
            Filetype EXT4. EXT4 size = 0x5565b000
            Dumping product_a.ext4 ...
            ....................................................
            ....................................................
            ....................................................
            ..............
        partition_4_name = product_b (not unused)
          attributes = 0x1
          first_extent_index = 0x3
          num_extents = 0x0
          group_index = 0x2
          partition_group = somc_dynamic_partitions_b
          extent num_sectors = NULL
          extent target_type = NULL
          extent target_data = NULL
          extent target_source = NULL
            Skipping dump.
      
        partition_5_name = vendor_a
          attributes = 0x1
          first_extent_index = 0x3
          num_extents = 0x1
          group_index = 0x1
          partition_group = somc_dynamic_partitions_a
          extent num_sectors = 0x186d58 (0x30dab000 bytes total)
          extent target_type = 0x0
          extent target_data = 0x699000 (dumping offset = 0xd3200000)
          extent target_source = 0x0
            Filetype EXT4. EXT4 size = 0x30141000
            Dumping vendor_a.ext4 ...
            ....................................................
            ............................................
        partition_6_name = vendor_b (not unused)
          attributes = 0x1
          first_extent_index = 0x4
          num_extents = 0x0
          group_index = 0x2
          partition_group = somc_dynamic_partitions_b
          extent num_sectors = NULL
          extent target_type = NULL
          extent target_data = NULL
          extent target_source = NULL
            Skipping dump.
      
        partition_7_name = odm_a
          attributes = 0x1
          first_extent_index = 0x4
          num_extents = 0x1
          group_index = 0x1
          partition_group = somc_dynamic_partitions_a
          extent num_sectors = 0xa60 (0x14c000 bytes total)
          extent target_type = 0x0
          extent target_data = 0x820000 (dumping offset = 0x104000000)
          extent target_source = 0x0
            Filetype EXT4. EXT4 size = 0x132000
            Dumping odm_a.ext4 ...
      
        partition_8_name = odm_b (not unused)
          attributes = 0x1
          first_extent_index = 0x5
          num_extents = 0x0
          group_index = 0x2
          partition_group = somc_dynamic_partitions_b
          extent num_sectors = NULL
          extent target_type = NULL
          extent target_data = NULL
          extent target_source = NULL
            Skipping dump.
      Press any key to continue . . .

      If you need to mount ext4 partition on Linux you need to mount partition RO or it will not mount!