Search This thread

yoshijulas

Member
Apr 17, 2019
14
3
I tried using the script, but it gets stop at ./tools/bin/resize2fs: No such file or directory, but i can see that the file resize2fs exists in that folder path, i dont underestand whats is wrong, i also tried changing it to /data/local/tmp/makesyswr_1.92/tools/bin/resize2fs and still doesnt work

Hope it has a fix
 

lebigmac

Senior Member
Jan 31, 2017
698
354
I tried using the script, but it gets stop at ./tools/bin/resize2fs: No such file or directory, but i can see that the file resize2fs exists in that folder path, i dont underestand whats is wrong, i also tried changing it to /data/local/tmp/makesyswr_1.92/tools/bin/resize2fs and still doesnt work

Hope it has a fix

Open script with text editor and replace all instances of ./tools/bin/resize2fs with resize2fs
Save file and try again

And please show screenshot and log. Thanks.
 

yoshijulas

Member
Apr 17, 2019
14
3
It worked, but only for resize2fs

it stopped now at ./tools/bin/simg2img: No such file or directory

Do i change it for every single tool?

Edit: I changed resize2fs and simg2img and it worked, and finished, thx

Xiaomi Redmi 9A - makesyswr v1.29 - PBRP (Pitch Black Recovery Project) instead of TWRP - Android 10
 
Last edited:
  • Love
Reactions: lebigmac

yoshijulas

Member
Apr 17, 2019
14
3
The script said that i need to reboot, and after that, i tried the command "mount -o remount,rw /"

But it says /dev/block/dm-1 is read-only

I did something wrong? or what do i need to do?
 

Attachments

  • mylog.txt
    5.4 KB · Views: 15
  • Screenshot_2021-04-15-21-44-12-123_com.termux.jpg
    Screenshot_2021-04-15-21-44-12-123_com.termux.jpg
    129.9 KB · Views: 34
  • Screenshot (93).png
    Screenshot (93).png
    51.7 KB · Views: 33
  • lpdump.txt
    1.1 KB · Views: 10
  • Wow
Reactions: lebigmac

Xiaoleng

Member
Apr 14, 2021
9
3
Hi,
I ran the script under TWRP; seems it returned the same error (failed to create super_fixed);
attached the logs of v1.29 here!
Thank you!
 

Attachments

  • lpdump.txt
    1.7 KB · Views: 8
  • myargs.txt
    798 bytes · Views: 7
  • mylog.txt
    6.6 KB · Views: 12
  • Like
Reactions: lebigmac

lebigmac

Senior Member
Jan 31, 2017
698
354
The script said that i need to reboot, and after that, i tried the command "mount -o remount,rw /"

But it says /dev/block/dm-1 is read-only

I did something wrong? or what do i need to do?

Your log couldn't look any better.
I don't know why you still can't mount as rw. Maybe your device have some extra protection? What device is it?
Did you try disabling selinux before mount as rw? setenforce 0
And did you try that mount as rw command from recovery as well?

Hi,
I ran the script under TWRP; seems it returned the same error (failed to create super_fixed);
attached the logs of v1.29 here!
Thank you!

@Xiaoleng your log looks good too except that unknown lpmake error at the end. Why lpmake give output for @yoshijulas but for @Xiaoleng it give no output?
What you can try to do is pull extracted image files to computer and run lpmake for linux from otatools package with the arguments from myargs.txt (adjust paths accordingly) and it should tell you more about your specific lpmake error. It must have something to do with slot A/B
 
Last edited:

Keven11

Member
Nov 22, 2020
7
0
Moto G9 Plus
Moto E (2020)
I
Your log couldn't look any better.
I don't know why you still can't mount as rw. Maybe your device have some extra protection? What device is it?
Did you try disabling selinux before mount as rw? setenforce 0
And did you try that mount as rw command from recovery as well?



@Xiaoleng your log looks good too except that unknown lpmake error at the end. Why lpmake give output for @yoshijulas but for @Xiaoleng it give no output?
What you can try to do is pull extracted image files to computer and run lpmake for linux from otatools package with the arguments from myargs.txt (adjust paths accordingly) and it should tell you more about your specific lpmake error. It must have something to do with slot
I am also stuck at the exact same spot with the exact same issue. If you happen to make some headway can you please let me know?
I will do the same.
 
adb shell
kiev:/ $ su
kiev:/ # chmod 755 /data/local/tmp/superrepack
kiev:/ # setenforce 0
kiev:/ # /data/local/tmp/superrepack /dev/block/sde26
---------------------------------------------------------
Super image repacker v_8 by munjeni @ xda 2021)
---------------------------------------------------------

