assert(getprop("ro.build.id") == "M330-10");
show_progress(0.950000, 50);
ui_print("Update system ...");
format("ext4", "EMMC", "/dev/block/platform/hi_mci.1/by-name/system", "0", "/system");
mount("ext4", "EMMC", "/dev/block/platform/hi_mci.1/by-name/system", "/system");
package_extract_dir("system", "/system");
symlink("Roboto-Bold.ttf", "/system/fonts/DroidSans-Bold.ttf");
symlink("Roboto-Regular.ttf", "/system/fonts/DroidSans.ttf");
symlink("libGLESv2.so", "/system/lib/libGLESv3.so");
symlink("mksh", "/system/bin/sh");
symlink("toolbox", "/system/bin/cat", "/system/bin/chcon",
        "/system/bin/chmod", "/system/bin/chown", "/system/bin/clear",
        "/system/bin/cmp", "/system/bin/cp", "/system/bin/date",
        "/system/bin/dd", "/system/bin/df", "/system/bin/dmesg",
        "/system/bin/du", "/system/bin/getenforce", "/system/bin/getevent",
        "/system/bin/getprop", "/system/bin/getsebool", "/system/bin/grep",
        "/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/load_policy", "/system/bin/log", "/system/bin/ls",
        "/system/bin/lsmod", "/system/bin/lsof", "/system/bin/md5",
        "/system/bin/mkdir", "/system/bin/mkswap", "/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/readlink", "/system/bin/renice",
        "/system/bin/restorecon", "/system/bin/rm", "/system/bin/rmdir",
        "/system/bin/rmmod", "/system/bin/route", "/system/bin/runcon",
        "/system/bin/schedtop", "/system/bin/sendevent",
        "/system/bin/setconsole", "/system/bin/setenforce",
        "/system/bin/setprop", "/system/bin/setsebool", "/system/bin/sleep",
        "/system/bin/smd", "/system/bin/start", "/system/bin/stop",
        "/system/bin/swapoff", "/system/bin/swapon", "/system/bin/sync",
        "/system/bin/top", "/system/bin/touch", "/system/bin/umount",
        "/system/bin/uptime", "/system/bin/vmstat", "/system/bin/watchprops",
        "/system/bin/wipe");
ui_print("Update qbdata...");
ifelse(is_mounted("/qbdata"), unmount("/qbdata"), ui_print("qbdata partition is not mounted"));
format("ext4", "EMMC", "/dev/block/platform/hi_mci.1/by-name/qbdata", "0", "/qbdata");
mount("ext4", "EMMC", "/dev/block/platform/hi_mci.1/by-name/qbdata", "/qbdata");
package_extract_dir("qbdata", "/qbdata");
ui_print("Update logo ...");
package_extract_file("logo.img", "/dev/block/platform/hi_mci.1/by-name/logo");
set_perm_recursive(0, 0, 0755, 0644, "/system");
set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
set_perm(0, 3003, 02750, "/system/bin/netcfg");
set_perm(0, 0, 0755, "/system/bin/ping");
set_perm(0, 2000, 0750, "/system/bin/run-as");
set_perm(1014, 2000, 0550, "/system/etc/dhclient-script");
set_perm(0, 2000, 0550, "/system/etc/init.bigfish.sh");
set_perm_recursive(0, 0, 0755, 0555, "/system/etc/ppp");
set_perm(0, 2000, 0755, "/system/vendor");
set_perm_recursive(0, 2000, 0755, 0644, "/system/vendor/etc");
set_perm(0, 0, 0644, "/system/vendor/etc/fallback_fonts.xml");
set_perm(0, 2000, 0755, "/system/vendor/firmware");
set_perm(0, 2000, 0755, "/system/vendor/firmware/ath6k");
set_perm(0, 2000, 0755, "/system/vendor/firmware/ath6k/AR6004");
set_perm(0, 2000, 0755, "/system/vendor/firmware/ath6k/AR6004/hw1.3");
set_perm(0, 2000, 0755, "/system/vendor/firmware/ath6k/AR6004/hw3.0");
set_perm_recursive(0, 2000, 0755, 0644, "/system/vendor/firmware/usb");
set_perm(0, 0, 0644, "/system/vendor/firmware/usb/bcm20702b0.hcd");
set_perm_recursive(0, 2000, 0755, 0644, "/system/vendor/lib");
set_perm(0, 0, 0644, "/system/vendor/lib/libbt-vendor.so");
set_perm(0, 0, 0644, "/system/vendor/lib/mediadrm/libwvdrmengine.so");
set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
set_perm(1000, 1000, 0755, "/system/etc/init.bigfish.sh");
set_perm_recursive(0, 0, 0755, 0644, "/qbdata");
set_perm_recursive(0, 2000, 0755, 0755, "/qbdata/bin");
set_perm(0, 0, 0755, "/qbdata/bin");
ui_print("Update boot ...");
package_extract_file("boot.img", "/dev/block/platform/hi_mci.1/by-name/boot");
show_progress(0.050000, 2);
unmount("/qbdata");
unmount("/system");
