0

Background:


Device: Yu Yureka | CM 12.1(5.1)

https://www.gsmarena.com/yu_yureka-6987.php


Its been a while since Cyanogen died and I was looking forward to migrate to a newer ROM. Turns out, Resurrection Remix has a custom ROM for Tomato(my build name) with Nougat support: https://sourceforge.net/projects/resurrectionremix/files/tomato/ courtesy being of Mr Abhishek, the maintainer of ROM for Yureka.

Anyway, I went ahead, changed my recovery from Cyanogen to TeamWin and flashed the new ROM, the only part remaining being flashing of GApps except flashing GApps gave me the infamous Error 70 : https://tech.chandrahasa.com/2017/03/09/error-70-gapps-fix/

In my case, I wanted to repartition /system to fix the problem and so used a tool(built specifically for my device) to do that. It worked and it ended up formatting /system, /dalvik, /cache, /data.

Problem:

When I checked the partition size, it showed 2.5GB just as was promised at this point. I went ahead and flashed the new ROM and somehow, the partition ended up being 1.15 GB like it was there originally. I suspect the install script of the ROM resets the partition size as a sanity check by default after all - this new ROM is a fork of the CM 12.1 ROM that originally came up with the phone. Or, there could be some sort of limit on the /system partition size.(not sure really...)

Question: How can I keep this new repartition size and prevent the ROM from resetting it to 1.15GB(if indeed that's the case)?


For your reference,

Here is the Update script for the ROM:

assert(getprop("ro.product.device") == "YUREKA" || getprop("ro.build.product") == "YUREKA" || abort("E3004: This package is for device: YUREKA; this device is " + getprop("ro.product.device") + "."););
assert(cm.verify_trustzone("TZ.BF.3.0.R2-00034") == "1");
ui_print("Target: YU/YUREKA/YUREKA:5.1.1/LMY49J/YOG4PAS8A4:user/release-keys");
ifelse(is_mounted("/system"), unmount("/system"));
package_extract_dir("install", "/tmp/install");
set_metadata_recursive("/tmp/install", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644);
set_metadata_recursive("/tmp/install/bin", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0755);
mount("ext4", "EMMC", "/dev/block/bootdevice/by-name/system", "/system", "");
run_program("/tmp/install/bin/backuptool.sh", "backup");
unmount("/system");
ui_print(" ");
ui_print(" ");
ui_print(" ");
ui_print(" RRRRRRRRRRRRRRRRR     RRRRRRRRRRRRRRRRR   ");
ui_print(" R::::::::::::::::R    R::::::::::::::::R  ");
ui_print(" R::::::RRRRRR:::::R   R::::::RRRRRR:::::R ");
ui_print(" RR:::::R     R:::::R  RR:::::R     R:::::R");
ui_print("   R::::R     R:::::R    R::::R     R:::::R");
ui_print("   R::::R     R:::::R    R::::R     R:::::R");
ui_print("   R::::RRRRRR:::::R     R::::RRRRRR:::::R ");
ui_print("   R:::::::::::::RR      R:::::::::::::RR  ");
ui_print("   R::::RRRRRR:::::R     R::::RRRRRR:::::R ");
ui_print("   R::::R     R:::::R    R::::R     R:::::R");
ui_print("   R::::R     R:::::R    R::::R     R:::::R");
ui_print("   R::::R     R:::::R    R::::R     R:::::R");
ui_print(" RR:::::R     R:::::R  RR:::::R     R:::::R");
ui_print(" R::::::R     R:::::R  R::::::R     R:::::R");
ui_print(" R::::::R     R:::::R  R::::::R     R:::::R");
ui_print(" RRRRRRRR     RRRRRRR  RRRRRRRR     RRRRRRR");
ui_print(" ");
ui_print(" ");
ui_print(" **************** Software *****************");
ui_print(" OS ver: RR-N-v5.8.3-20170621-tomato-OFFICIAL-VoLTE");
ui_print("");
ui_print(" Android ver: 7.1.2");
ui_print("");
ui_print(" Security patch: 2017-06-05");
ui_print("");
ui_print(" SDK ver: 25");
ui_print("");
ui_print(" Root status: Enabled");
ui_print("");
ui_print(" Build ID: NJH47B");
ui_print("");
ui_print(" Build date: Wed Jun 21 18:23:54 IST 2017");
ui_print("");
ui_print(" Build type: OFFICIAL-VoLTE");
ui_print("");
ui_print(" Build host: DeadlyMachine");
ui_print("");
ui_print(" Maintainer: Men_in_black007");
ui_print(" **************** Hardware *****************");
ui_print(" Device codename: tomato");
ui_print("");
ui_print(" Manufacturer: YU");
ui_print("");
ui_print(" *******************************************");
if is_mounted("/data") then
package_extract_file("META-INF/org/lineageos/releasekey", "/tmp/releasekey");
run_program("/tmp/install/bin/otasigcheck.sh") != "31744" || abort("Can't install this package on top of incompatible data. Please try another package or run a factory reset");
else
mount("f2fs", "EMMC", "/dev/block/bootdevice/by-name/userdata", "/data", "");
package_extract_file("META-INF/org/lineageos/releasekey", "/tmp/releasekey");
run_program("/tmp/install/bin/otasigcheck.sh") != "31744" || abort("Can't install this package on top of incompatible data. Please try another package or run a factory reset");
unmount("/data");
endif;
show_progress(0.750000, 0);
ui_print("Patching system image unconditionally...");
block_image_update("/dev/block/bootdevice/by-name/system", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat") ||
  abort("E1001: Failed to update system image.");
show_progress(0.020000, 10);
mount("ext4", "EMMC", "/dev/block/bootdevice/by-name/system", "/system", "");
run_program("/tmp/install/bin/backuptool.sh", "restore");
unmount("/system");
show_progress(0.050000, 5);
package_extract_file("boot.img", "/dev/block/bootdevice/by-name/boot");
show_progress(0.200000, 10);
set_progress(1.000000);
  • 1
    Just guessing by the script part you've included: The partition itself is probably not resized back. But the script wrote an image block-wise (block_image_update), so the file system thinks it has those 1.15GB. If I'm right with that, all that would be needed is to adjust/expand the file system (I don't know the steps for that, but am sure it's possible: same thing is done e.g. with Raspberry Pis after flashing a 2GB image to a much larger SD card). – Izzy Nov 13 '17 at 7:55
  • @Izzy : Found a solution with a trick. See my answer. – pulp_fiction Nov 13 '17 at 8:31
  • That's even easier, good catch (upvoted)! Though you and me (and probably many others) know, you may want to make clear it was a nandroid backup and you're not speaking of "stock recovery" but TWRP :) And yes, with recent versions of custom recoveries (TWRP for sure, CWM I assume the same) Nandroid no longer means a block-wise backup but rather a "contents archive", which enabled this procedure in the first place. – Izzy Nov 13 '17 at 9:21
1

I did it with a trick. I first flashed the ROM with 1.15 GB partition only. Then, switched to recovery, made backup of the ROM on SD Card then ran the script for repartitioning, it became 2.5GB, flashing /system, /data, /cache and /dalvik.

Then, instead of flashing the ROM afresh, I restored the backup into this partition.

Voila! It worked!

I am now a happy user of a Custom ROM with Android Nougat(stock was Lollipop) and only those Google Apps that I consider useful.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.