Removing shared_blocks and making RW on all partitions!

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 = 818D545D237414CA5E0B071D8E50C2671E13C5724D98C299FBEB08960454BA7C
LpMetadataHeader tables_size = 0x268
LpMetadataHeader tables sha256 = C78CE8AD0098BAE42DDC9E026A00EAF364D37D82C42D4F1B5191B0BA69F2720D
LpMetadataHeader partitions offset = 0x0
LpMetadataHeader partitions num_entries = 0x6
LpMetadataHeader partitions entry_size = 0x34
LpMetadataHeader extents offset = 0x138
LpMetadataHeader extents num_entries = 0x4
LpMetadataHeader extents entry_size = 0x18
LpMetadataHeader groups offset = 0x198
LpMetadataHeader groups num_entries = 0x3
LpMetadataHeader groups entry_size = 0x30
LpMetadataHeader block_devices offset = 0x228
LpMetadataHeader block_devices num_entries = 0x1
LpMetadataHeader block_devices entry_size = 0x40

Partitions = 4 used, 2 not used, total 6

partition_1_name = system_a
attributes = 0x1
first_extent_index = 0x0
num_extents = 0x1
group_index = 0x1
partition_group = mot_dp_group_a
extent num_sectors = 0x19b010 (0x33602000 bytes total)
extent target_type = 0x0
extent target_data = 0x800 (dumping offset = 0x100000)
extent target_source = 0x0
Partition: system_a | EXT4 | 0x328f5000 | 4729639D-B5F2-5CC1-A120-9AC5F788683C | 0x0000407B | unsharing blocks and making RW
c: /dev/loop9: failed to set up loop device: No such file or directory
resize2fs 1.45.4 (23-Sep-2019)
open: No such file or directory while opening /dev/loop9
e2fsck 1.45.4 (23-Sep-2019)
/data/local/tmp/e2fsck: No such file or directory while trying to open /dev/loop9
e2fsck 1.45.4 (23-Sep-2019)
/data/local/tmp/e2fsck: No such file or directory while trying to open /dev/loop9
c: /dev/loop9: failed to use device: No such file or directory
Error, script null response!

partition_2_name = system_b
attributes = 0x1
first_extent_index = 0x1
num_extents = 0x1
group_index = 0x2
partition_group = mot_dp_group_b
extent num_sectors = 0xb388 (0x1671000 bytes total)
extent target_type = 0x0
extent target_data = 0x19c000 (dumping offset = 0x33800000)
extent target_source = 0x0
Partition: system_b | EXT4 | 0x1603000 | F5CFDC49-271C-5243-83DA-4FED7A45C3EA | 0x0000407B | unsharing blocks and making RW
c: /dev/loop9: failed to set up loop device: No such file or directory
resize2fs 1.45.4 (23-Sep-2019)
open: No such file or directory while opening /dev/loop9
e2fsck 1.45.4 (23-Sep-2019)
/data/local/tmp/e2fsck: No such file or directory while trying to open /dev/loop9
e2fsck 1.45.4 (23-Sep-2019)
/data/local/tmp/e2fsck: No such file or directory while trying to open /dev/loop9
c: /dev/loop9: failed to use device: No such file or directory
Error, script null response!

partition_3_name = vendor_a
attributes = 0x1
first_extent_index = 0x2
num_extents = 0x1
group_index = 0x1
partition_group = mot_dp_group_a
extent num_sectors = 0x16ad40 (0x2d5a8000 bytes total)
extent target_type = 0x0
extent target_data = 0x1a7800 (dumping offset = 0x34f00000)
extent target_source = 0x0
Partition: vendor_a | EXT4 | 0x2ca1f000 | 2B96C597-1E2F-5EE1-9851-C4A9FA9DE36E | 0x0000407B | unsharing blocks and making RW
c: /dev/loop9: failed to set up loop device: No such file or directory
resize2fs 1.45.4 (23-Sep-2019)
open: No such file or directory while opening /dev/loop9
e2fsck 1.45.4 (23-Sep-2019)
/data/local/tmp/e2fsck: No such file or directory while trying to open /dev/loop9
e2fsck 1.45.4 (23-Sep-2019)
/data/local/tmp/e2fsck: No such file or directory while trying to open /dev/loop9
c: /dev/loop9: failed to use device: No such file or directory
Error, script null response!

