#Updater-script LeeDrOiD HD
#For the HTC Desire HD (ace)
#Follow me on Twitter @LeeDrOiD

show_progress(0.500000, 0);

ui_print("-Checking Model ID");
assert(getprop("ro.product.device") == "ace" || getprop("ro.build.product") == "ace" || getprop("ro.product.board") == "ace");
ui_print("-Success!");
ui_print("-Model ID - HTC Ace");
ui_print("-Ok to proceed");
ui_print("Now preparing for a clean EXT4 install of LeeDrOiD HD V3.X.X GB");
ui_print("Please be patient");
ui_print("1st boot may take a few minutes");

show_progress(0.500000, 40);

ui_print("-Formatting Data as EXT4");
unmount("/data");
format("ext4", "EMMC", "/dev/block/mmcblk0p26");

ui_print("-Formatting System as EXT4");
unmount("/system");
format("ext4", "EMMC", "/dev/block/mmcblk0p25");
ui_print("-Writing System");
mount("ext4", "EMMC", "/dev/block/mmcblk0p25", "/system");
package_extract_dir("system", "/system");
unmount("/system");

show_progress(0.400000, 0);

ui_print("-Formatting Cache as EXT4");
unmount("/cache");
format("ext4", "EMMC", "/dev/block/mmcblk0p27");

show_progress(0.100000, 0);
ui_print("-Cleaning Complete");
ui_print(" ");
ui_print(" ");
ui_print("-Now flash the rom!");
ui_print(" ");