yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] Teracotta:
thanks I appreciate it but I don't have whatsapp, it's not common in my country. I know xda isn't that great anymore but this is still where you are most visible (see the thanks you got for responding)

I have one question, I limited the heap to just 2 partitions, 14 and 15 (all I care about), but I don't know the code to define the end of 15 as the end of the heap

# the disk area (as a sector range) to use for the heap partitions:
heapStart=$(parOldEnd 13) # one past the end of a specific partition
heapEnd=$deviceHeapEnd # one past the last usable sector of the device

"$deviceHeapEnd" on your other examples is always the end of the partition table, since the userdata is the last partition...how do I define the end of 15 or start of 16 as the end of the heap?
[Android Software/Hacking General [Developers Only]] Lanchon:
> I have ported this script to d2usc (which should also work for T999, i747, i535)

> My device is already on there in the request of the T999, we share partition tables.

sharing the partition table is not enough. i REALLY need the dump and other info as requested, including a link to the flashable rom that you are using.

too bad i could have ported the device right now but i don't have the info :(

EDIT: i'm still on the road, btw
[Android Software/Hacking General [Developers Only]] Lanchon:
[MENTION=5314173]terracota[/MENTION],

i've seen your device has a 1.5GB system. why exactly do you want to increase that?

have you seen this post?

https://github.com/Lanchon/REPIT/issues/70#issuecomment-280895675
[Android Software/Hacking General [Developers Only]] Teracotta:
there are 2 reasons

first reason is there are apps that need to be run from /system, and at 50 MB/app there isn't enough space to launch all of them. there's only like 400 mb free space after the ROM. this includes the modern GAPPS which are much bigger than when this phone was new

second issue is certain features like screenshot will only default to internal storage, while other apps can be told to route to external SD card. this can't be changed. and makes it difficult to locate things which save to either /sdcard or /extscard

what I intend is to change the path of internal SD card to the external, so the internal SD card paths will dump on the higher capacity SD card, and the original internal will be added to the /system.

I will fill out the dump as you requested
[Android Software/Hacking General [Developers Only]] ipdev:
I am bias about system size vs. userdata.

System and cache should be as small as possible. Userdata as large as possible.

It's your choice though.

Assuming you ran the dump file.

Lanchon/REPIT DeviceDump GitHub - Link

If not, run it and save the output file.

Even if you do not request an official port, the output log will tell you everything you need to know to port it yourself.

or help restore if something goes wrong.

If heapStart=$(parOldEnd 13) The end of partition 13. So the end of partition 15 would be ...

Assuming you have everything else configured correctly.

# the set of contiguous partitions that form this heap, in order of ascending partition start address:
heapPartitions="$(seq 14 15)"

# the disk area (as a sector range) to use for the heap partitions:
heapStart=$(parOldEnd 13)
heapEnd=$(parOldEnd 15)

If it was me, I would submit the dump logs for an official version.

From the bit of the partition table you shared a few posts back, that 800Meg cache partition is a waist of space.

Lanchon might be able to configure RePit to reduce cache and increase system or userdata.

It's been about a year since I looked into repit. I was using contiguous partitions and some free space in-between the partitions.

I only skimmed the parts about non-contiguous partitions. ;)

Good luck.

Cheers. :cowboy:
[Android Software/Hacking General [Developers Only]] Lanchon:
[MENTION=5314173]terracota[/MENTION],

a test build for you device is on github. sorry about the long delay.

thanks!
[Android Software/Hacking General [Developers Only]] JazzMartian:
Hi, I'd like to request a port for the Nvidia Shield Portable. It has a painfully small system partition size. It's a Tegra 4 device (ROTH). Thanks.
[Android Software/Hacking General [Developers Only]] JaLoou:
Hello.

I was trying to use your tool. And for a first time it was ok.

Now I was trying to use it for the second time for increase the data partition to 6GB and decrease the system partition to 512MB without wiping on i9100 via TWRP 3.1.0.

But now I got an error. And I had attached the screenshot about it.

Sorry, I'm not an IT specialist. But I was trying to use e2fsck as was recommended by your tool and got info that there are many nodes with imagic flags set, many nodes with links to another nodes...

So, please, recommend me what to do now exactly for a success after the error?

May I need to run e2fsck with specific presets or something else?

P.S.: Few years ago I was installing LOS v14.1 and RR v5.8.3-5.8.4 on my device and I was completely disappointed by these custom ROMs due to many hidden issues in they. May these unreliable custom ROMs was producing these abnormalities in the system partition without my knowledge about it?...