partition_4_name = vendor_b (unused)
attributes = 0x1
first_extent_index = 0x3
num_extents = 0x0
group_index = 0x2
partition_group = mot_dp_group_b
extent num_sectors = 0x5d3b38 (0xba767000 bytes total)
extent target_type = 0x0
extent target_data = 0x312800 (dumping offset = 0x62500000)
extent target_source = 0x0
Partition: vendor_b | EXT4 | 0xb7840000 | 453968FF-B43C-54B7-A506-A6A88682C128 | 0x0000407B | unsharing blocks and making RW
c: /dev/loop9: failed to set up loop device: No such file or directory
resize2fs 1.45.4 (23-Sep-2019)
open: No such file or directory while opening /dev/loop9
e2fsck 1.45.4 (23-Sep-2019)
/data/local/tmp/e2fsck: No such file or directory while trying to open /dev/loop9
e2fsck 1.45.4 (23-Sep-2019)
/data/local/tmp/e2fsck: No such file or directory while trying to open /dev/loop9
c: /dev/loop9: failed to use device: No such file or directory
Error, script null response!

partition_5_name = product_a
attributes = 0x1
first_extent_index = 0x3
num_extents = 0x1
group_index = 0x1
partition_group = mot_dp_group_a
extent num_sectors = 0x5d3b38 (0xba767000 bytes total)
extent target_type = 0x0
extent target_data = 0x312800 (dumping offset = 0x62500000)
extent target_source = 0x0
Partition: product_a | EXT4 | 0xb7840000 | 453968FF-B43C-54B7-A506-A6A88682C128 | 0x0000007B | allready RW and without shared_blocks

partition_6_name = product_b (unused)
attributes = 0x1
first_extent_index = 0x4
num_extents = 0x0
group_index = 0x2
partition_group = mot_dp_group_b
extent num_sectors = 0x746c7561666564 (0xe8d8eac2cccac800 bytes total)
extent target_type = 0x0
extent target_data = 0x0 (dumping offset = 0x0)
extent target_source = 0x0
Partition: product_b | UNKNOWN | U | U | U | skipping
kiev:/ # reboot


did everything thats the console output, moto one 5g ace, any help?
 
  • Haha
Reactions: lebigmac

lebigmac

Senior Member
Jan 31, 2017
698
354
@bobbyp1086 lol you are in the wrong thread. Please post again your log in the thread by munjeni

I am also stuck at the exact same spot with the exact same issue. If you happen to make some headway can you please let me know?
I will do the same.

Hi @Keven11 you are stuck at lpmake error at end of script?
It is up to you and other slot A/B device users to show me the actual error so I can try to fix it.
Without knowing what causes lpmake to fail on your slot A/B device I cannot fix it.
Keep in mind my Xiaomi device that I used for development is slot A only so this whole slot A/B thing is still a mystery to me.

There are 2 ways you can figure out your specific lpmake error:

You can try to launch lpmake manually on your phone using the lpmake arguments from myargs.txt:
Bash:
adb shell
cd /data/local/tmp/makesysrw_1.29

#run lpmake for android like this
./tools/bin/lpmake COPY_PASTE_YOUR_ARGUMENTS_HERE

#or like this
./tools/bin/lpmake `cat ./myargs.txt`

Or if that still doesn't give any error output then you can download the otatools package for linux by bynarie and pull all unpacked .img files from /data/local/tmp/makesysrw_1.29/files/super/
as well as /data/local/tmp/makesysrw_1.29/myargs.txt
from your phone to your computer

and then run the lpmake command with the arguments from myargs.txt on your computer. You have to adjust the file paths in myargs.txt accordingly

Bash:
for i in `adb shell "ls /data/local/tmp/makesysrw_1.29/files/super/*.img"`; do adb pull $i; done
adb pull /data/local/tmp/makesysrw_1.29/myargs.txt

#run lpmake for linux like this
./otatools/bin/lpmake COPY_PASTE_YOUR_ARGUMENTS_HERE

#or like this
./otatools/bin/lpmake `cat ./myargs.txt`

If you don't have linux simply boot into ubuntu live installation disk without installing it. You might need platform-tools for adb pull to work though.
 
Last edited:

DBx13

New member
Apr 16, 2021
2
0
Hi,
I did something wrong?
Thank you
 

Attachments

  • mylog.txt
    4.7 KB · Views: 6
  • lpdump.txt
    1.1 KB · Views: 4
  • IMG_20210416_212207.jpg
    IMG_20210416_212207.jpg
    45.5 KB · Views: 21

