[TOOL][SCRIPT][A520X|A720X] Repartition tool for treble support - Samsung Galaxy A3, A5, A7 (2017) Themes, Apps, and

Repartition tool for A5 and A7 2017
Disclaimer
Code:
I am NOT responsible for bricked devices or any damage that may happen to your device.
Repartitioning is a dangerous process and may brick your device in the worst case.
Features
This script will set 64MB for your /cache partition and ~4.6GB for your /system partition (The size of /system may be smaller or bigger depending on which variation of A5 and A7 is used)
The script will create a new partition called "vendor" with a size of 300MB
Only /system and /cache will be deleted during the flashing process, your /data partition keeps untouched
Flashing the script for a second time after already having it flashed will delete the /vendor partition and restore your stock partitions
You will still be able to install any recent ROM (Note that A720S may be unable to install any recent ROM. Contact me if you have problems)
TWRP, SHRP and Orangefox are supported
Installation
Make a backup of all your partitions first in case something goes wrong. Repartitioning is a dangerous process!
Make sure to have the latest version of TWRP/SHRP/Orangefox installed before installing this script.
Download the Repartitioner from post #2
If you only want to patch your recovery but already have the /vendor partition, download the RecoveryPatch from post #2
Flash the installer zip and wait until it is finished. It will add the necessary partition, patch your recovery and automatically reboot you to recovery if the installation is successful.
After reboot, make sure that /system, /cache and /vendor are mountable. If not, format them. (See a How-To in FAQ in post #3)
Congratulations, your device now supports treble!
Downloads
Find them in post #2
Support and FAQ
Telegram Group
FAQ (Frequently asked questions)
Credits
Me for the time I spent on this
@corsicanu for his template script
@Reverant for the original repartition script
@osm0sis for AnyKernel
Telegram users for testing
XDA:DevDB Information
[TOOL][SCRIPT][A520X|A720X] Repartition tool for treble support, Tool/Utility for the Samsung Galaxy A Series 2017 A3, A5, A7
Contributors
Simon1511
Version Information
Status: Stable
Created 2020-09-08
Last Updated 2020-09-09

Downloads
v1.2
Repartitioner: Google Drive | Androidfilehost (Will resize your partitions AND patch recovery)
RecoveryPatcher: Google Drive | Androidfilehost(Will ONLY patch your recovery for treble support. Flash this if you upgrade from an older version.)
Changelog
Spoiler
v1.2
Spoiler
Removed TWRP version check
Added support for SHRP and Orangefox
v1.1
Spoiler
Fixed a typo that prevented the script from creating new partitions on A720F and korean A5 variants
v1.0
Spoiler
Initial release

Reserved
FAQ (Frequently asked questions)
I cant mount /system, /cache or/and /vendor. What do I do?
->In recovery, go to Wipe, Advanced Wipe, select the partition you have problems with and tap "Repair or Change File System". Choose "Change File System", choose EXT4 and confirm the process. Reboot to recovery again to complete the process.This may be slightly different depending on which recovery you are using.
Restoring my /system backup always fails! What do I do?
->This seems to be a general TWRP problem. To fix, wipe /system, reboot to recovery, install the ROMs zip you had installed before, reboot to recovery again and restore your backup.
I have an A720S and cant install any recent ROM! Why?
->A720S has the smallest /system partition of all A5 and A7 variants and Lineage and every other ROM currently has its stock partition sizes set. Just flash the repartition ZIP again to revert the changes and contact me so we can resolve this problem.
How do I upgrade from an older version to the latest?
->The latest version doesn't change anything in terms of partition size. Therefore, you don't need to upgrade unless you have any issues.
How do I patch my recovery to support treble?
->Download the "RecoveryPatch" ZIP from the download section above and flash it in recovery. It will patch your recovery to support treble. If you want to switch to non-treble recovery, flash the recovery IMG/ZIP or the RecoveryPatch ZIP again.

reserved

in a720f can't format or mount /system, /cache or/and /vendor
says unable to wipe them
error changing file system
After second time installing "repartitioner-v1.0-a57y17lte.zip" reverse process fails to restore /cache partition to first /cache

matkali said:
in a720f can't format or mount /system, /cache or/and /vendor
says unable to wipe them
error changing file system
After second time installing "repartitioner-v1.0-a57y17lte.zip" reverse process fails to restore /cache partition to first /cache
Click to expand...
Click to collapse
Did you have TWRP 3.4 installed before installing the repartition script?
If not, thats likely to be the cause.
Also, dont forget to format /system, /vendor and /cache after installation.

Simon1511 said:
Did you have TWRP 3.4 installed before installing the repartition script?
If not, thats likely to be the cause.
Also, dont forget to format /system, /vendor and /cache after installation.
Click to expand...
Click to collapse
yes I do all of them

matkali said:
in a720f can't format or mount /system, /cache or/and /vendor
says unable to wipe them
error changing file system
After second time installing "repartitioner-v1.0-a57y17lte.zip" reverse process fails to restore /cache partition to first /cache
Click to expand...
Click to collapse
Yeah same issue here,. A720F

deleted

Updated the script to fix A720F and korean A5 support.
Sorry for the circumstances.
Downloads can be found in post #2

UPDATE
repartitioner v1.2: Google Drive | Androidfilehost (Will resize your partitions and patch recovery)
RecoveryPatcher: Google Drive | Androidfilehost (Will ONLY patch your recovery for treble support)
Changelog
Removed TWRP version check
Added support for SHRP and Orangefox

Related

[DEV]How to compile TWRP touch recovery

All of TWRP 3.x source is public. You can compile it on your own. This guide isn't going to be a step-by-step, word-for-word type of guide. If you're not familiar with basic Linux commands and/or building in AOSP then you probably won't be able to do this.
You can currently use Omni 6.0, Omni 7.1, Omni 8.1, Omni 9.0, CM 13.0, CM 14.1, CM 15.1, LineageOS 16.0 source code. Omni 9.0 is recommended for now unless your device has a super partition.
If you are using CM/LineageOS, you'll need to place TWRP in the LineageOS/bootable/recovery-twrp folder and set RECOVERY_VARIANT := twrp in your BoardConfig.mk file. TWRP source code can be found here:
https://github.com/TeamWin/android_bootable_recovery (NOTE: The location for the latest TWRP source code has changed!)
Select the newest branch available. This step is not necessary with Omni because Omni already includes TWRP source by default, however, if you are using an older version of Omni, you will probably want to pull from the latest branch (the latest branch will compile successfully in older build trees)
If you are only interested in building TWRP, you may want to try working with a smaller tree. You can try using this manifest. It should work in most cases but there may be some situations where you will need more repos in your tree than this manifest provides:
https://github.com/minimal-manifest-twrp
*BEFORE YOU COMPILE*
Note: If you add or change any flags, you will need to make clean or make clobber before recompiling or your flag changes will not be picked up.
Now that you have the source code, you'll need to set or change a few build flags for your device(s). Find the BoardConfig.mk for your device. The BoardConfig.mk is in your devices/manufacturer/codename folder (e.g. devices/lge/hammerhead/BoardConfig.mk).
Your board config will need to include architecture and platform settings. Usually these are already included if you're using device configs that someone else created, but if you created your own, you may need to add them. Without them, recovery may seg fault during startup and you'll just see the teamwin curtain flash on the screen over and over.
We usually put all of our flags at the bottom of the BoardConfig.mk under a heading of #twrp For all devices you'll need to tell TWRP what theme to use. This TW_THEME flag replaces the older DEVICE_RESOLUTION flag. TWRP now uses scaling to stretch any theme to fit the screen resolution. There are currently 5 settings which are: portrait_hdpi, portrait_mdpi, landscape_hdpi, landscape_mdpi, and watch_mdpi. For portrait, you should probably select the hdpi theme for resolutions of 720x1280 and higher. For landscape devices, use the hdpi theme for 1280x720 or higher.
TW_THEME := portrait_hdpi
Note that themes do not rotate 90 degrees and there currently is no option to rotate a theme. If you find that the touchscreen is rotated relative to the screen, then you can use some flags (discussed later in this guide) to rotate the touch input to match the screen's orientation.
In addition to the resolution, we have the following build flags:
RECOVERY_SDCARD_ON_DATA := true -- this enables proper handling of /data/media on devices that have this folder for storage (most Honeycomb and devices that originally shipped with ICS like Galaxy Nexus) This flag is not required for these types of devices though. If you do not define this flag and also do not include any references to /sdcard, /internal_sd, /internal_sdcard, or /emmc in your fstab, then we will automatically assume that the device is using emulated storage.
BOARD_HAS_NO_REAL_SDCARD := true -- disables things like sdcard partitioning and may save you some space if TWRP isn't fitting in your recovery patition
TW_NO_BATT_PERCENT := true -- disables the display of the battery percentage for devices that don't support it properly
TW_CUSTOM_POWER_BUTTON := 107 -- custom maps the power button for the lockscreen
TW_NO_REBOOT_BOOTLOADER := true -- removes the reboot bootloader button from the reboot menu
TW_NO_REBOOT_RECOVERY := true -- removes the reboot recovery button from the reboot menu
RECOVERY_TOUCHSCREEN_SWAP_XY := true -- swaps the mapping of touches between the X and Y axis
RECOVERY_TOUCHSCREEN_FLIP_Y := true -- flips y axis touchscreen values
RECOVERY_TOUCHSCREEN_FLIP_X := true -- flips x axis touchscreen values
TWRP_EVENT_LOGGING := true -- enables touch event logging to help debug touchscreen issues (don't leave this on for a release - it will fill up your logfile very quickly)
BOARD_HAS_FLIPPED_SCREEN := true -- flips the screen upside down for screens that were mounted upside-down
There are other build flags which you can locate by scanning the Android.mk files in the recovery source. Most of the other build flags are not often used and thus I won't document them all here.
*RECOVERY.FSTAB*
TWRP 2.5 and higher supports some new recovery.fstab features that you can use to extend TWRP's backup/restore capabilities. You do not have to add fstab flags as most partitions are handled automatically.
Note that TWRP only supports v2 fstabs in version 3.2.0 and higher. You will still need to use the "old" format of fstab for older TWRP (example of that format is below), and even TWRP 3.2.0 still supports the v1 format in addition to the v2 format. To maximize TWRP's compatibility with your build tree, you can create a twrp.fstab and use PRODUCT_COPY_FILES to place the file in /etc/twrp.fstab When TWRP boots, if it finds a twrp.fstab in the ramdisk it will rename /etc/recovery.fstab to /etc/recovery.fstab.bak and then rename /etc/twrp.fstab to /etc/recovery.fstab. Effectively this will "replace" the fstab 2 file that your device files are providing with the TWRP fstab allowing you to maintain compatibility within your device files and with other recoveries.
Code:
PRODUCT_COPY_FILES += device/lge/hammerhead/twrp.fstab:recovery/root/etc/twrp.fstab
The fstab in TWRP can contain some "flags" for each partition listed in the fstab.
Here's a sample TWRP fstab for the Galaxy S4 that we will use for reference:
Code:
/boot emmc /dev/block/platform/msm_sdcc.1/by-name/boot
/system ext4 /dev/block/platform/msm_sdcc.1/by-name/system
/data ext4 /dev/block/platform/msm_sdcc.1/by-name/userdata length=-16384
/cache ext4 /dev/block/platform/msm_sdcc.1/by-name/cache
/recovery emmc /dev/block/platform/msm_sdcc.1/by-name/recovery
/efs ext4 /dev/block/platform/msm_sdcc.1/by-name/efs flags=display="EFS";backup=1
/external_sd vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1 flags=display="Micro SDcard";storage;wipeingui;removable
/usb-otg vfat /dev/block/sda1 /dev/block/sda flags=display="USB-OTG";storage;wipeingui;removable
/preload ext4 /dev/block/platform/msm_sdcc.1/by-name/hidden flags=display="Preload";wipeingui;backup=1
/modem ext4 /dev/block/platform/msm_sdcc.1/by-name/apnhlos
/mdm emmc /dev/block/platform/msm_sdcc.1/by-name/mdm
Flags are added to the end of the partition listing in the fstab separated by white space (spaces or tabs are fine). The flags affect only that partition but not any of the others. Flags are separated by semicolons. If your display name is going to have a space, you must surround the display name with quotes.
Code:
/external_sd vfat /dev/block/mmcblk1p1 flags=display="Micro SDcard";storage;wipeingui;removable
The flags for this partition give it a display name of "Micro SDcard" which is displayed to the user. wipeingui makes this partition available for wiping in the advanced wipe menu. The removable flag indicates that sometimes this partition may not be present preventing mounting errors from being displayed during startup. Here is a full list of flags:
removable -- indicates that the partition may not be present preventing mounting errors from being displayed during boot
storage -- indicates that the partition can be used as storage which makes the partition available as storage for backup, restore, zip installs, etc.
settingsstorage -- only one partition should be set as settings storage, this partition is used as the location for storing TWRP's settings file
canbewiped -- indicates that the partition can be wiped by the back-end system, but may not be listed in the GUI for wiping by the user
userrmrf -- overrides the normal format type of wiping and only allows the partition to be wiped using the rm -rf command
backup= -- must be succeeded by the equals sign, so backup=1 or backup=0, 1 indicates that the partition can be listed in the backup/restore list while 0 ensures that this partition will not show up in the backup list.
wipeingui -- makes the partition show up in the GUI to allow the user to select it for wiping in the advanced wipe menu
wipeduringfactoryreset -- the partition will be wiped during a factory reset
ignoreblkid -- blkid is used to determine what file system is in use by TWRP, this flag will cause TWRP to skip/ignore the results of blkid and use the file system specified in the fstab only
retainlayoutversion -- causes TWRP to retain the .layoutversion file in /data on devices like Sony Xperia S which sort of uses /data/media but still has a separate /sdcard partition
symlink= -- causes TWRP to run an additional mount command when mounting the partition, generally used with /data/media to create /sdcard
display= -- sets a display name for the partition for listing in the GUI
storagename= -- sets a storage name for the partition for listing in the GUI storage list
backupname= -- sets a backup name for the partition for listing in the GUI backup/restore list
length= -- usually used to reserve empty space at the end of the /data partition for storing the decryption key when Android's full device encryption is present, not setting this may lead to the inability to encrypt the device
canencryptbackup= -- 1 or 0 to enable/disable, makes TWRP encrypt the backup of this partition if the user chooses encryption (only applies to tar backups, not images)
userdataencryptbackup= -- 1 or 0 to enable/disable, makes TWRP encrypt only the userdata portion of this partition, certain subfuldes like /data/app would not be encrypted to save time
subpartitionof= -- must be succeeded by the equals sign and the path of the partition it is a subpartition of. A subpartition is treated as "part" of the main partition so for instance, TWRP automatically makes /datadata a subpartition of /data. This means that /datadata will not show up in the GUI listings, but /datadata would be wiped, backed up, restored, mounted, and unmounted anytime those operations are performed on /data. A good example of the use of subpartitions is the 3x efs partitions on the LG Optimus G:
Code:
/efs1 emmc /dev/block/mmcblk0p12 flags=backup=1;display=EFS
/efs2 emmc /dev/block/mmcblk0p13 flags=backup=1;subpartitionof=/efs1
/efs3 emmc /dev/block/mmcblk0p14 flags=backup=1;subpartitionof=/efs1
This lumps all 3 partitions into a single "EFS" entry in the TWRP GUI allowing all three to be backed up and restored together under a single entry.
As of TWRP 3.2.0, TWRP now supports a version 2 fstab like those that have been found in Android devices for years. Yes, I know we're really slow to adopt this one, but I also saw no major advantage to v2 and the v2 fstab was being used in regular Android as well as recovery and I didn't want full ROM builds crashing or doing other weird things because of TWRP flags being present in the fstab. Version 2 fstab support is automatic. You don’t need to add any build flags. The regular version 1 fstab format is also still valid and it’s possible to use both v1 and v2 types in the same fstab. TWRP 3.2.0 also supports using wildcards via the asterisk in v1 format which can be useful for USB OTG and micro SD cards with multiple partitions. Note also that v2 fstab formats haven’t been extensively tested so developers should test their v2 fstabs before shipping to users (you should always be testing anyway!).
This is a v1 fstab line with a wildcard intended for a USB OTG drive. All partitions should show up in the list of available storage devices when the user plugs in a drive:
Code:
/usb-otg vfat /dev/block/sda* flags=removable;storage;display=USB-OTG
This line is straight from the v2 fstab for the same device and also should work. In this case the kernel will notify us that new devices have been added or removed via uevents:
Code:
/devices/soc.0/f9200000.ssusb/f9200000.dwc3/xhci-hcd.0.auto/usb* auto auto defaults voldmanaged=usb:auto
In addition to the v2 fstab, you can include /etc/twrp.flags which uses the v1 fstab format. The twrp.flags file can be used to supplement the v2 fstab with TWRP flags, additional partitions not included in the v2 fstab, and to override settings in the v2 fstab. For example, I have a Huawei device with the following stock v2 fstab present as /etc/recovery.fstab
Code:
# Android fstab file.
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
/dev/block/bootdevice/by-name/system /system ext4 ro,barrier=1 wait,verify
/dev/block/bootdevice/by-name/cust /cust ext4 ro,barrier=1 wait,verify
/devices/hi_mci.1/mmc_host/mmc1/* auto auto defaults voldmanaged=sdcard:auto,noemulatedsd
/devices/hisi-usb-otg/usb1/* auto auto defaults voldmanaged=usbotg:auto
/dev/block/bootdevice/by-name/userdata /data f2fs nosuid,nodev,noatime,discard,inline_data,inline_xattr wait,forceencrypt=footer,check
/dev/block/bootdevice/by-name/cache /cache ext4 rw,nosuid,nodev,noatime,data=ordered wait,check
/dev/block/bootdevice/by-name/splash2 /splash2 ext4 rw,nosuid,nodev,noatime,data=ordered,context=u:object_r:splash2_data_file:s0 wait,check
/dev/block/bootdevice/by-name/secure_storage /sec_storage ext4 rw,nosuid,nodev,noatime,discard,auto_da_alloc,mblk_io_submit,data=journal,context=u:object_r:teecd_data_file:s0 wait,check
In addition I have also included this in /etc/twrp.flags:
Code:
/boot emmc /dev/block/platform/hi_mci.0/by-name/boot
/recovery emmc /dev/block/platform/hi_mci.0/by-name/recovery flags=backup=1
/cust ext4 /dev/block/platform/hi_mci.0/by-name/cust flags=display="Cust";backup=1
/misc emmc /dev/block/platform/hi_mci.0/by-name/misc
/oeminfo emmc /dev/block/platform/hi_mci.0/by-name/oeminfo flags=display="OEMinfo";backup=1
/data f2fs /dev/block/dm-0
/system_image emmc /dev/block/platform/hi_mci.0/by-name/system
The first 2 lines in twrp.flags adds the boot and recovery partitions which were not present at all in the v2 fstab. The /cust line in the twrp.flags file is added to tell TWRP to allow users to back up the cust partition and to give it a slightly better display name. The /misc partition is also only present in the twrp.flags file. Much like the /cust partition, the /oeminfo partition is in the twrp.flags file to tell TWRP to allow users to back it up and give a display name. The /data line is needed because this Huawei device, like many Huawei devices, is encrypted but the encryption uses some special Huawei binaries and is encrypted with some sort of default password that the user cannot change. We use the Huawei binaries to decrypt the device automatically in recovery. The /data line here tells TWRP to use /dev/block/dm-0 instead of /dev/block/bootdevice/by-name/userdata which is required for proper mounting, etc. Lastly we have the /system_image line so that TWRP will add a system image option for backup and restore.
As we add more new devices, we’ll add more example device trees to https://github.com/TeamWin/ which should help you find more ways to use this new fstab support. Please note that using the v2 fstab format at this point is completely optional, so feel free to continue using v1 if that is what is more comfortable or if you have trouble with the v2 format support.
If you have questions, feel free to stop by #twrp on Freenode. If you post here I may not see it for a while as I have lots of threads out there and there's no way for me to keep track of them all. If you successfully port TWRP to a new device, please let us know! We love to hear success stories!
If you have code changes that you'd like to submit, please submit them through the Omni Gerrit server. Guide is here.
Once you get Omni or CM sync'ed and your TWRP flags set, you should do a source ./build/envsetup.sh We usually lunch for the device in question, so something like "lunch omni_hammerhead-eng".
After you lunch successfully for your device this is the command used for most devices:
Code:
make clean && make -j# recoveryimage
Replace the # with the core count +1, so if you have a dual core it's -j3 and a quad core becomes -j5, etc. If you're dealing with a "typical" Samsung device, then you'll need to
Code:
make -j# bootimage
Most Samsung devices have the recovery included as an extra ramdisk in the boot image instead of a separate recovery partition as found on most other devices.
Old guide here: http://forum.xda-developers.com/showpost.php?p=65482905&postcount=1471
So, now, hopefully you've compiled TWRP for your device and gotten it working. Now, you'd like to know how to get TWRP officially supported for your device so that it can be installed automatically with the TWRP app. In order for us to add "official support" for your device we'll need the following:
1) Device configuration files to compile TWRP from source for your device. This means that you cannot have repacked a recovery.img by hand to get it working. We need to be able to compile it from source so that we can easily release future updates.
2) We'll build a copy of TWRP and send it to you for validation. Once you've validated that we can build a working image for your device, we'll add it to the official TWRP app.
Note that we won't take credit for your port. You'll still get to post it on XDA to collect all the credit that goes with releasing something new for your device along with having your name listed on our website as the maintainer for the device. Also note that it's not always possible to provide automated installs for all devices.
You can now boot TWRP in an emulator. If you're trying to help develop TWRP, this can be a huge help as you don't have to risk your device and you can do everything directly on your computer.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Download this set of device configuration files.
Compile a recoveryimage using those device files. In the Android SDK, click on Tools -> Manage AVDs. Click New. Set it up as the following:
AVD Name: TWRP
Device: Galaxy Nexus
Target: ICS or newer though anything will probably work here
CPU: ARM (armeabi-v7a)
Check the box for hardware keyboard (your computer's keyboard will work in TWRP)
Up to you if you want to have the skin with controls present
Front Camera: None
Back Camera: None
RAM: 1024 VM Heap: 64
Internal Storage: 200
SD Card: Size: 500 MiB
Then click OK.
Once you have your AVD and your recoveryimage, you can boot TWRP in the emulator by browsing to your android-sdk/tools folder and run this command:
./emulator -avd TWRP -ramdisk CMFOLDER/out/target/product/twrp/ramdisk-recovery.img
Note that ADB doesn't work right away. About 10 to 15 seconds after TWRP finishes booting, ADB will come online. We start ADB via init.rc so even if TWRP fails to boot due to some kind of code error that you may have made, ADB should still work. Enjoy!
TWRP and A/B devices:
From a TWRP standpoint, A/B devices aren't a whole lot different from regular devices, but developers seem to be shy about working on these devices. I'm going to try to shed some light on this subject and hopefully this will serve as a guide for porting TWRP to A/B devices.
Firstly, let's understand what is an A/B device and how it's different. A/B devices have duplicates of many partitions on the device. An A/B device has 2x system partitions, 2x boot partitions, 2x vendor partitions, 2x modem / firmware partitions, etc. Only one slot is in use at a time. During early boot, the first stages of the bootloader read some small amount of data called the BCB or Bootloader Control Block and decide whether to boot the A partitions or the B partitions. When an OTA update is available, the data from the active slot is copied from the inactive slot and patched / updated. For example, if you're currently on slot A, your device would download the update and copy the existing system partition from slot A and patch / update it with the new updates into slot B. Once the copying and updating is complete, the BCB is updated and the device reboots using slot B. Next time an update is available, the system partition in slot B is copied to slot A and updated, the BCB gets updated, and we reboot to slot A. When viewing partitions on the device, you'll see something like this:
Code:
/dev/block/bootdevice/by-name/boot_a
/dev/block/bootdevice/by-name/boot_b
/dev/block/bootdevice/by-name/system_a
/dev/block/bootdevice/by-name/system_b
/dev/block/bootdevice/by-name/userdata
/dev/block/bootdevice/by-name/vendor_a
/dev/block/bootdevice/by-name/vendor_b
Note the dual boot, system and vendor partitions in the list above, but only one userdata partition.
While there is technically no requirement that I am aware of, all A/B devices shipped thus far have no separate recovery partition. Instead, the boot image contains the recovery in its ramdisk. The important thing is knowing that the boot image now also contains the recovery. For completeness, the system partition is a full root file system. During boot, if the kernel is told to boot to recovery, it will extract the ramdisk in the boot partition. If the kernel is not told by the bootloader to boot to recovery, then the kernel will mount the appropriate system partition (A or B) because the system partition is a full root file system. This means that the system partition on these devices is mounted to / instead of to /system and the system partition contains all of the files that would have normally been in the boot image ramdisk and a /system subfolder.
From a TWRP standpoint, there are 3 things that you have to do for an A/B device. First, you need to set
Code:
AB_OTA_UPDATER := true
in your BoardConfig.mk. Secondly, for any partition that has an A/B option, you need to add
Code:
flags=slotselect
in your fstab so something like this:
Code:
/boot emmc /dev/block/bootdevice/by-name/boot flags=slotselect
/system ext4 /dev/block/bootdevice/by-name/system flags=slotselect
/system_image emmc /dev/block/bootdevice/by-name/system flags=slotselect
/vendor ext4 /dev/block/bootdevice/by-name/vendor flags=slotselect;display="Vendor";backup=1
/vendor_image emmc /dev/block/bootdevice/by-name/vendor flags=slotselect
Lastly, once you get into TWRP, you will probably want to make sure that bootctl hal-info responds correctly with no errors. Usually the bootctl binary requires a proprietary library or even a couple of services to work correctly. If bootctl does not work correctly, then you will not be able to switch slots within TWRP correctly either.
In addition to setting
Code:
AB_OTA_UPDATER := true
you may also want to set:
Code:
BOARD_USES_RECOVERY_AS_BOOT := true
BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
If you set
Code:
BOARD_USES_RECOVERY_AS_BOOT := true
then make recoveryimage will no longer work and instead you will have to make bootimage. I don't recommend setting either of these flags for TWRP-only build trees. These flags will probably be required for developers building full ROMs for A/B devices.
Installing / Flashing TWRP on A/B devices:
Since all known A/B devices do not have a separate recovery partition, you will eventually have to flash TWRP to the boot partition. On the Pixel 1 and 2, we use fastboot boot to temporarily boot TWRP without flashing TWRP. We are then supplying a zip to allow users to flash TWRP to both slots. You can download one of these zips from our website and update the zip as needed to support your devices. Eventually we will add tools to TWRP to allow users to flash recoveries on these devices without needing to use zips.
Recently, I worked on the Razer Phone. The Razer Phone unfortunately does not support fastboot boot. Instead, users have to determine their currently active boot slot using
Code:
adb shell getprop ro.boot.slot_suffix
then use
Code:
fastboot --set-active=_a
to switch slots to the inactive slot. From here, the user can
Code:
fastboot flash boot twrp.img && fastboot reboot
to get into TWRP. Once in TWRP they can then go to the reboot page and change back to their originally active slot, make a backup, then install TWRP. Using the inactive slot allows users to get a good, unmodified backup of their device before installing TWRP.
Hopefully this helps!
Debugging with gdb in TWRP guide can be found here!
Beep boop zee doop
I know I've PM'ed you but I would like to ask you again. What should I do after compiling the TWRP recovery binary? What files have to be copied and where? I'm trying to integrate it with an ICS kernel.
Dees_Troy said:
Once you get CM sync'ed, I suggest that you go ahead and compile a build of ClockworkMod (ClockworkMod source is included in the CM repos). We usually lunch for the device in question, so something like "lunch full_tenderloin-eng".
After you lunch successfully for your device this is the command used for most devices:
Code:
make clean && make -j# recoveryimage
Click to expand...
Click to collapse
I don't get this part. What is lunch supposed to be? is it supposed to be a individual command for a device or can I do "lunch full_tenderloin-eng" for all devices? Because I am building for a device that doesn't run Android natively (at least out of-the-box) so cyanogenmod doesn't support it on any way...
Also, can I use this for resistive screens? Just to make sure.
Thanks for the guide, I have been looking for this for a long time
thanks for the guide, well structured and not so complicated
i have only a question: i'm trying to build it for galaxy 5, the problem is that the resolution is 320x240, so can you tip me on modify the sources? (i've done this some days ago, but images were too large)
manuel100 said:
thanks for the guide, well structured and not so complicated
i have only a question: i'm trying to build it for galaxy 5, the problem is that the resolution is 320x240, so can you tip me on modify the sources? (i've done this some days ago, but images were too large)
Click to expand...
Click to collapse
Set the device resolution to 320x240...I'm pretty sure they have support for that resolution...and if they don't then you can copy one of there's except resize it all to 320x240
Edit-they only have 320x480 https://github.com/TeamWin/Team-Win-Recovery-Project/
My question: I built twrp from source a while ago using smasher's Samsung inject twrp zip...that worked fine for a while...but recently we switched to mtd format so that inject twrp zip doesn't work...neither does the inhect twrp button within twrp anymore...I've seen that the galaxy s has the same problem as well...just wondering if you know of a work around...
Sent from my SGH-I997 using Tapatalk 2
mg2195 said:
Set the device resolution to 320x240...I'm pretty sure they have support for that resolution...and if they don't then you can copy one of there's except resize it all to 320x240
Edit-they only have 320x480 https://github.com/TeamWin/Team-Win-Recovery-Project/
My question: I built twrp from source a while ago using smasher's Samsung inject twrp zip...that worked fine for a while...but recently we switched to mtd format so that inject twrp zip doesn't work...neither does the inhect twrp button within twrp anymore...I've seen that the galaxy s has the same problem as well...just wondering if you know of a work around...
Sent from my SGH-I997 using Tapatalk 2
Click to expand...
Click to collapse
thanks for respond, however i've tried resizing images to 320x240 but i don't know what should be the size of bottoms, because they are alway out-of-screen
what is smasher's Samsung inject twrp zip? but i think that the recovery doesn't work because you have to built it with mtd support (for ex. on madteam they are trying to build a mtd kernel, but for install that testing rom they built a special cwm with mtd support)
manuel100 said:
thanks for respond, however i've tried resizing images to 320x240 but i don't know what should be the size of bottoms, because they are alway out-of-screen
what is smasher's Samsung inject twrp zip? but i think that the recovery doesn't work because you have to built it with mtd support (for ex. on madteam they are trying to build a mtd kernel, but for install that testing rom they built a special cwm with mtd support)
Click to expand...
Click to collapse
Smashers inject twrp zip is a tool for Samsung devices that let's you get the recovery without flashing the whole kernel. You basically put the ramdisk-recovery.img in the zip and then flash. During the flash process it pulls the boot.img, replaces the current ramdisk-recovery.img with the new one that contains twrp. It then deletes the old boot.img and flashes the new one...not affecting the actual kernel...
The recovery itself has mtd support...I can use it if I flash the whole boot.img, but I don't want to release the recovery within a whole kernel...because then I have to keep it up to date with both twrp and kernel sources, not to mention the different kernels available for my device....I can't make a recovery for each kernel...don't have the time for that...that's where the inject came in handy....the user could use any kernel he wanted while still using twrp
Recovery logs say it fails to find the ramdisk inside the boot.img and then in parenthesis something about may not be using gzip compression...which it is....
Sent from my SGH-I997 using Tapatalk 2
---------- Post added at 07:21 AM ---------- Previous post was at 07:19 AM ----------
Deestroy did this same tutorial on rootzwiki...if you look at the second post you'll see info about the smasher inject twrp I was referring to...http://rootzwiki.com/index.php?/topic/23903-How-to-Compile-TWRP-from-Source
Sent from my SGH-I997 using Tapatalk 2
mfsr98 said:
I don't get this part. What is lunch supposed to be? is it supposed to be a individual command for a device or can I do "lunch full_tenderloin-eng" for all devices? Because I am building for a device that doesn't run Android natively (at least out of-the-box) so cyanogenmod doesn't support it on any way...
Also, can I use this for resistive screens? Just to make sure.
Thanks for the guide, I have been looking for this for a long time
Click to expand...
Click to collapse
can I get help here please?
mfsr98 said:
can I get help here please?
Click to expand...
Click to collapse
Its a single command...it opens up the menu for devices...just type lunch into the terminal and hit enter...you'll see what I mean. You will probably have to add your device to the menu by creating a vendorsetup.sh in your device repo if it doesn't already exist....
Sent from my SGH-I997 using Tapatalk 2
Thank you for the quick answer. Yes, I already have vendorsetup.sh on the boot.img. Sorry for the noob question
What about for android beginners???
Devarishi said:
What about for android beginners???
Click to expand...
Click to collapse
There's only so much that you can dumb it down and simplify it. There's lots of other guides out there for getting started. Compiling a recovery is not a super simple task that anyone and everyone can do and there's plenty of potential pitfalls including the possibility of bricking your device. If none or very little of this guide makes sense, then you might see if a developer for your device is interested in working on it instead.
how would you compile this for a device without an official cm9 build?
azoller1 said:
how would you compile this for a device without an official cm9 build?
Click to expand...
Click to collapse
Well, you don't need official cm9 if you can find any working device tree for you phone you are good to go.. For lg spectrum 4g, this could be useful.
Hey guys I'm trying to compile this for my phone the problem I'm running into is I need the root.ts I've searched and it doesn't come up with anything any help would be appreciated thanks
Sent from my SAMSUNG-SGH-I577 using xda premium
I have a mtk6577 device which is not in de device tree of CM9.
I can compile CWM for my device with CM9. Because I was only making recovery, there was no need for setting up boardconfig.
In this guide there is a part starting with TARGET_RECOVERY_INITRC which is not there in my boardconfig.
Also is stated:
"Your board config also needs to include architecture and platform settings. Usually these are already included if you're using device configs that someone else created, but if you created your own, you may need to add them. Without them, recovery will often seg fault during startup and you'll just see the teamwin curtain flash on the screen over and over."
Does this mean that I cannot build TWRP without it, even I can build CWM ?
gls9 said:
I have a mtk6577 device which is not in de device tree of CM9.
I can compile CWM for my device with CM9. Because I was only making recovery, there was no need for setting up boardconfig.
In this guide there is a part starting with TARGET_RECOVERY_INITRC which is not there in my boardconfig.
Also is stated:
"Your board config also needs to include architecture and platform settings. Usually these are already included if you're using device configs that someone else created, but if you created your own, you may need to add them. Without them, recovery will often seg fault during startup and you'll just see the teamwin curtain flash on the screen over and over."
Does this mean that I cannot build TWRP without it, even I can build CWM ?
Click to expand...
Click to collapse
Look for another mtk6577 device that has CM & copy the arch flags from it.

[RECOVERY] JCSullins' Touchpad CWM6 v6.0.1.9 [2012-12-15] Edit: 1-31-13

DISCLAIMER: I'm not a dev, nor do I play one on t.v. Use the information and links at your own risk. READ and UNDERSTAND what your doing before flashing is the best bet.
I take no responsibility or credit for the information.
The OP is primarily just quotes/links from JcSullins over at RootzWiki about his current CWM Recovery v 6.0.1.9.
This thread is NOT intended as a walk through of a first time install of Android/CM on the Touchpad. There are several threads on Xda and RootzWiki for that.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
Rootzwiki version of this thread
CONTENTS: (See RolandDeschain79's CWM6 Video)
Post 1 - JcSullins fixed CWM6, installable from Acme3 or Recovery. (Scroll down)
Post 2 - Background on file system corruption/inode errors with CWM5 and early TWRP recoveries.
Post 3 - Moboot 3.5 and Moboot 3.8 background and issues with TWRP recovery.
Post 4 - How to Clean Install / Dirty Install Rom Updates using CWM6 after first install with Acme3.
Post 5 - Basic info for using CWM Recovery.
Post 6 - CM9/CM10 First Time Install Links (not all inclusive)
NEW CWM6 Setting: Dedupe (.dup) vs .tar backups. See post 5 for how to change the setting and read Koush's Explanation.
The Fixed CWM6 (2012-12-15) From RootzWiki AcmeInstaller3 thread Post 204
JcSullins said:
OK, fixed CWM6 update package has been "officially released"
JcSullins CWM Recovery v6.0.1.9 Goo.im Download
(Mpg2 Edit: Use the 12/15/2012 version because the script is setup to work with BOTH AcmeInstaller AND a previously installed Recovery)
Any CWM users should upgrade to this version (including those who installed the CWM6 testing from a few days ago).
Note that it will remove any existing uImage.ClockworkMod or uImage.TWRP before install.
Click to expand...
Click to collapse
From Rootzwiki Post 209
jcsullins said:
You can install with whatever recovery you currently have installed.
The version number it shows is 6.0.1.9.
Two things to check that it is correct version:
1) Selecting "install zip from sideload" from main menu will give a "Not implemented." message
2) In the "Backup and Restore" menu, you will see "choose default backup format" at the bottom (not "choose backup format")
To make sure that all the filesystems are "clean", I would suggest doing the following after it is installed:
1) go to 'backup and restore', select 'backup' (might take a little while)
NOTE: DO NOT CONTINUE WITH NEXT STEPS IF BACKUP FAILS FOR SOME REASON
2) go to main menu and select "mounts and storage"
3) select "format /cache"
4) select "format /data"
5) select "format /system"
6) go to main main, then select "backup and restore", then select "restore" and select the backup you just made
Click to expand...
Click to collapse
Thread continues Rootzwiki Post 211
Mpgrimm2 said:
JcSullins, thanks for your previous post about cm6. I had just posted this earlier when i found this thread....
My understanding from your previous post is that a fresh format with the newer Cwm6 you just posted will correct any file system/inode corruption. Am I correct?
Click to expand...
Click to collapse
jcsullins said:
Yep, that's correct.
Click to expand...
Click to collapse
Background: File system corruption/inode errors
Background: File system corruption/inode errors from RootzWiki Acme3 thread Post 102
jcsullins said:
The "Fix Recovery" commit - http://review.cyanogenmod.org/26596 - fixed the building
of recovery as part of standard build process.
http://review.review.cyanogenmod.org/#/c/26704/ plus review.cyanogenmod.org/#/c/26705/
is the fix for the filesystem corruption. If you build a recovery for the Touchpad (or know
someone who does), please make sure you/they include these two commits.
Click to expand...
Click to collapse
jcsullins said:
This issue was initially discovered in the days of CM7 when I created scripts to resize the /data partition. Several people were having trouble
using them because the filesystems check (fsck) on /data would fail. After some testing, I discovered that ext4 filesystems created with make_ext4fs
from system/extras/ext4_utils would fail a "fsck -fn <block_dev>" check immediately after creation with numerous inode errors. As far as we knew,
there was never any "real" data corruption. The problem seemed to only surface when doing a fsck required for doing a filesystem resize.
The issue resurfaced when we needed to resize /system for jellybean installs. Luckily, with the jellybean version of ext4_utils, I was able to uncover
the real source of the problem (make_ext4fs assumed our kernel supported ext4_lazyinit when it doesn't) and the fix (see above).
I tested TWRP v2.3.1.0 for tenderloin and it had the issue. I contacted Dees_Troy about rebuilding a fixed TWRP. Turns out that the TWRP for
tenderloin is not built using the jellybean source, so the above fix would not apply. However, he changed TWRP to use mke2fs instead of make_ext4fs to work around the issue.
In short, TWRP v2.3.2.3 for tenderloin does not have the issue. It is the current version available from http://teamw.in/project/twrp2/75
NOTE: The link on that page says it's v2.3.1.0 when it's really v2.3.2.3 it downloads.
Click to expand...
Click to collapse
Moboot 3.5 and Moboot 3.8 background and issues with TWRP recovery.
By now you should also be using the latest CWM6 (12/15/12) or latest TWRP (2.3.3.0+) due to files system corruption issues. If you use Cwm6, I recommend Moboot 3.8 as well.
Twrp & Moboot 3.8 summary ...
Moboot 3.8 is still considered a "Testing" version but allows correct device S/n reporting to android OS needed for certain apps/games like Asphalt 7 etc. There are no issues reported (yet) when used with cwm6 because it has always used sdcard/clockworkmod/ for backups.
TWRP uses your device S/N (000000000 on Moboot 3.5) to create the folder where backups are stored, when you update to Moboot 3.8, TWRP will be looking at a new backup folder (ie 12345678) and won't see your previous TWRP backups. This is not an issue on all future backups (or if you started with Moboot 3.8). If needed you can use a file browser to move the old TWRP backup files to the new S/n folder and it has been reported to work.
(Note: I have not tried TWRP on the Touchpad, but I have used it on other devices).
JcSullins' Moboot 3.5 (Last stable version)
JcSullins' Moboot 3.8 (Testing version)
Moboot 3.8 has been setup to be flashed from either Acme3 or the installed recovery (ie CWM6).
For download links and more info, I created a dedicated thread: [INFO] on JcSullins' Moboot versions (& Version Poll)
Currently... If you have 'ever' installed (ie originally) with AcmeInstaller3 you don't have to use it or AcmeUninstaller anymore for regular installs or updates, you can use the latest Cwm6 or TWRP 2.3.3.0 using either the clean install or dirty install that I detail below. If you get your install all hosed up, Acme is still the best way to clean out all the garbage, by completely removing (AcmeUninstaller) and reinstalling android (AcmeInstaller3).
Using AcmeUninstaller/AcmeInstaller3 method works well and is considered the 'tried & true' method because of issues with prior recoveries.
Prior versions of Acme(1&2) created a system partition size of 300mb which was appropriate for cm7/9. Cm10 needs about 350mb or more so Acme3 is needed because it sets the size of partition to 400mb AND formats without all the corruption/inode errors that occurred when formatting with prior recoveries (cwm5 & TWRP 2.1.x) hence "tried & true".
Per JcSullins (See the OP) if you perform a format of the 3 partitions with Cwm6 (& implemented in TWRP 2.3.3.0) it will correct any corruption issues (so u don't need to rely on Acme for a correct format once it has set the correct partition size).
To summarize,
if your system partition was previously sized to 400mb with Acme3, then yes, formatting and flashing with CWM6 will work correctly.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Note: Cwm6 12-15-2012 and Moboot 3.8 zips can be installed from your current recovery as well as being installed via Acme3. If you have already installed CM via Acme3 (provides 400mb system partition size needed for future installs of CM10), and have Moboot 3.8 (optional but recommended) and CWM6 (not optional, need this version or latest TWRP 2.3.3.0), then...
How to Clean Install / Dirty Install Rom Updates using CWM6 after first install with Acme3.
Step 1 (backup & format)
- Make a backup of your current CM9 install (See next post for details on using CWM6)
- Format/wipe ... system, data & cache (via Cwm6)
(ensures there isn't any file system corruption left over from prior recovery versions)
Step 2 Option 1 (clean install)
- flash CM9 and ICS Gapps zips via CWM6
(or CM10 & JB Gapps)
- Reboot, re-run CM setup
Step 2 Option 2 (Dirty install)
- "Backup and Restore" -> "Advanced Restore" -> select your CM9 backup -> "Restore data"
(advanced restore of cm9 data only)
- flash CM9 and Gapps zips via CWM6
(or CM10 & JB Gapps)
- Reboot, (should have all your apps and settings)
-------------------------------------------------------------------------------------------------------------------------
Some may disagree with me but I have never considered wiping Cache/Dalvik Cache a "Clean Install".
(using AcmeUninstall/AcmeInstaller3 would be a clean install too).
Clean Install vs Dirty Install Rom/Updates via Recovery: (After initial install with Acme3)
Generally, if your recovery is working right (each one has had issues at some point in it's development on every device I've had), the typical steps I've seen...
"Clean installing" a rom usually means to format the 3 basic partitions (& sometimes the /boot too depending on the rom/kernel script) and flash the rom as recommended by most devs to avoid issues (some rom installer scripts will handle the formatting for you, but shouldn't be assumed unless stated by the rom's developer. 9-14-13: See Attachment for example).
"Dirty Installing" a rom typically involves formatting the system & cache (sometimes only the cache :thumbdown: ) and flashing a rom to preserve /data partition with user apps & settings.
A cleaner method for this is to format all 3 partitions, flash rom, and restore only /data from a backup.
I've rarely seen dirty installs recommended by devs, but when I have seen them say it was "OK to try", it was done on the same rom/firmware base between incremental rom updates only (vs b/w CM7 - CM9 or CM9 - CM10, etc), and if you had a bug, you needed to go back and do a clean install before reporting it or expecting help. I will add that many people have been successful restoring their CM9 data after flashing CM10 & Gapps.
Basic CWM Recovery Info
CWM Recovery Backup, Format/Wipe, Restore, & Flash: ! MAKE SURE YOU READ THE NOTES IN THE OP AT THE TOP FIRST !
You CAN get into RECOVERY by: pressing [pwr] and selecting "boot ClockworkMod" from the bootloader (Moboot) when powered off.
You CAN get into RECOVERY by: holding [pwr], selecting "Reboot", then "Recovery" from within CM9/10.
Sdcard/clockworkmod/ (This is the folder CWM Recovery creates/uses.)
________________ /backup (recovery's backup of /system, /data, /boot.img, etc. are saved here by date. You can edit the filename.)
________________ /download (If you use CWM Rom Manager, it will place its downloads here. I've never used it.)
After the device has a Custom recovery, the recovery can be used to:
1) Flash/install .zip files:
- New/rooted kernels, including boot.img files (controls how the o.s. works with hardware)
- Roms (complete /system & /data file with kernel, custom apps, modded settings)
- Bootanimations (should be correct resolution)
- Other system improvements
- Themes (modify look of device/menus etc. Usually specific to each device (ie HP TP) & FW/Rom Base (ie CM9 vs CM10)
Must clear "dalvik cache" & may need to flash "deodexed template" or deodexed Rom, boot to system, before flashing each theme).
2) Make .tar(or dedup) backups of /system, /data, & /cache. Also backs up /boot ( boot.img or Kernel), and some versions may backup /recovery (recovery.img ), /wimax (wimax.img ) if available, that can be restored, usually together.
Note: Format the appropriate partition before restoring. (Usually format/wipe the first 3.)
It’s a good idea to make an initial backup right after you install the custom recovery. Then you can just format, restore the backup, if things get messed up.
3) Format/wipe the 3 main partitions and flash other partitions (depending on recovery version):
/system (o.s., system apps)
/data (google acct, app & phone settings, downloaded/installed apps)
/cache (used by o.s. to access info/apps, includes "/dalvik cache")
Android Partitions Explained
----------------------------------------------------------------------------------------------------------------------------------------
Controls:
[ Vol Up/Dwn ] = move or highlight selection
[ Home ] = select item/option
Note: On CWM Touch versions HW controls may still work.
How to Flash a Zip (Generally):
Place the .zip on the SDcard (or Sdcard/zip or similar folder of your choice)
Boot to recovery.
-> WIPE CACHE (habit of mine)
-> INSTALL ZIP FROM SD CARD -> CHOOSE ZIP FROM SDCARD
(navigate to where the zip is and select it)
-> REBOOT SYSTEM NOW (may need to "Go Back" to get to reboot option)
How to flash a rom (Generally):
- Make a backup in recovery first (/system, /data, /cache, etc.)
- Format/wipe the 3 partitions as appropriate.
(some Rom zips will do this for you, but may require a specific recovery coding such as “Edify” in CWM).
- Flash the Rom.zip (and any supplements like Gapps)
- Reboot to system, let it load, Verify functions
How to flash a theme (Geneally):
- Go to recovery, Wipe " Dalvik Cache ",
- Flash the " Stock Deodex Template" or Deodexed Rom (Depending on your version)
- Reboot to system, let it load, Verify functions
- Go To recovery, ADVANCED, Wipe "dalvik Cache"
- Flash the theme you want, ie GreenSteel.zip
- Reboot to system, let it load, Verify functions
Note: Anytime you wipe cache/dalvik cache it will take longer to boot the first time (ie Android is Updating).
Back up & Restore your file system with CWM recovery (DETAILED)
1 - (Enter Recovery)
-> BACKUP AND RESTORE -> BACKUP (This will separately backup: boot.img, /system, /data, /cache, wimax.img, etc)
Note: If you prefer the dedupe (.dup) backup format over .tar (default) and want to change the setting,
go to -> CHOOSE DEFAULT BACKUP FORMAT (before creating your backups)
* NOTE: you can stop here if you just want a backup*
2- (Format Manually through Recovery)
-> WIPE DATA/FACTORY RESET ( this will format the DATA & CACHE partitions for you in one shot )
-> MOUNTS AND STORAGE -> FORMAT SYSTEM
-> FORMAT DATA (Optionally there if needed, i.e. to restore only data partition)
-> FORMAT CACHE (Optionally there if needed)
4- (Restore Manually through Recovery)
-> BACKUP AND RESTORE -> CHOOSE YOUR BACKUP
-> RESTORE (This will restore all parts of the backup: /system, /data, & /cache, /boot [ boot.img or Kernel], /recovery [recovery.img], /wimax [wimax.img], SD-EXT if setup )
Note: If there is more than one, the numbers are a date/time stamp (ie: 2012-02-16.06.14.40 is Feb.16, 2012 at 6:14AM), so choose the appropriate one.
I typically change the name later, ie: "2012-02-16 CM9andApps".
(9-14-13 edit: Changing the name in newer CWM recoveries may create "MD5 checksum" errors and prevent a restore. Needs verified).
4.1- ADVANCED OPTION (Restore portions of backups individually, typically used to restore /data after Rom Update)
-> ADVANCED RESTORE -> CHOOSE YOUR BACKUP IMAGE ( /system, /data, /cache, /boot, /recovery, /wimax, SD-EXT)
-> RESTORE
5- (Reboot)
-> REBOOT SYSTEM NOW (may need to "Go Back" to get to reboot option)
CM9/CM10 First Time Install Links
CM9/CM10 First Time Install/Discussion threads
(XDA) Roland Deschain's How to install jcsullins CM10 Unofficial Build 20121216, with Sound, Camera & Microphone
(Also has Cm9 install info and zip packages with all current files.)
(Rootz) Nevertell's CM9 Install Directions in Post 19 of Newbie Questions thread
(@ NT, this is worthy of it's own thread or rolled into the OP of Travis' CM9 thread)
(Liliputing) How to install Android 4.0 or 4.1 on the HP TouchPad (CyanogenMod)
(This is a great guide and the one I originally used, but the linked install files for AcmeInstaller3, Cm9/10, Gapps, Moboot 3.8, & Cwm6 are out of date)
JcSullins' HpTouchpad Goo.im folder
(source for many current files: Cwm6, Moboot, Acme3, AcmeUninstaller, CM10.0 Experimental, etc)
Official CyanogenMod 9 HpTouchpad Downloads
(Click the "Nightly" link for now)
Latest Goo.im Google Apps Downloads
(Must match your CM base, ie CM9, CM10.0, CM10.1)
CM9/CM10 Support/Discussion Threads
(Rootz) Travisross69's [ROM] Official CyanogenMod 9 Nightly Build Discussion
(Rootz) Roland Deschain's How to install jcsullins CM10 Unofficial Build 20121216, with Sound, Camera & Microphone
(Xda) Imfloflo's [NIGHTLY] [ROM] CyanogenMod 9
(Xda) BigSimon's [ROM] [12/16] Unofficial CM10 Preview by Jcsullins Now with sound+camera
mpgrimm2 said:
one more post for me
Click to expand...
Click to collapse
What is this all about ?
Menthe is MIA on his JcSullins CWM6 thread since Dec 7th. I requested (Dec 20th) to take over the thread but the Mods recommended I just create a new one and they would merge it. I waited long enough and I think people may find the info useful if they don't want to use a pc/Acme3 to do all their rom updates/nightly's. I will duplicate this over at Rootz once I am all setup.
this is a lot of useful info. thanks for putting it together
Re: [RECOVERY] JCSullins' Touchpad CWM6 Recovery v6.0.1.9 [2012-12-15]
mpgrimm2 said:
Menthe is MIA on his JcSullins CWM6 thread since Dec 7th. I requested (Dec 20th) to take over the thread but the Mods recommended I just create a new one and they would merge it. I waited long enough and I think people may find the info useful if they don't want to use a pc/Acme3 to do all their rom updates/nightly's. I will duplicate this over at Rootz once I am all setup.
Click to expand...
Click to collapse
I'm sorry I'm a little lost I am new to this thread but I am NOT new to the touchpad nor xD a when did you have to use a computer to update CyanogenMod I didn't know people needed to do that because I just do it right through my touchpad. I am so glad I came to the threads because I thought only cm mod was available. Now only if I port gay bi sorcery over here this would be crazy it is the best rom out there it has more tweaks than every other ROM combined literally. It's so large and crazy it ca there is a central server for a lot of the mods an tweaks because it would be too large
Sent from my cm_tenderloin using xda premium
Crwolv said:
I'm sorry I'm a little lost I am new to this thread but I am NOT new to the touchpad nor xD a when did you have to use a computer to update CyanogenMod I didn't know people needed to do that because I just do it right through my touchpad. I am so glad I came to the threads because I thought only cm mod was available. Now only if I port gay bi sorcery over here this would be crazy it is the best rom out there it has more tweaks than every other ROM combined literally. It's so large and crazy it ca there is a central server for a lot of the mods an tweaks because it would be too large
Click to expand...
Click to collapse
Post 2 & 4 give a basic background on the issue. Basically, early recoveries were creating file system corruption when formatting partitions. It didn't always produce noticeable problems, but it was there. The workaround was to use AcmeInstaller3 from a PC for installs/updates and then restore a backup from within Recovery. Acme3 reformats the partitions correctly and would list/scroll all the file system errors before it fixed them (sometimes taking 15 - 20 mins to finish). Jc's CWM6 fixed the problem so it's ok again to do everything from recovery.
Remember you move to CM10, your system partition size needs to be @ 400mb (done initially with Acme3).
I'm not sure what the rest of your post is about.
Added Roland's Video and link to Koush's explanation of .dup vs .tar backup settings.
Just for grins and giggles (and with limited script reading skills), I decided to have a look at the installer script in TP CM9/10 zip package and found the following.
Code:
unmount("/system");
show_progress(0.500000, 0);
format("ext4", "EMMC", "/dev/store/cm-system", "0");
mount("ext4", "EMMC", "/dev/store/cm-system", "/system");
This confirms the fact that the CM9/10 zip will format ONLY the system partition for you during install, so if u want a clean install all that is needed (for CM9/10, not necessarily all roms) is to do a "wipe data/factory reset" (formats /data & /cache) and flash the zip.
So if u are just upgrading from a prior CM "nightly" to the current one, you can do a simpler "dirty install" by wiping/formatting cache and flashing the CM zip to retain your data (this assumes u have no file system corruption from earlier recoveries on your data partition).
I still stand on my general steps for "clean" & "dirty" installs via recovery since there isn't a guarantee that the rom developer setup the installer to do any formatting for you like CM9/10 does. The extra format shouldn't hurt in the long run (before the TP is obsolete anyway).
Sent from my "Up all night, sleep all day" HP CM9 Touchpad
sorry, it's a badly written post
1. Have to include a changelog
2. whether it's beneficial...
stayfidz said:
sorry, it's a badly written post
1. Have to include a changelog
2. whether it's beneficial...
Click to expand...
Click to collapse
PLease explain this statement better.
Are you referring to my OP, the previous post above yours, the whole thread, etc. Did you read through the thread and the "background" section to know what was going on with the TP recoveries before JcSullins' fixed it (not me or my work) or just look for a download link?
mpgrimm2 said:
PLease explain this statement better.
Are you referring to my OP, the previous post above yours, the whole thread, etc. Did you read through the thread and the "background" section to know what was going on with the TP recoveries before JcSullins' fixed it (not me or my work) or just look for a download link?
Click to expand...
Click to collapse
Hi, to the whole post, we're not all geeks by nature
1. By the way, what this recovery fixes, adds?
thanks again
You don't have to be a geek to "read and understand what you are doing first" (first statement in the op) before modifying your device. All users are expected to read and learn even a little bit. No one is going to spoon feed it to you.
Perhaps I am wrong, but it sounds like you are not bothering to read through posts 1 & 2. This thread isn't hundreds or thousands of posts long. There is even a link to a video by Roland Deschain about this Cwm6 next to the "contents" and an explanation on .dup vs .tar backups by Koush after the "contents".
Myself and others will help, but you have to be willing to roll up your sleeves and read a bit then come back with a question if u still actually have one.
Sent from my "Up all night, Sleep all day" EVO3D!
This was informative. I had no idea that there was a file corruption problem with older recoveries. That would explain a lot of issues I had. Just completely wiped my Touchpad back to factory (webOS default) then used ACME 3 to get CM10 back on with CWM6. Hope that solves my random issues. Thanks!
All the goo.im links are dead. Any other way to get this?
buddhag33k said:
All the goo.im links are dead. Any other way to get this?
Click to expand...
Click to collapse
Yes, head over to RolandDeschain's thread and download one of the cminstall.zip packages, its included in there.
[ROM GUIDE] How to install Jcsullins CM10/CM10.1 Unofficial Builds
Edit: Goo.im appears to be doing updates. Some of the files are back.
.

[Treble][Rom]Lenovo zenui 5.0 for redmi note 6 pro

I found our device is treble supported type-A partition
So here i found (gsi) zenui 5.0 need to test
INSTALL
* Enable Treble > Flash a Fully-Trebled 8.1 ROM or just wipe data,cache,system
Mount the system, go to the system / etc directory backup selinux folder
Flash fbe disabler and permissiver
Wipe everything except vendor
Flash zui system flashme . zip
Mount system and vendor
Flash all patches
Flash sound fix
Mount the system to copy the selinux folder backed up in advance to the /system/etc directory.
Flash magisk if u need
* first reboot may take some time
Bootloop Fix:
- If you still have bootloop or systemui fc format data
Bugs:
- Nothing
(I'm not developer)
Android Version
- 8.1 Oreo
DOWNLOAD
https://mega.nz/#F!af4xQIKa!Ffz3u-9MOtFmxbDFUk9ZZg
PATCHES
https://share.weiyun.com/5khJ8F9
Thanks for sharing
thank for shearing but do you install it (screenshot?)

[TESTERS][WIP] Flashable zip to increase SYSTEM partition (Solving Gapps Error 70)

Update 10/26/20:
I didn't worked anymore on this (from january) since there doesn't seem to be much interest on it on Dior's official Telegram Group, but I'm seeing that some people tried to flash the test zip that I had on my bitbucket (altought it wasn 't officially released).
The script works on my device as you can see in the attatched pictures, but needs further testing to solve possible issues it might have with slightly different Dior versions (I don't wanna brick anyone's device).
All that said: I can write some Instructions to flash it if someone is willing to try (at his own risk).
This kind of modifications may potentially brick your device, although risk is reduced to minimum.
Original 1/9/20:
Hi guys,
I'm making a flashable zip for dior to repartition system and give us more space taking it from data partition (this will let us install open_gapps without error 70 on android oreo or pie roms) based on the work by CLAMOR, an Unlegacy Android dev (https://forum.xda-developers.com/nexus-4/orig-development/repartition-nexus-4-repartition-t3844383 ).
I'm gonna need someone with unmodified system partition (if you didn't manually repartitioned it like me, you can help me) and some basic skills: flash a zip in twrp that creates a log file in the root of internal memory (and don't modify anything of your phone), open that log and screenshot or send it to me.
I manually modified the partition table on my dior so mine is no good to check stock partition table.
With that log I can make the flashable zip able to repartition our phones back to stock partition table if anytime is needed.
Download:
- Here's the zip I need you to flash: https://forum.xda-developers.com/devdb/project/dl/?id=30446 (It will not modify or touch anything on your device, only creates a log)
You can see on the pictures that my system partition is bigger and has enough space to install almost any open_gapps package (400mb free after install mokee 9.0 experimental build)
The scripts are almost finished, with your help I will be able to finish it very soon!
Source Code: https://bitbucket.org/endlssprdx/dior-repartition-script/
Credits:
- Unlegacy Android Team
- Clamor (https://forum.xda-developers.com/member.php?u=5424240 )
Hi! Thanks for your work! Is the zip flasheable ready? I'm trying to upgrade the phone but system partition is too small. Any help would be great.
Thank you.
Enviado desde mi LG-H850 mediante Tapatalk
Log System Partition
Hello,
Here information that you requested, I need resize partition system, please you help me!!!
My phone is XIAOMI REDMI NOTE 4G SINGLE SIM DIOR (first generation)
Rom installed Mokee MK71.2-dior-190228-HISTORY.
Gapps: open_gapps-arm-7.1-pico-20200612
status: Works fine, I force installation of gapps but System is insufficient so system is to limited and after days the rom crashes or dropped with failures services play google.
Model: MMC 008GE0 (sd/mmc)
Disk /dev/block/mmcblk0: 7818182656B
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 17408B 2097151B 2079744B sbl1
2 2097152B 4176895B 2079744B sbl1bak
3 4176896B 5225471B 1048576B rpm
4 5225472B 6274047B 1048576B rpmbak
5 6274048B 7322623B 1048576B tz
6 7322624B 8371199B 1048576B tzbak
7 8371200B 8379391B 8192B ssd
8 8379392B 9427967B 1048576B sdi
9 9427968B 10476543B 1048576B DDR
10 10476544B 14670847B 4194304B aboot
11 14670848B 18865151B 4194304B abootbak
12 18865152B 24108031B 5242880B bk1
13 24108032B 28302335B 4194304B misc
14 28302336B 36690943B 8388608B logo
15 36690944B 67103743B 30412800B bk2
16 67103744B 68676607B 1572864B modemst1
17 68676608B 70249471B 1572864B modemst2
18 70249472B 70250495B 1024B fsc
19 70250496B 134212607B 63962112B bk3
20 134212608B 135785471B 1572864B fsg
21 135785472B 167767039B 31981568B bk4
22 167767040B 201321471B 33554432B bk5
23 201321472B 268430335B 67108864B fat16 modem
24 268430336B 285207551B 16777216B boot
25 285207552B 301984767B 16777216B recovery
26 301984768B 335539199B 33554432B ext4 persist
27 335539200B 1174399999B 838860800B ext4 system
28 1174400000B 1577053183B 402653184B ext4 cache
29 1610612736B 7818165759B 6207553024B ext4 userdata
after flashing your zip (https://bitbucket.org/endlssprdx/dior-repartition-script/downloads/) and writing "modify" in terminal as per instruction, twrp now fails to mount all partition except system and now I can't do anything
abhi21sept said:
after flashing your zip (https://bitbucket.org/endlssprdx/dior-repartition-script/downloads/) and writing "modify" in terminal as per instruction, twrp now fails to mount all partition except system and now I can't do anything
Click to expand...
Click to collapse
Hey, sorry for the delay.
Did you solved or do you still have problems? I didn't worked on this script since january (people didn't showed many interest on it on official Dior's Telegram Group).
The script itself needs a little bit of testing but works on my Dior (I didn't released officialy so that's why there isn't any instructions).
What you're facing it's normal:
After flashing it with the "modify" command, it's mandatory to format everything in your phone. (mount errors will not affect formatting)
- In TWRP: Wipe > Format data
- Type yes
- Once this completes go to: Wipe > Advanced Wipe
- Tick all the boxes and wipe. There should be no further mount errors.
After doing this and maybe rebooting TWRP you should be able to mount every partition and check your new System increased space:
TWRP > Wipe > Advanced Wipe > Tick System > Repair or change filesystem > And then you will be able to check it at "Size:".
If it shows the old size that's normal, do a "Repair File System" and "Resize File System". It should show the increased space now.
From now on, after installing a new rom (before flashing gapps or anything else), you probably need to do this too (repair and/or resize system partition filesystem).
This happens because our TWRP still believes that the system size is the stock one (we need a modified TWRP with increased system partition info to solve this, but I dunno how to do it).
If you want to go back to stock system size all you have to do is reflash the script, now it will promt you to type "stock" instead of "modify" on twrp terminal. (Also need to format everything as I said earlier when back to stock).
I hope you would be able to solve your problem
lusagad01 said:
Hi! Thanks for your work! Is the zip flasheable ready? I'm trying to upgrade the phone but system partition is too small. Any help would be great.
Thank you.
Enviado desde mi LG-H850 mediante Tapatalk
Click to expand...
Click to collapse
herreradimas said:
Hello,
Here information that you requested, I need resize partition system, please you help me!!!
My phone is XIAOMI REDMI NOTE 4G SINGLE SIM DIOR (first generation)
Rom installed Mokee MK71.2-dior-190228-HISTORY.
Gapps: open_gapps-arm-7.1-pico-20200612
status: Works fine, I force installation of gapps but System is insufficient so system is to limited and after days the rom crashes or dropped with failures services play google.
...
Click to expand...
Click to collapse
I didn't worked anymore on this since january, but works fine on my device (it need more testing to solve possible issues, didn't wanna brick anyone's device). There's a flashable zip available on my bitbucket if someone wants to test at his own risk. I can give you instructions on how to flash it and how to flash roms in the future with the extended system partition, but I didn't released it officially and will not make me responsible if something goes wrong. The script may potentially brick your device, although risk is reduced to minimum.
PS: Although I'm not working on this anymore, wanna thank you herreradimas, you are the second person since January that sent me the logs I needed to finish it hahhaha
endlssprdx said:
Hey, sorry for the delay.
Did you solved or do you still have problems? I didn't worked on this script since january (people didn't showed many interest on it on official Dior's Telegram Group).
The script itself needs a little bit of testing but works on my Dior (I didn't released officialy so that's why there isn't any instructions).
What you're facing it's normal:
After flashing it with the "modify" command, it's mandatory to format everything in your phone. (mount errors will not affect formatting)
- In TWRP: Wipe > Format data
- Type yes
- Once this completes go to: Wipe > Advanced Wipe
- Tick all the boxes and wipe. There should be no further mount errors.
After doing this and maybe rebooting TWRP you should be able to mount every partition and check your new System increased space:
TWRP > Wipe > Advanced Wipe > Tick System > Repair or change filesystem > And then you will be able to check it at "Size:".
If it shows the old size that's normal, do a "Repair File System" and "Resize File System". It should show the increased space now.
From now on, after installing a new rom (before flashing gapps or anything else), you probably need to do this too (repair and/or resize system partition filesystem).
This happens because our TWRP still believes that the system size is the stock one (we need a modified TWRP with increased system partition info to solve this, but I dunno how to do it).
If you want to go back to stock system size all you have to do is reflash the script, now it will promt you to type "stock" instead of "modify" on twrp terminal. (Also need to format everything as I said earlier when back to stock).
I hope you would be able to solve your problem
Click to expand...
Click to collapse
After flashing your script when everything became 0mb I formatted every partition but data and cache partitions still failed to mount so I reflashed your script and flashed stock fastboot rom

[TOOL][UNOFFICIAL][PORT] REPIT: for Nexus 7 (2013) [deb][flo]

This is a port of Lanchon REPIT.
- Nexus 7 (2013) Deb (LTE) and Flo (WiFi) -​
Disclaimer:
I am not responsible for your actions or consequences, directly or indirectly, related to the files and/or advice offered.
It is your choice to proceed.
What is REPIT?
REPIT is a simple, safe, device-only, data-sparing, and easily portable repartitioning tool for Android devices.
See the GitHub README for more on What REPIT is. GitHub - Link
Limitations:
Requires TWRP (or TWRP based) recovery.
Does not support encrypted devices.
Will cause data loss if the repartitioning process is externally interrupted.
See the GitHub README for more on Limitations. GitHub - Link
---
Notes:
A few years ago (September 2018), I made a port of REPIT for deb,flo and manta that was spread out between multiple threads.
Some comments and instructions were lost in thread chatter or just in a different thread altogether.
The file name actually configures the repit script.
Noted that you may have to toggle MTP Disable, Enable, Disable.
Noted that you may have to reboot into TWRP after disabling MTP.
Remember /tmp is wiped after a reboot. Copy repit to /sdcard and after rebooting back into TWRP, copy it from /sdcard to /tmp using TWRP File manager.
Noted that you may have to unmount cache and data.
Do NOT flash repit from USB/OTG.
This is designed for a stock partition layout. If your device has been modified and a vendor partition was created, REPIT will not work.
Side note:
Lanchon added Nexus 7 (2013) to the official list. (November 2019)
Lanchon REPIT GitHub - Port Request - Commit
---
Be Careful.
There are always risks involved when you start messing around with a device.
If something goes wrong, you may end up with a non-working "bricked" device.
This is especially true when you start modifying partitions.
Backup what you want to save and store it off device.
Copy it to your computer, cloud storage, USB, ...
Instructions:
This operation might take a long time and must not be interrupted.
- Depending on the device and REPIT configuration, this might take a few hours.
Make sure your battery is fully charged or mostly charged.
- You can connect to a charger while the REPIT script is running. May or may not charge depending on the recovery.
How To:
If you already have a ROM installed, repit will backup, change the partition, restore and resize.
- You can just reboot once the script finishes.
Boot into TWRP
Swipe to Allow Modifications
Copy the repit zip to /tmp
Disconnect from computer
Disable MTP
Disable MTP TWRP -> Mount
Install repit
TWRP -> Install -> navigate to /tmp and flash the repit zip
Reboot to system
If you are doing a clean install, add the +wipe option to system in the zip file name. This will speed up the partitioning since system will not be backed up and restored.
lanchon-repit-20210220-system=max+wipe-cache=16M+wipe-flo.zip
- Reboot back into TWRP after the script finishes.
- Then follow the instructions from the rom thread to install the rom you are going to use.
Boot into TWRP
Swipe to Allow Modifications
Copy the repit zip to /tmp
Disconnect from computer
Disable MTP
Disable MTP TWRP -> Mount
Install repit
TWRP -> Install -> navigate to /tmp and flash the repit zip
Reboot to recovery
Follow the instructions from the rom thread to install the rom you are going to use.
---
Changes:
Nexus 7 (2013) [Deb][Flo]
Pushed a bit pass the safe zone and claimed a bit more unallocated space.
Updated to the current REPIT scripts.
Separate zip files for deb and flo.
Nexus 7 (2013) GitHub - Commit
Download Links:
MediaFire - Link
SourceForge - Link
GoogleDrive - Link
Direct Download from MediaFire:
lanchon-repit-20210221-system=max-cache=16M+wipe-deb.zip MediaFire - Download
lanchon-repit-20210221-system=max-cache=16M+wipe-flo.zip MediaFire - Download
REPIT Links:
Lanchon REPIT GitHub - Link
- My fork GitHub - Link
Credits:
Lanchon for his excellent REPIT project.
The Android Community and everyone who has helped me learn through the years.
Cheers all.
Note about configuration.
The user configuration is done by renaming the zip file before flashing it.
Not much room to change on deb/flo.
The modifiable partitions are only system and cache (22 and 23).
The actual partitioning is done by a sector range. This is declared inside the script along with a default configuration.
Code:
# the set of partitions that can be modified by REPIT:
# <gpt-number> <gpt-name> <friendly-name> <conf-defaults> <crypto-footer>
initPartition 22 system system "same keep ext4" 0
initPartition 23 cache cache "same keep ext4" 0
initPartition 24 misc misc "same keep raw" 0
# the set of modifiable partitions that can be configured by the user (overriding <conf-defaults>):
configurablePartitions="$(seq 22 23)"
...
# the set of contiguous partitions that form this heap, in order of ascending partition start address:
heapPartitions="$(seq 22 24)"
# the disk area (as a sector range) to use for the heap partitions:
heapStart=$(parOldEnd 21) # one sector past the end of tzb.
heapEnd=$(parOldStart 25) # the start of recovery.
By default, REPIT will back up, restore, compress and/or expand a partition.
The +wipe option will wipe the partition.
The max option is an easy way to allocate the remaining space for a partition.
The misc partition is not part of the user-config but, it is in the sector range.
It will be moved to the the end of the sector range without alteration.
The default zip name lanchon-repit-20210221-system=max-cache=16M+wipe-flo.zip
Creates a 16M clean cache partition. (Wiped)
Uses the rest of the unallocated space in the range for system.
System is backed up and restored since the +wipe option was NOT added to system.
Since only system and cache can be configured, this only allows a few options for deb and flo.
Default zip name. -system=max-cache=16M+wipe-
Include wipe system. -system=max+wipe-cache=16M+wipe-
See the GitHub README for more on how to configure. GitHub - Link
Cheers all.
<RESERVE>
<RESERVE>
I think this deserves a bump, because, this is some great work right here for those wanting to stick with a stock-like partition layout!
Hi, I want to go back stock partition size. So i have to rename the zip.
What zip name?
ipdev said:
This is a port of Lanchon REPIT.
- Nexus 7 (2013) Deb (LTE) and Flo (WiFi) -​
Disclaimer:
I am not responsible for your actions or consequences, directly or indirectly, related to the files and/or advice offered.
It is your choice to proceed.
What is REPIT?
REPIT is a simple, safe, device-only, data-sparing, and easily portable repartitioning tool for Android devices.
See the GitHub README for more on What REPIT is. GitHub - Link
Limitations:
Requires TWRP (or TWRP based) recovery.
Does not support encrypted devices.
Will cause data loss if the repartitioning process is externally interrupted.
See the GitHub README for more on Limitations. GitHub - Link
---
Notes:
A few years ago (September 2018), I made a port of REPIT for deb,flo and manta that was spread out between multiple threads.
Some comments and instructions were lost in thread chatter or just in a different thread altogether.
The file name actually configures the repit script.
Noted that you may have to toggle MTP Disable, Enable, Disable.
Noted that you may have to reboot into TWRP after disabling MTP.
Remember /tmp is wiped after a reboot. Copy repit to /sdcard and after rebooting back into TWRP, copy it from /sdcard to /tmp using TWRP File manager.
Noted that you may have to unmount cache and data.
Do NOT flash repit from USB/OTG.
This is designed for a stock partition layout. If your device has been modified and a vendor partition was created, REPIT will not work.
Side note:
Lanchon added Nexus 7 (2013) to the official list. (November 2019)
Lanchon REPIT GitHub - Port Request - Commit
---
Be Careful.
There are always risks involved when you start messing around with a device.
If something goes wrong, you may end up with a non-working "bricked" device.
This is especially true when you start modifying partitions.
Backup what you want to save and store it off device.
Copy it to your computer, cloud storage, USB, ...
Instructions:
This operation might take a long time and must not be interrupted.
- Depending on the device and REPIT configuration, this might take a few hours.
Make sure your battery is fully charged or mostly charged.
- You can connect to a charger while the REPIT script is running. May or may not charge depending on the recovery.
How To:
If you already have a ROM installed, repit will backup, change the partition, restore and resize.
- You can just reboot once the script finishes.
Boot into TWRP
Swipe to Allow Modifications
Copy the repit zip to /tmp
Disconnect from computer
Disable MTP
Disable MTP TWRP -> Mount
Install repit
TWRP -> Install -> navigate to /tmp and flash the repit zip
Reboot to system
If you are doing a clean install, add the +wipe option to system in the zip file name. This will speed up the partitioning since system will not be backed up and restored.
lanchon-repit-20210220-system=max+wipe-cache=16M+wipe-flo.zip
- Reboot back into TWRP after the script finishes.
- Then follow the instructions from the rom thread to install the rom you are going to use.
Boot into TWRP
Swipe to Allow Modifications
Copy the repit zip to /tmp
Disconnect from computer
Disable MTP
Disable MTP TWRP -> Mount
Install repit
TWRP -> Install -> navigate to /tmp and flash the repit zip
Reboot to recovery
Follow the instructions from the rom thread to install the rom you are going to use.
---
Changes:
Nexus 7 (2013) [Deb][Flo]
Pushed a bit pass the safe zone and claimed a bit more unallocated space.
Updated to the current REPIT scripts.
Separate zip files for deb and flo.
Nexus 7 (2013) GitHub - Commit
Download Links:
MediaFire - Link
SourceForge - Link
GoogleDrive - Link
Direct Download from MediaFire:
lanchon-repit-20210221-system=max-cache=16M+wipe-deb.zip MediaFire - Download
lanchon-repit-20210221-system=max-cache=16M+wipe-flo.zip MediaFire - Download
REPIT Links:
Lanchon REPIT GitHub - Link
- My fork GitHub - Link
Credits:
Lanchon for his excellent REPIT project.
The Android Community and everyone who has helped me learn through the years.
Cheers all.
Click to expand...
Click to collapse
I have been trying to repartition Nexus flo 2013 following the steps outlined above with lanchon-repit-20210221-system=max+wipe-cache=16M+wipe-deb.zip for 19.1 version but keep getting Error 1, see photo. Any help will be much appreciated. Thank you
greenleaves said:
I have been trying to repartition Nexus flo 2013 following the steps outlined above with lanchon-repit-20210221-system=max+wipe-cache=16M+wipe-deb.zip for 19.1 version but keep getting Error 1, see photo. Any help will be much appreciated. Thank you
Click to expand...
Click to collapse
Problem fixed. Now 19.1, pico gapps and Magisk 25.0 were flashed in success. The problem was that I didn't follow through the steps carefully described on the OP to increase the partition sizes as follows:
The file name actually configures the repit script.
Noted that you may have to toggle MTP Disable, Enable, Disable.
Noted that you may have to reboot into TWRP after disabling MTP.
Remember /tmp is wiped after a reboot. Copy repit to /sdcard and after rebooting back into TWRP, copy it from /sdcard to /tmp using TWRP File manager.
Noted that you may have to unmount cache and data.
Do NOT flash repit from USB/OTG.
This is designed for a stock partition layout. If your device has been modified and a vendor partition was created, REPIT will not work.
greenleaves said:
Problem fixed. Now 19.1, pico gapps and Magisk 25.0 were flashed in success. The problem was that I didn't follow through the steps carefully described on the OP to increase the partition sizes as follows:
The file name actually configures the repit script.
Noted that you may have to toggle MTP Disable, Enable, Disable.
Noted that you may have to reboot into TWRP after disabling MTP.
Remember /tmp is wiped after a reboot. Copy repit to /sdcard and after rebooting back into TWRP, copy it from /sdcard to /tmp using TWRP File manager.
Noted that you may have to unmount cache and data.
Do NOT flash repit from USB/OTG.
This is designed for a stock partition layout. If your device has been modified and a vendor partition was created, REPIT will not work.
Click to expand...
Click to collapse
Edit: NVM, i used restock to start fresh, and it all went fine. I've had this table kicking around long enough that I'm sure something was done that sysrepartundo couldn;'t undo.
How did you actually fix it? I ran sysrepartundo, am running it from the tmp folder with mtp disabled and nothing mounted, and still getting error 1. I've double check, all my partition sizes are stock.. I've been at this a few hours now and am getting frustrated.
theistus said:
I ran sysrepartundo, am running it from the tmp folder with mtp disabled and nothing mounted, and still getting error 1. I've double check, all my partition sizes are stock.. I've been at this a few hours now and am getting frustrated.
Click to expand...
Click to collapse
sysrepartundo is ancient and useless nowadays, try sysrepart-stock instead
Thank you for the script. I was able to repartion my flo and make it compatible with android 12L. Everything went smooth after realising (and correcting this mistake) that i"ve been putting the .zip inside /sdcard/tmp instead of /tmp (I was getting error 1 in TWRP).
During instalation process i"ve connected flo to charger and it indeed charged during repartition process
Things i"ve noticed
- TWRP appeared to be very laggy during repit process and took several seconds to reconginse the charger (to show to + sign next to the battery % to be precise)
- after device rebooted to stock 6.0.1, MTP didn"t work correctly. It appeared in my computer as "Nexus 7", but was completely empty. One more reboot (this time got short loading toast of "android is updating") and internal memory was visible from computer again
THANKS! It worked great for me also. I have mentioned it in the [GUIDE/TUTORIAL/HOWTO] Google Nexus 7 2013 Stock to Android 12 Tutorial.
Hi,
I had used @followmsi's sysrepart_1280_120.zip some time ago.
Now I'm interested in @followmsi's lineage 19.1 and want to use your lanchon-repit-20210221 script for increasing the system partition again.
Would you still consider the partition layout as stock, so I could use your script ? (See attachments)
And do I need a PC as the USB port is inoperative, so no way to connect to a PC?
Thank you very much in advance!
curiousde2002 said:
Hi,
I had used @followmsi's sysrepart_1280_120.zip some time ago.
Now I'm interested in @followmsi's lineage 19.1 and want to use your lanchon-repit-20210221 script for increasing the system partition again.
Would you still consider the partition layout as stock, so I could use your script ? (See attachments)
And do I need a PC as the USB port is inoperative, so no way to connect to a PC?
Thank you very much in advance!
Click to expand...
Click to collapse
You should be good to go.
Using one of the older (re)partitioning methods did not affect the partition table too much.
The note about a stock partition layout is mainly for users who used a (re)partition script that adds a separate vendor partition.
Cheers.
ipdev said:
You should be good to go.
Using one of the older (re)partitioning methods did not affect the partition table too much.
The note about a stock partition layout is mainly for users who used a (re)partition script that adds a separate vendor partition.
Cheers.
Click to expand...
Click to collapse
Would you recommend any precautions like putting files like restock on my device before running your script as I cannot connect to PC?
Thanks a lot for your help!
hi, i need some help, after using this script i can't seem to install any rom, i just can't format or mount any of my partitions, and sideload stops at some random %, anything i can do to restore? i backed up all files advised.
Hello, i'm having trouble installing Android 12L on my Nexus 7. I simply cannot get lanchon-repit to flash. It wont work, no matter how often I follow the steps and how thorougly I follow the guide. I tried everything. Already restored to "fabric-partitions" so on and so forth.
I'm constantly getting Error 1. I'm slowly losing my mind here.
Kind regards hoping for an answer
septchy
edit: also constantly says partition #30 not found.
I'm getting the following errors on flo:
Code:
FATAL: partition #31 unexpected
[ERROR 1]
Any ideas? Thanks

Categories

Resources