May there are possible deeply hidden viruses?
[Android Software/Hacking General [Developers Only]] OpenMinded:
I saw there was still activity here. I posted a request a while back :

ZTE Nubia N3 NX608J · Issue #107 · Lanchon/REPIT

This is the repit-dump.log from a ZTE Nubia N3 (NX608J) with android 7.1. I would like to be able to flash an Android 9 or 10 ROM from similar models like the Redmi Note 6 pro or Max 2. I need a wo...

github.com

Is anyone still looking at those?

What I was trying to achieve for that device is a move/copy of the vendor files to a separate partition so that Android 8 and up can be ported and hopefully further on with GSI.

I am quite new to all this but I have two of these NX608J phones and have been able before to do some low level system recovery so I am not afraid to try things.

It's great hardware, would love to be able to port some ROMS from other phones to it.

Thanks for any help!
[Android Software/Hacking General [Developers Only]] Lanchon:
hi,

> Is anyone still looking at those?

i'm not really. years ago qualcomm started signing the partition table of all its devices, and verifying it even if the device was OEM unlocked. (since they store the OEM unlock state in a partition, they read the partition table before disable signatures.) this means that new ports of REPIT can brick new devices. it happened at least once when a guy requested a port: i did the port, he tried it, and his phone was bricked beyond repair. i felt really bad but i couldn't help. and i stopped processing new devices.

other chipsets have since become common, such ask mediatek. but there is no reason to believe the story won't repeat itself. the ideal solution would be for lineageos and twrp step up to the challenge and standarize a way to partition using LVM, so that all users can pretty much so as they please safely.
[Android Software/Hacking General [Developers Only]] Lanchon:
the ZTE Nubia N3 seems to be snapdragon 625, which guarantees that the phone will be bricked if the PT is altered.

android 8 etc can be built without a separate vendor partition. pretty much all android changes to partition layout are technically optional during build (but legaly mandatory for playstore and android trademark use in new devices). this is exactly for the reasons you need it: to be able to upgrade old androids without dangerous repartitioning.

but as said earlier, you can us LVM to join all non-bootloader partitions into a big heap and partition that heap as desired into logical volumes. you will need to include LVM support in your kernel of course.
[Android Software/Hacking General [Developers Only]] Lanchon:
FYI, i created a TWRP issue about the locking behavior that forces us to flash from /tmp:

https://github.com/TeamWin/Team-Win-Recovery-Project/issues/664
[Android Software/Hacking General [Developers Only]] toi1em:
[MENTION=4141005]Lanchon[/MENTION] I have the same problem. It can not work

I have try both twrp-2.8.7.0 and 3.0.2-0.

View attachment lanchon-repit.log
[Android Software/Hacking General [Developers Only]] the.gangster:
You should really read the op and the linked documentation. Or at least read the last line of your log.

You need to reflash it from /tmp after it fails on first run. It copies itself there for a reason.

And as you already repitted recently (if I understood that right in the CM12-thread and you are starting from scratch) it will be faster to set at least the /data partition to wipe (as otherwise even if it's empty all the 6gb or whatever size you pitted will be moved). If I misunderstood you there, let the setting as is. It will work and just take time.
[Android Software/Hacking General [Developers Only]] toi1em:
[MENTION=6560258]the.gangster[/MENTION] I have try to run it from /tmp and it not work, may be cause by this https://github.com/TeamWin/Team-Win-Recovery-Project/issues/664.

Finally I use Odin to flash a kernel and a pit file and my problem solve http://xdaforums.com/galaxy-s2/development-derivatives/mod-increase-partition-size-t3011162
[Android Software/Hacking General [Developers Only]] woook:
i would like to make 2gb partition for system, rest for data, external card will be attached later

I also want to wipe all data, from partitions to flash new OS

already have proper TWRP just don't know how to name the file

i would appreciate any help :)
[Android Software/Hacking General [Developers Only]] Lanchon:
but your phone will still use the internal sdcard, however small.

you would need to somehow make android not mount the internal sdcard or at least make android swap the two cards so that the external is the default one. do you know how to do this?

WARNING: THESE WILL WIPE YOUR INTERNAL SDCARD !!!!

this will keep data and data, and create a 128MB small internal sdcard:

-system=2-data=max-sdcard=0.125+wipe-preload=min+wipe

this will also WIPE SYSTEM AND DATA, and will be faster:

-system=2+wipe-data=max+wipe-sdcard=0.125+wipe-preload=min+wipe