yoshijulas

Member
Apr 17, 2019
14
3
Your log couldn't look any better.
I don't know why you still can't mount as rw. Maybe your device have some extra protection? What device is it?
Did you try disabling selinux before mount as rw? setenforce 0
And did you try that mount as rw command from recovery as well?
I had to change 3 lines in your script because it didn't worked
Changed '#!/system/bin/sh' for '#!/sbin/sh'
Changed every './tools/bin/resize2fs' for 'resize2fs'
Changed every './tools/bin/simg2img' for simg2img'
This worked in my phone, but can't remount, because read-only

I notice that the original super is 4.5G and the super_fixed is 3.2G(on windows), 3.5G(on Linux) so, way smaller

I typed the command to mount as rw in recovery, and didnt give me any output, but after rebooting into system, its still read-only, maybe fstab is forcing it (im a linux user, but i have no idea about android, android is new to me)

And about the 255 error by trying to flash the .zip in recovery i get this output, *Attached in files*

My phone is a Xiaomi Redmi 9A (I think 2021), MIUI 12 Global, Android 10
 

Attachments

  • Error 255.log
    845 bytes · Views: 10
  • Screenshot_PBRP_2021-04-16-09-53-20.png
    Screenshot_PBRP_2021-04-16-09-53-20.png
    170 KB · Views: 12
  • Screenshot_PBRP_2021-04-16-09-53-13.png
    Screenshot_PBRP_2021-04-16-09-53-13.png
    165.7 KB · Views: 11
  • Screenshot_PBRP_2021-04-16-09-53-28.png
    Screenshot_PBRP_2021-04-16-09-53-28.png
    130.5 KB · Views: 12
  • Like
Reactions: lebigmac

DBx13

New member
Apr 16, 2021
2
0
Hi. Your log looks good. Did you manually flash super_fixed.bin yet with fastboot? What device is this?
Also check your fstab inside your boot.img
Use unpack_bootimg from otatools to unpack your boot.img and show me your fstab please. Thanks.
Thank you for your generous response.
Yes, i flash manually with fastboot.
Redmi 9 ID Miui 12.
 
Last edited:

lebigmac

Senior Member
Jan 31, 2017
698
354
I had to change 3 lines in your script because it didn't worked
Changed '#!/system/bin/sh' for '#!/sbin/sh'
Changed every './tools/bin/resize2fs' for 'resize2fs'
Changed every './tools/bin/simg2img' for simg2img'
This worked in my phone, but can't remount, because read-only

I notice that the original super is 4.5G and the super_fixed is 3.2G(on windows), 3.5G(on Linux) so, way smaller

I typed the command to mount as rw in recovery, and didnt give me any output, but after rebooting into system, its still read-only, maybe fstab is forcing it (im a linux user, but i have no idea about android, android is new to me)

And about the 255 error by trying to flash the .zip in recovery i get this output, *Attached in files*

My phone is a Xiaomi Redmi 9A (I think 2021), MIUI 12 Global, Android 10

Congratulations for getting the script to work.
It's normal that super_fixed.bin (sparse format) is smaller than super_original.bin (raw format).
yoshijulas.jpg

If you can do this in recovery that means it worked. I don't think you can mount system as rw in recovery with shared_blocks read-only lock still enabled (with stock firmware).
You can also try mounting your other partitions like this:
mount -o remount,rw /vendor
mount -o remount,rw /product


If you can mount system as read write in recovery but in Android it doesn't work then there must be another read-only protection layer inside Android. Did you try disable selinux?
Please upload mymount.txt output from this command:
mount > /data/local/tmp/mymount.txt

Thank you for your generous response.
Yes, i flash manually with fastboot.
Redmi 9 ID Miui 12.

@DBx13 thanks for your effort but there are some small mistakes in your screenshot ;)

If you successfully flashed your super_fixed.bin then try this. Good luck!

1-jpg.5235933
 
Last edited:

yoshijulas

Member
Apr 17, 2019
14
3
If you can mount system as read write in recovery but in Android it doesn't work then there must be another read-only protection mechanism inside Android. Did you try disable selinux?
Please upload mymount.txt output from this command:
mount > /data/local/tmp/mymount.txt
I disabled selinux, but still doesn't work

Here are my mounts, one typed in recovery, the another one in normal system, using termux
 

Attachments

  • mymountrecovery.txt
    2.8 KB · Views: 5
  • mymountsystem.txt
    107.7 KB · Views: 6
