[Nokia 3 Guides, News, & Discussion] bigrammy:
Cheers. :good:

Ref System Updates: There are 2 further update's from the July version we are on, one of these updates the LK preloader etc (First 98mb one) not sure about second one as I have not captured that yet so I am going to leave them for now until I can iron out the rippples in this version.

As [MENTION=8005568]SkaboXD[/MENTION] has mentioned I would like to test F2FS on cache and data to see if it's supported in the kernel when I get a little time.

Put plainly fix this version up so it works 100% then update to the next and see what if anything breaks fix as required then continue to the next update.

I don't want to lock the door keys inside the house so to speak :laugh:

Note If you attempt the update it would be best flashed using the stock recovery and a clean system as it's a "PATCH" not a block update.

FYi

If you notice they (Nokia) always seem to flash recovery to the "boot" partition at some point (marked in red below) and then apply the rest of update from the boot partition then reflash the boot.img back to "boot" which suggests some weirdness :eek:

Ignore my notes which are just there to jog my memory :cowboy: :silly:

if get_stage("/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/para") == "2/3" then

sleep(20);

package_extract_file("recovery.img", "/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/recovery"); [COLOR="blue"]#Flashes the recovery[/COLOR]

set_stage("/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/para", "3/3");
reboot_now("/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/para", "recovery"); [COLOR="blue"]#Uses "para" to reboot the recovery which is v interesting maybe we can use this too to ease the process of getting into twrp. [/COLOR]
else if get_stage("/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/para") != "3/3" then

ui_print("Source: Unknown/Unknown/Unknown:8.0.0/O00623/00WW_3_380:user/release-keys");
ui_print("Target: Unknown/Unknown/Unknown:8.0.0/O00623/00WW_3_38B:user/release-keys");
ui_print("Verifying current system...");
apply_patch_space(30158848) || abort("E3006: Not enough free space on /cache to apply patches.");
ui_print("Patching rawdata images...");
ui_print("Ignore file diff patch in block incrementalOTA 1...");
ui_print("upgarde sutinfo...");
package_extract_file("sutinfo.img", "/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/sutinfo");
ui_print("upgarde logo...");
package_extract_file("logo.img", "/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/logo");
ui_print("upgarde lk...");
package_extract_file("lk.bin", "/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/lk");
ui_print("upgarde cda...");
package_extract_file("cda.img", "/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/cda");
ui_print("upgarde preloader...");
assert(set_emmc_writable("/sys/block/mmcblk0boot0/force_ro"),
package_extract_file("preloader.img", "/dev/block/mmcblk0boot0"));
ui_print("upgarde trustzone...");
show_mtupdate_stage("/cache/recovery/last_mtupdate_stage");
ifelse (
less_than_int(get_mtupdate_stage("/cache/recovery/last_mtupdate_stage"), "3") ,
(
if less_than_int(get_mtupdate_stage("/cache/recovery/last_mtupdate_stage"), "2") then

ui_print("start to update alt loader image");
package_extract_file("tee.img", "/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/tee2");
set_mtupdate_stage("/cache/recovery/last_mtupdate_stage", "2");
endif;

switch_active("tee1", "tee2");
set_mtupdate_stage("/cache/recovery/last_mtupdate_stage", "3");
),
ui_print("alt loder images are already updated");
);
ifelse (
less_than_int(get_mtupdate_stage("/cache/recovery/last_mtupdate_stage"), "5") ,
(
if less_than_int(get_mtupdate_stage("/cache/recovery/last_mtupdate_stage"), "4") then

ui_print("start to update main loader image");
package_extract_file("tee.img", "/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/tee1");
set_mtupdate_stage("/cache/recovery/last_mtupdate_stage", "4");
endif;

switch_active("tee2", "tee1");
),
ui_print("main loader images are already updated");
);
delete("/cache/recovery/last_mtupdate_stage");
[COLOR="Red"]package_extract_file("recovery.img", "/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/[B]boot[/B]");[/COLOR]

set_stage("/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/para", "2/3");
reboot_now("/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/para", ""); #Reboots it's default ("") action
else

if (range_sha1("/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/system", "[COLOR="Blue"]EDITED OUT LOTS OF SHA1 Values[/COLOR]") == "9a867849bcd2285ff46bec3306ecff2304801018" || block_image_verify("/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/system", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat")) then
ui_print("Verified system image...");
else
check_first_block("/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/system");
ifelse (block_image_recover("/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/system", "814,[COLOR="blue"]EDITED OUT LOTS OF SHA1 Values[/COLOR],1048576") && block_image_verify("/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/system", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat"), ui_print("system recovered successfully."), abort("E1004: system partition fails to recover"));
endif;

# ---- start making changes here ----

ui_print("Ignore file diff patch in block incrementalOTA 2...");
ui_print("upgarde fver...");
package_extract_file("fver", "/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/sys_info");
ui_print("Patching system image after verification.");
show_progress(0.900000, 0);
block_image_update("/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/system", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat") ||
abort("E1001: Failed to update system image.");
[COLOR="red"]package_extract_file("boot.img", "/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/boot");[/COLOR] #Flashes the boot.img back to boot

# ---- radio update tasks ----

ui_print("Patching firmware images...");
delete("/cache/recovery/block.map");

set_stage("/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/para", ""); #Sets "para" back to the mtk meaning for default ( "" )
endif;
endif;

set_progress(1.000000);

EDIT: This Quick Reboot (root) app works for booting to recovery from the system which makes life a whole lot easier from now on. :D

On the Play Store or for sideloading HERE

I also think I may of found the cause of the delay in boot up after Magisk patching of the boot.img :fingers-crossed:

I will update this when I am sure.