a 128MB internal sdcard is created because most systems will not boot without one.

if you want a 64MB sdcard use 0.0625 instead of 0.125.

but 64MB might not be enough to boot some systems? i dont know...
[Android Software/Hacking General [Developers Only]] woook:
i want extrenal only to store media, it's slow

i'm not sure if i understand this correctly...

sys = where only system is, no apps are installed there?

data = where the apps originally are installed

sdcard = sdcard0 ( like sdcard but mounted from internal storage )

if so ,then i just need 1gb for system , because i use cm13 for i9100

so the correct filename for me should be like

-system=1+wipe-data=max+wipe-sdcard=1.0+wipe-preload=min+wipe

as far as i can tell now i'll have full wipe and lot of space for apps, right?
[Android Software/Hacking General [Developers Only]] fireburner-de:
[MENTION=329802]wook[/MENTION]:

Yes you are right.

Btw. sdcard=1 will result in sd0 beeing 1GB.
[Android Software/Hacking General [Developers Only]] Lanchon:
you haven't read my previous post!! again:

so you want to have a very small sdcard and make your phone not work? is that your plan?
[Android Software/Hacking General [Developers Only]] woook:
didn't know that big sdcard0 is necessary,

i'll make it like this - hope this is a good solution,

-system=1+wipe-data=6+wipe-sdcard=max+wipe-preload=min+wipe
[Android Software/Hacking General [Developers Only]] Lanchon:
yes those are my recommended sizes.

(wiping everything as you have chosen to do will make repit run in under a minute. you don't need to plug into a power source for this.)
[Android Software/Hacking General [Developers Only]] woook:
now i get it, sorry for chaos i made

at first I thought that system is for apps and data=sdcard0, nvm now :)

Thanks again :)
[Android Software/Hacking General [Developers Only]] JavaScout:
Hi, folks. Need some simple math help here:

how much free space will be left in 'sdcard' partition, with this kind of config?​

system = size:1.0 + content:keep + fs:ext4
data = size:6 + content:keep + fs:ext4
sdcard = size:max + content:keep + fs:vfat
preload = size:min + content:keep + fs:ext4

I just want to keep all of my partitions data, hence the question.

P.S. btw, [MENTION=4141005]Lanchon[/MENTION] , how do you achieve this effect, when data is kept untouched during repartition?

I'm mean - from technical perspective?
[Android Software/Hacking General [Developers Only]] Lanchon:
you can'r shrink preload to minimum size AND keep its content! either wipe it (recommended) or size it appropriately.

regarding your question: it depends on the type of partition (file system, etc); different types have different handlers. look at the docs to see which types support content keep, then look a the source code. there is a separate source file for each supported partition type.
[Android Software/Hacking General [Developers Only]] the.gangster:
[MENTION=4577303]JavaScout[/MENTION]

You'll have 7.5gb total SD space. Free space will be dependant on your currently used space in there. So you must not have more occupied already.

Preserving data is done by moving data chunks.

So it's quite some load on your memory chip during that operation.
[Android Software/Hacking General [Developers Only]] JavaScout:
Thanks, [MENTION=6560258]the.gangster[/MENTION] and [MENTION=4141005]Lanchon[/MENTION].

/e

Is there a direct connection between cache and system sizes ?

/e #2

How do you handle partitions that are NOT provided as input?

:confused:
[Android Software/Hacking General [Developers Only]] Lanchon:
1) no. cache is mostly unused in recent androids. some devices use cache for stock OTAs, so on those there is. CM and other custom OTAs use the sdcard instead.

2) there are per-device, per-partition defaults. typically SAME, KEEP, and some appropriate file system. this usually means that on unconfigured partitions, the contained file system will be checked, fixed, trimmed, and resized to match partition size minus encryption footer if applicable. they can also be moved to satisfy size changes of other partitions and alignment constraints.
[Android Software/Hacking General [Developers Only]] JavaScout:
Success!

Thanks, Lanchon - it worked almost perfect (had to fire script from /tmp) with the following config:

----- DEFAULTS -----
system = size:same + content:keep + fs:ext4
data = size:same + content:keep + fs:ext4
sdcard = size:same + content:keep + fs:vfat
preload = size:same + content:keep + fs:ext4

info: parsing package name

----- CONFIGURATION -----
system = size:1 + content:keep + fs:ext4
data = size:5 + content:keep + fs:ext4
sdcard = size:max + content:keep + fs:ext4
preload = size:min + content:wipe + fs:ext4