@lebigmac
Here is an example of script in magisk module
 
  • Like
Reactions: Ayoub$#

thatguyreese86

New member
Jan 12, 2019
3
2
High Point
Moto G Power
I have a Moto G Power and I get Error! Failed to create super_fixed.img file. I am on stock Android 10 and rooted. Since we have the same phone, Did you ever run into the same problem as I did and how did you fix it? Or did it complete without the error?
No, I flashed the zip again after flashing the new images and just took the .bin file in the temp folder and changed it to .img and flashed that. The g7 did the entire process.
 

lebigmac

Senior Member
Jan 31, 2017
698
354
If any slot A/B users with lpmake error creating super_fixed.bin would like to beta test the new upcoming version please send me a message. Thanks. I think we are very close to fixing that annoying lpmake error.

I disabled selinux, but still doesn't work

Here are my mounts, one typed in recovery, the another one in normal system, using termux

Thanks. I checked the files but couldn't find any shared_blocks feature...
It looks like something else is preventing you from mounting your system as read-write inside your Android.


Thank you for your suggestion but I don't really see the point of making a systemless module out of this project.
The whole point of this script is to NOT have systemless root but to have systemfull root if you know what I mean. Just like it used to be before all this systemless hype came along ;)
 
Last edited:

overlimit1

Member
Jun 1, 2017
9
0
lm using redmi note 10 pro with super partition detected, when l tried to install flash makesysrw_1.29_flashable.zip in twrp its failed... it said :

Updater process ended with signal: 6
E : unable to open block device /dev/block/loop181: No such device or address
Error installing zip file '/sdcard/makesysrw_1.29_flashable.zip'
Updating partition details...
Failed to mount '/data' (Invalid argument)
...done

Unable to mount storage

