assert(getprop("ro.product.device") == "mione_plus" ||
       getprop("ro.build.product") == "mione_plus");
show_progress(0.500000, 0);
format("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "0", "/system");
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system");
package_extract_dir("recovery", "/system");
package_extract_dir("system", "/system");
symlink("Roboto-Bold.ttf", "/system/fonts/DroidSans-Bold.ttf");
symlink("Roboto-Regular.ttf", "/system/fonts/DroidSans.ttf",
        "/system/fonts/EmojiPlaceholder.ttf");
symlink("libwiperjni_v01.so", "/system/lib/libwiperjni.so");
symlink("libxt_v01.so", "/system/lib/libxt_native.so");
symlink("mksh", "/system/bin/sh");
symlink("toolbox", "/system/bin/cat", "/system/bin/chmod",
        "/system/bin/chown", "/system/bin/cmp", "/system/bin/date",
        "/system/bin/dd", "/system/bin/df", "/system/bin/dmesg",
        "/system/bin/getevent", "/system/bin/getprop", "/system/bin/hd",
        "/system/bin/id", "/system/bin/ifconfig", "/system/bin/iftop",
        "/system/bin/insmod", "/system/bin/ioctl", "/system/bin/ionice",
        "/system/bin/kill", "/system/bin/ln", "/system/bin/log",
        "/system/bin/ls", "/system/bin/lsmod", "/system/bin/lsof",
        "/system/bin/md5", "/system/bin/mkdir", "/system/bin/mount",
        "/system/bin/mv", "/system/bin/nandread", "/system/bin/netstat",
        "/system/bin/newfs_msdos", "/system/bin/notify", "/system/bin/printenv",
        "/system/bin/ps", "/system/bin/reboot", "/system/bin/renice",
        "/system/bin/rm", "/system/bin/rmdir", "/system/bin/rmmod",
        "/system/bin/route", "/system/bin/schedtop", "/system/bin/sendevent",
        "/system/bin/setconsole", "/system/bin/setprop", "/system/bin/sleep",
        "/system/bin/smd", "/system/bin/start", "/system/bin/stop",
        "/system/bin/sync", "/system/bin/top", "/system/bin/touch",
        "/system/bin/umount", "/system/bin/uptime", "/system/bin/vmstat",
        "/system/bin/watchprops",
        "/system/bin/wipe");
symlink("wiperiface_v01", "/system/bin/wiperiface");
set_perm_recursive(0, 0, 0755, 0644, "/system");
set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
set_perm(0, 1000, 0750, "/system/bin/iptables");
set_perm(0, 3003, 02750, "/system/bin/netcfg");
set_perm(0, 3004, 02755, "/system/bin/ping");
set_perm(0, 2000, 06750, "/system/bin/run-as");
set_perm(0, 1000, 0750, "/system/bin/tc");
set_perm_recursive(1002, 1002, 0755, 0440, "/system/etc/bluetooth");
set_perm(0, 0, 0755, "/system/etc/bluetooth");
set_perm(1000, 1000, 0640, "/system/etc/bluetooth/auto_pairing.conf");
set_perm(3002, 3002, 0444, "/system/etc/bluetooth/blacklist.conf");
set_perm(0, 0, 0644, "/system/etc/bluetooth/iop_device_list.conf");
set_perm(1002, 1002, 0440, "/system/etc/dbus.conf");
set_perm(1014, 2000, 0550, "/system/etc/dhcpcd/dhcpcd-run-hooks");
set_perm(0, 2000, 0550, "/system/etc/init.goldfish.sh");
set_perm(0, 1000, 0550, "/system/etc/init.qcom.sdio.sh");
set_perm(0, 0, 0544, "/system/etc/install-recovery.sh");
set_perm_recursive(0, 0, 0755, 0555, "/system/etc/ppp");
set_perm(0, 2000, 0755, "/system/vendor");
set_perm(0, 2000, 0755, "/system/vendor/firmware");
set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
set_perm(0, 9802, 06754, "/system/xbin/ota");
set_perm(0, 0, 0755, "/system/xbin/procmem");
set_perm(0, 0, 0755, "/system/xbin/procrank");
set_perm(0, 1000, 06754, "/system/xbin/shelld");
set_perm(0, 0, 06755, "/system/xbin/su");
show_progress(0.200000, 0);
show_progress(0.200000, 10);
package_extract_file("boot.img", "/dev/block/platform/msm_sdcc.1/by-name/boot");
show_progress(0.100000, 0);
ui_print("Writing image emmc_appsboot.mbn...");
package_extract_file("emmc_appsboot.mbn", "/dev/block/platform/msm_sdcc.1/by-name/aboot");
ui_print("Writing image tz.mbn...");
package_extract_file("tz.mbn", "/dev/block/platform/msm_sdcc.1/by-name/tz");
ui_print("Writing image sbl3.mbn...");
package_extract_file("sbl3.mbn", "/dev/block/platform/msm_sdcc.1/by-name/sbl3");
ui_print("Writing image NON-HLOS.bin...");
unmount("/vendor/firmware");
package_extract_file("NON-HLOS.bin", "/dev/block/platform/msm_sdcc.1/by-name/modem");
ui_print("Writing image rpm.mbn...");
package_extract_file("rpm.mbn", "/dev/block/platform/msm_sdcc.1/by-name/rpm");
ui_print("Writing image sbl1.mbn...");
package_extract_file("sbl1.mbn", "/dev/block/platform/msm_sdcc.1/by-name/sbl1");
ui_print("Writing image sbl2.mbn...");
package_extract_file("sbl2.mbn", "/dev/block/platform/msm_sdcc.1/by-name/sbl2");
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/userdata", "/data");
package_extract_dir("data", "/data");
set_perm_recursive(1000, 1000, 0755, 0644, "/data/media/preinstall_apps");
unmount("/data");
unmount("/system");