However, I got a minor question, please see screenshots.

I've compared the output of "mount", "cat *partitions", "df", "diskinfo app" and it looks like "df" is not equal to the output of "cat * ".

Can you please tell me why is that?

:fingers-crossed:
[Android Software/Hacking General [Developers Only]] Lanchon:
ok so you have a bunch of numbers in those pics. df and proc/* outputs are different because they do different things. please give a concrete example of two numbers that you expected should match.
[Android Software/Hacking General [Developers Only]] JavaScout:
Well, here it is: df shows 4.9G for data, after Repit; and proc/* shows 5242880 blocks, which makes perfect sense (5242880/(1024*1024)=5).

4.9G != 5 :eek:
[Android Software/Hacking General [Developers Only]] Lanchon:
/proc shows you the partition size, which is the 5GiB you configured. df shows you the size of file system within it.

the difference for the case of /data in your device is configured here:

https://github.com/Lanchon/REPIT/blob/master/device/galaxy-s2/common.sh#L59

and is 16KiB as shown.

this fits android's encryption footer, where newer androids store encryption metadata on older phones. newer phones have a small encryption metadata partition. but to support upgrading older devices and adding encryption without touching the partition table, the footer mechanism was also implemented. if REPIT didn't do this for your particular device, an attempt to encrypt your phone after REPITing would fail.
[Android Software/Hacking General [Developers Only]] MayuraDeSilva:
REPIT: Galaxy Nexus / TWRP 2.8.6.0

Thanks for this awesome tool, Lanchon. Read it has been very helpful on older devices.

I'm on Galaxy Nexus (GSM) and tried the default file in downloads (with TWRP 2.8.6.0) - lanchon-repit-20160415-system=1.0-cache=0.0605+wipe-data=same-maguro.zip

But it didn't proceed and couldn't find a log in /tmp folder either.

Any help would be appreciated!
[Android Software/Hacking General [Developers Only]] the.gangster:
[MENTION=4912896]MayuraDeSilva[/MENTION]

And don't you think at least a screenshot or a detailed explaination would help ???
[Android Software/Hacking General [Developers Only]] MayuraDeSilva:
Sorry, I don't have a screenshot though. However the error reads:

flashize-ext: unable to extract package contents

[ERROR 1]

E:Error executing updater binary in zip'/sdcard/lanchon-repit-20160415-system=1.0-cache=0.0605+wipe-data=same-maguro.zip'

Error flashing zip '/sdcard/lanchon-repit-20160415-system=1.0-cache=0.0605+wipe-data=same-maguro.zip'

Hope it helps.
[Android Software/Hacking General [Developers Only]] erOzeOz:
Hello,

I have the same issue, on the same device (Galaxy Nexus, maguro).

I followed the recommendations in case the script fails: run it from /tmp, reboot recover and try again - with no success.

According to the attached log , it is a problem of unmounting the partitions (ERROR 1).

FYI, in case this can help you, this is my current configuration:

/system in ext4 (default),

/cache in f2fs,

/data in f2fs.

Here is what I did:

1st attempt: I ran the script with default options provided in the name (so default formats are ext4), with no success.

2nd attempt: I then renamed the script to take into consideration the current formats of partitions (so by declaring +f2fs for /cache and /data), and by adding +wipe /cache (as I was resizing it) and +keep for /data (no resize), in order to respect f2fs supported features matrix. Failed again.

Is it a problem in the name of the script for my configuration?

Is it a problem of current formats of /cache and /data?

Thanks in advance!
[Android Software/Hacking General [Developers Only]] the.gangster:
Try redownloading the ZIP. If it still fails, try to update to newer TWRP. If I remember right I read about that error once (on a Nexus device), where it failed with 2.8.7.0 but succeeded with 3.0.2-0.

Same exit code, but completely different error.

Looks like script is simply failing to unmount sdcard. Please ensure that you don't mount it. Neither in the recovery itself nor by beeing plugged to a PC.

After failing upon first try, rerun it from /tmp and see the project's readme for details (as you probably did already). Also the phone must not be encrypted.
[Android Software/Hacking General [Developers Only]] MayuraDeSilva:
Thanks for the response. I did try redownloading but still the same error. Galaxy Nexus doesn't have an official TWRP build since 2.8.7.0. But will try with unofficial 3.0.0.0.

UPDATE #1: Updated TWRP but had same error code. Same error when it says to run from /tmp too. It was similar to erOzeOz's issue. However, rebooted, copied the zip file to /tmp directly and flashed it from there. Completed successfully.

UPDATE #2: But the partition sizes were reverted back to former values after installing CM13. Do I have to do anything else between partitioning and installing a custom ROM? Thanks.

UPDATE #3: Apparently, Resize File System option in TWRP did the trick (after installing CM13)
[Android Software/Hacking General [Developers Only]] the.gangster:
That's exactly what you can do. Most ROMs are getting flashed image-based, so the partition is only filled with the filesystem sized to fit into the stock size.

You could ask the maintainer of your ROM to implement the resize into the updater script. As then the Resize could already take place directly after "extracting" the ROM and before the restore of backed-up stuff (addon.d scripts) is triggered. But that is not an issue of the Repit script. Happens the same way on partitions enlarged by e.g. ODIN with PIT files..

But good to hear it finally worked with TWRP 3.
[Android Software/Hacking General [Developers Only]] erOzeOz:
Indeed, /data was mounted in TWRP. Thanks! ;)
[Android Software/Hacking General [Developers Only]] MayuraDeSilva:
Indeed! Yeah, REPIT was successful, and it was after flashing the ROM. Thanks for the clarification regarding this issue and will notify the maintainer :)

UPDATE #1:

All of a sudden, getting another error when trying to use Resize File System for /system partition - after installing CM13. Any idea? Reflashed TWRP too.

/sbin/resize2fs /dev/block/mmcblk0p10 process ended with ERROR: 1

Unable to resize System

UPDATE #2: Fixed by reflashing factory image and doing it all from the scratch. Still interested to know what is that error about though. Thanks.
[Android Software/Hacking General [Developers Only]] Lanchon:
> flashize-ext: unable to extract package contents

this error means there is something wrong with your TWRP.

no REPIT log because REPIT didn't even get a chance to start. flashize, the REPIT packager, failed while extracting the package contents. you can enable logging in flashize itself; read the flashize docs.

however, long story short, there is something wrong with TWRP; you probably need a different one.
[Android Software/Hacking General [Developers Only]] the.gangster:
[MENTION=4912896]MayuraDeSilva[/MENTION]

I found where I originally read that it would work with 3.0.2-0 again: here.

Maybe you find (or ask for) the correct version there.
[Android Software/Hacking General [Developers Only]] MayuraDeSilva:
Thanks for the clarification, [MENTION=4141005]Lanchon[/MENTION] :) Good to know. It was fine with TWRP 3.0.2-0 when I flashed it from /tmp.

I'm on TWRP 3.0.2-0, [MENTION=6560258]the.gangster[/MENTION]. REPIT was successful :) But then again this is the issue I've got while on TWRP 3.0.2-0 (UPDATE #1), after flashing the ROM. Fixed now, but wondering what was it after all. Corrupted file system or partition?
[Android Software/Hacking General [Developers Only]] husky168:
Hello, I got the following error.

/dev/block/mmcblk0p12: unexpected inconsistency run fsck manually.

Fatal: file system errors in partition #12 'preload' (hidden) could not be fixed automatically...

My device is N7000 and running TWRP 3.0.2 , was run from /tmp.

lanchon-repit-20160415-system=same+keep+ext4-data=6+keep+ext4-sdcard=max+keep+vfat-preload=same+keep+ext4-n7000

Any advise to resolve these? Thank you!
[Android Software/Hacking General [Developers Only]] the.gangster:
[MENTION=4338462]husky168[/MENTION]

you could either try what it suggested you already: within the recovery use terminal and manually start the filesystem check (e2fsck) on preload partition.

Or you could try wiping your preload partition as it usually not used at all by non-Sammy-ROMs.

lanchon-repit-20160415-data=6-sdcard=max-preload=+wipe-n7000

(I left away the defaults from above command, as they are used anyway if dropped)
[Android Software/Hacking General [Developers Only]] husky168:
Thanks mate!

preload=+wipe-n7000 did the trick!
[Android Software/Hacking General [Developers Only]] Lanchon:
you could try 'preload=min+wipe' to get a small preload (which is completely unused) and up to 0.5GB more storage in sdcard "for free".

unfortunately you didn't post your log so i don't know your exact configuration.
[Android Software/Hacking General [Developers Only]] Lanchon:
[MENTION=6560258]the.gangster[/MENTION], [MENTION=4912896]MayuraDeSilva[/MENTION],

please see this commit:

https://github.com/Lanchon/REPIT/commit/04fa0e308999411b59e780be9d008b5369d1119d