l need to unlock vendor partition to simulator my nfc card. please help @@
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    Now all of a sudden it just works on all input files regardless of whether they are read-only or read-write without having to do any modifications to the source code!? Thanks to precious feedback by @chintoocool all I did was move getCurrentSize() function from makeRW() function into makeSuper() function. And now it just works without throwing that annoying lpmake error 73. WTF! It's such a mystery to me.
    Did I just magically fix the annoying lpmake error 73 (that has been plaguing us for 2 months now) just like that by randomly moving some functions around in the script?! It required some serious detective work for sure. Big thanks to everyone who gave helpful feedback and contributed to fixing it.
    3
    Anybody want to try v1.31c ? Please keep in mind this version has not been thoroughly tested yet so you are trying it at your own risk!

    I was forced to change project name from makesysrw to systemrw AKA sysRW because some ruthless and spineless cyber pirate hacker who is also a member here has stolen my project, deleted all original info from script and replaced with his own meaningless words that had nothing to do with the project and then released as his own. He even hacked into my update-binary and changed the program title to his own bogus meaningless program title! Can you believe it? Talk about a lazy spineless hacker thief. This was also the reason why I had to stop the development of the Android app sadly. It was so close to being finished! Plagiarism and cyber piracy at its finest by a fellow forum member. It's unbelievable! Where has the mutual respect gone nowadays? And no apology or thanks from the guy to this date (been waiting since March 14th when I first caught him red-handed). Rest in peace open source!

    Anyways please let me know if this new version works on your device. I've finally figured out where this annoying lpmake error 73 is coming from and found 2 new ways to prevent it from happening. This error 73 seems to be related to Android 11.

    TWRP error 255 is not fixed yet but installing script manually should work (see manual installation instructions inside script if some ruthless hacker hasn't deleted it yet together with original source, credits, disclaimer and whatnot...)
    If your custom recovery cannot decrypt and mount /data partition yet then try manually running script from within Android!
    Good luck!
    3
    @thelavip @BlazingKahn35 @nttuan @kpykpy @harpreet.s @m3nty @f1^ter @ITGrouch @Articul8Madness @Xiaoleng
    Here is v1.30_gamma for anyone who wants to beta test it. I added some additional slot A/B functionality. Please let me know if it works for you or not. Thank you.
    3
    @thelavip @BlazingKahn35 @nttuan @kpykpy @harpreet.s @m3nty @f1^ter @ITGrouch @Articul8Madness @Xiaoleng

    Please try the new v1.29
    I have finally fixed the bug where lpmake produces no output @ end of script.
    Hopefully this will give more info about what's wrong with slot A/B devices.
    2
    A question please regarding to Xiaomi.eu - did you use it with the recent MIUI 12.6 like 21.4.1 or 21.4.7

    And actually more important question - did you try to update Xiaomi.eu from e.g. 21.4.1 to 21.4.7 while having the previous system mounted as read-write?

    Xiaomi.eu does not update by OTA but by downloading and flashing the zip file from TWRP, but I'm interested if dirty flashing the new Xiaomi.eu zip file works fine when the previous Xiaomi.eu was mounted read-write and wether maybe the newly flashed (updated) Xiaomi.eu automatically remains writable?
    I tried it on latest xiaomi miui 12.6 roms.... Working..... Tried dirty flashing weekly 21.4.7 rom over rw system partitions and it makes the system read only... U have to make it rw again ....
  • 53
    If you can't get this script to work on your device check out the brand new sophisticated superrepack tool by @munjeni



    SystemRW v1.31c *NEW*
    automated bash script by lebigmac for Android 10 and above

    Creation date: February 2021
    Updated: May 2021

    Requirements:
    • rooted STOCK Android 10 or newer (custom ROM should already be read-write!)
    • Custom recovery is recommended but no longer required in latest version
    • at least 20 GB free space on phone for dumping data
    Description:
    A script for all Android power users that wish to make their read-only Android 10+ system read-write-able again to remove bloatware and make more thorough customizations to their device.

    In a nutshell this is what the script is doing:
    • dumps your existing super OR your system / product / vendor partitions depending on whether or not you have super partition
    • extracts embedded read-only partitions (system, vendor, product...) from super if applicable
    • makes these partitions read-write-able
    • joins everything back together to new super.img OR NOT depending on whether or not you have super partition
    • flashes read-write-able images back to device using the super fast Kolibass technique (only in recovery mode)
    User data is not affected.

    Installation:
    Installation of the script has never been this easy!
    Download the flashable zip below, do NOT enable zip signature verification and simply install it in your custom recovery (WORKS IN BOTH TWRP AND ORANGEFOX!)
    The installer binary will auto-detect whether or not your device has a super partition and launch the script accordingly with the proper command line arguments.

    Flashable zip custom usage:
    You can set these custom installation arguments in the included config.ini file.
    Simply extract the flashable.zip and modify the included config.ini file and make your adjustments. Then compress the systemrw_*VERSION* and META-INF folders again as a new .zip and install it in recovery.
    First line of config.ini contains the script arguments for those WITHOUT super partition.
    By default this line is completely empty (no space).
    Second line of config.ini contains the script arguments for those WITH super partition.
    For example if you already dumped your super_original and want to skip that process next time you install the .zip then put this in line #2 of config.ini :
    Code:
     in=./img/super_original.bin size=15
    Remember if you decide to use custom arguments in config.ini then the first character should always be an empty space. If no arguments are used such as by default in line #1 (no super) then the line should be completely empty, no space, nothing.

    Script usage:
    If you've got no super partition then simply call the script with no arguments from the shell.
    If you've got a super partition I would recommend using the optional size=15 parameter as well to give some extra free space (in MB) to each partition.
    The script can be run both inside custom recovery and inside Android operating system. If you run it in Android you will need to fastboot flash the patched images manually!
    Optional arguments: (replace x with your custom value)
    • in=x : *THIS IS IGNORED IF YOU HAVE NO SUPER PARTITION*
      With this flag you can specify an existing super image as input and skip the entire dumping of the super image process. Here you can use the super_original.bin which you dumped earlier with systemrw or the official unsparsed super.img from your downloaded firmware. (unsparse with simg2img). It's also possible to use your super partition block device as input.
      If omitted, systemrw will dump super image from phone to ./img/super_original.bin
      (path is relative to the script)
    • out=x : *THIS IS IGNORED IF YOU HAVE NO SUPER PARTITION*
      With this argument you can specify the output path of the new patched super file.
      If omitted, default output value is ./img/super_fixed.bin
    • size=x : *ONLY RECOMMENDED IF YOU HAVE SUPER PARTITION*
      With this parameter you can specify the extra free space (in megabytes) that will be added to each partition. There is a limit as to how much extra free space you can add per partition. Check your lpdump.txt to find out the exact maximum extra size.
      If omitted, default extra size is 0 (shrink to minimum)
    Examples:
    Code:
    # Run this command *IF YOU HAVE NO SUPER PARTITION*
    ./systemrw.sh
    
    # Run this command if you're first time user *AND YOU HAVE SUPER PARTITION*
    # Specify the extra free space in megabytes for each partition:
    ./systemrw.sh size=15
    
    # Plug an existing super image into the script like this *ONLY IF YOU HAVE SUPER PARTITION*
    ./systemrw.sh in=./img/super_original.bin size=15
    
    # Specify both the input file as well as the output destination *ONLY IF YOU HAVE SUPER PARTITION*
    ./systemrw.sh in=./img/super_original.bin out=./custom/path/super_fixed.bin size=15

    To check whether or not you've got a super partition on your device you can run this command:

    Code:
    adb shell "ls -Alg /dev/block/by-name | grep 'super'"

    Troubleshooting:
    If you get error 255 when trying to install flashable zip then try to install it manually.
    Make sure the script folder was correctly extracted into:
    /data/local/tmp/systemrw_*VERSION*
    If you can't run the script try making the file executable like this: chmod +x ./systemrw.sh
    If you still can't get it to work run which sh in your shell and replace the shebang in the first line of the script with the output of that command. Don't remove the first two #! symbols though. Then save the file and try again.
    Make sure you have full read write access to the /data/local/tmp directory and that the containing files are not encrypted in custom recovery!

    NOTE:
    I did not come up with all this by myself. After searching for a solution for countless days without success, going even as far as learning hex editing - I accidentally came across a couple of very interesting threads burried deep inside the new forum interface where this method has been described by various enthousiasts (links can be found in the credits section below). So I take absolutely no credit for the underlying core mechanisms of the script. I'm only the amateur who put it all together into a compact script so that everybody can enjoy an Android system that's read-write-able again. Just like it used to be in Android 9 or earlier. Before this annoying 'shared_blocks feature' was implemented.

    Credits:
    Huge thanks to @Kolibass for allowing me to use his partition tools for Android. Without your tools this script would not work on the Android platform! This genius also showed me how to flash a 8GB file to my partition in just under 30 seconds! Much faster than fastboot! I still can't believe it!
    Big thanks to @Brepro1 for allowing me to basically copy his awesome tutorial and make it into a script. Without your tutorial guiding me I couldn't have created this script.
    Thanks @AndyYan your great tutorial also helped me a lot for automating the script especially the lpdump part.
    Also big thanks @munjeni for allowing me to use his superunpack V1 tool in the previous version. It helped me to understand how these super images work.
    Thanks @bynarie for making available his otatools package! A part of it was bundled with the previous version which helped me to create this version.
    More thanks @gabrielfrias for his helpful comment
    Thanks @YOisuPU and of course @topjohnwu for discovering the 'shared_blocks feature'
    Thanks @HemanthJabalpuri for assisting me in optimizing the underlying algorithm!

    Disclaimer:
    This is open source software and is provided as is without any kind of warranty or support whatsoever.
    By using and viewing this software you agree to the following terms:
    Under no circumstances shall the author be held responsible for any damages or negative consequences that may arrise from the (inappropriate) use of this software.
    All responsibility, liability and risk lies with the end-user. You hereby agree not to abuse this software for illegal purposes.
    The end-user is free to improve the underlying algorithm (as long as no malicious code is added) as well as redistribute this script in his own project as long as the comment and title section of the script (lines #1 - #65) as well as the included update-binary are not modified or removed.

    Please make sure to post your feedback, suggestions and improvements in the official thread right here.
    Enjoy customizing your read-write-able Android device!


    makesysrw_1.31_01.jpg
    makesysrw_1-21_02-jpg.5264627

    03-jpg.5259867


    1-jpg.5235933


    Download v1.31c *NEW*
    current status:
    experimental
    Please click my like button below if you like my work! Thanks!

    Confirmed working on these devices :

    Xiaomi Poco X3 NFC
    Xiaomi Poco X3 Pro
    Xiaomi Poco X2 - Android 10/11
    Xiaomi Poco X2 - Android 11 (v1.24)
    Xiaomi Poco F2 Pro - Android 11 (v1.26)
    Xiaomi Mi 10 T Lite - Android 11
    Xiaomi Mi 10 T lite - Android 11 - TWRP
    Xiaomi Mi 10 - Android 11
    Xiaomi Mi 10 Ultra - Android 11
    Xiaomi Mi Note 10 Lite - Android 11 - OrangeFox
    Xiaomi Redmi 9 - Android 10
    Xiaomi Redmi 9 - Android 10 (v1.26)
    Xiaomi Redmi Note 9 Pro joyeuse - Android 10
    Xiaomi Redmi Note 9 Pro gauguin (China) - Android 10
    Xiaomi Redmi 9T - Android 11 - TWRP
    Xiaomi Redmi K30 - Android 10
    Xiaomi Redmi K30S Ultra(China), Android 11 (v1.29)

    Asus Rog Phone 3 - Android 10 - TWRP
    OnePlus Nord - Android 11 (v1.24)
    Doogee S96Pro - Android 10 (v1.26)
    F150 model B2021 - Android 10
    Realme C12 - Android 11
    6
    New version 1.20 is ready! DOWNLOAD HERE
    Good news for those that don't have TWRP or couldn't get it to work in their TWRP. Now the script can also be run directly inside Android. Keep in mind that you will have to flash the patched images manually in this case using fastboot flash.

    The zip can still be flashed in TWRP (make sure zip signature verification isn't checked). I bundled my sh program (which I used to develop the script) with the archive this time. Hopefully this will prevent avoidable sh-related syntax errors for some folks. The flashable installer binary automatically launches the script with the proper arguments using this bundled sh program (it's inside the tools folder).

    To those that were having difficulties running the previous version due to empty partitions or multiple partition groups inside their super : this has finally been fixed :D

    Please give this new version a try and let me know if it works for you or not and I will add it to the first post. Thanks for your feedback!
    5
    I try to redo the procedure, i want to change the size. but i get error, can't remove lock.

    Good news. New hotfix available HERE
    I got rid of that buggy get minimum size function and reworked the size querying algorithm a little bit. Should be more stable now.

    Next step will be to make the script compatible with those devices that have empty partitions embedded inside their super partition...
    Also ronnie was complaining about syntax error but I have yet to find the syntax error... If anyone finds it please let me know so I can fix it. Thank you!
    4
    If the script works on your device please write me your phone model, Android version, script version and if you have super partition or not. Also please send me your log files.

    I will add you to the list of success and it will be helpful for further development. Thank you!
    4
    @lebigmac
    I am happy to say that, all the things went fine with my Realme C12.

    I have removed original super.img right after lpunpack finishes. This makes me use your tool with just 15GiB free space.

    A small thing is that, in your update-binary, please create a dir /data/local/tmp if it does not exist.
    If it does not exist, your tool will fail to install.
    It will be not present if a person clean flashes your tool(wipe data).

    Also system RW works fine, but vendor RW gives operation not permitted.
    Do I need use chattr with the block of vendor?


    Also, we can use like this sh makesysrw.sh. Advantage of this is that, we don't need to make it executable and shebang is ignored.

    Thanks

    Hello HemanthJabalpuri. Did you actually get my script to work on your device? This is wonderful news.

    Thanks for the suggestion about creating /data/local/tmp folder if it doesn't exist. I will do it in the next version.

    vendor RW gives operation not permitted.
    Do I need use chattr with the block of vendor?


    Operation not permitted? I never seen this error before. Do you get this error in the script or elsewhere?
    Sorry I don't know what is chattr.

    Also, we can use like this sh makesysrw.sh. Advantage of this is that, we don't need to make it executable and shebang is ignored.

    Thank you very much for this precious piece of advice. Some people have old sh version in their twrp that don't even support basic array functions. Do you think it's possible to bundle my own sh file (that I used for development) with the flashable zip and rule out any sh compatibility issues this way?

    In the next version of the script I would like to remove twrp completely from the requirement list so that everybody can enjoy a system that's read write-able, not only those with twrp. Some devices have no twrp or orange fox available.

    No Orangefox recovery too for Oneplus 7T , unfortunately. Oneplus really messed up 7T's decryption with android 10. I'm hoping for it to fixed with OOS 11 update which too, got delayed because they didn't care for its decryption issues in the first place. Its mind boggling that the 7T doesn't have a working TWRP even after 1 ½ years of being launched.

    Hi shady_soldier
    Yes that kind of sucks I agree. I wish I knew how to actually compile recovery. Too bad I'm only an amateur!
    I tried to compile Xiaomi stock recovery the other day but no luck so far...

    @lebigmac Any chance to uninstall It?
    Thx!!

    Hi Morello12. Did you actually run the script successfully or not?
    Sure simply delete the entire folder /data/local/tmp/makesysrw_1.15c

    But is it a new version or what?
    Does it work without disabling DM-verify?

    No. Disable dm verity and verification is always a good idea!
    @Ayoub$# You could also try flashing an empty vbmeta with fastboot if you can't disable dm verity manually.

    Code:
    fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone