Created
March 26, 2016 16:14
-
-
Save taaem/8ffe56816b300755d848 to your computer and use it in GitHub Desktop.
Updater Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ui_print(""); | |
ui_print("========================================"); | |
ui_print("Hybris Installer"); | |
ui_print("========================================"); | |
ui_print(" Device: onyx"); | |
ui_print(" Version: 2.0.0.10"); | |
ui_print(" Image: sailfishos-onyx-release-2.0.0.10-alpha-1.tar.bz2"); | |
ui_print(" Size: 303M"); | |
ui_print(" Partitions:"); | |
ui_print(" /boot -> /dev/block/platform/msm_sdcc.1/by-name/boot"); | |
ui_print(" /data -> /dev/block/platform/msm_sdcc.1/by-name/userdata"); | |
ui_print("========================================"); | |
ui_print(""); | |
assert(getprop("ro.product.device") == "onyx" || getprop("ro.build.product") == "onyx" || getprop("ro.cm.device") == "onyx" || getprop("ro.product.device") == "ONE" || getprop("ro.build.product") == "ONE" || getprop("ro.cm.device") == "ONE"); | |
ui_print("Device check succeeded, mounting filesystems ..."); | |
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/userdata", "/data"); | |
ui_print("Copying filesystem archive ..."); | |
package_extract_file("sailfishos-onyx-release-2.0.0.10-alpha-1.tar.bz2", "/data/sailfishos-rootfs.tar.bz2"); | |
ui_print("Copying installation script ..."); | |
package_extract_file("updater-unpack.sh", "/tmp/updater-unpack.sh"); | |
ui_print("Running installation script ..."); | |
set_metadata("/tmp/updater-unpack.sh", "uid", 0, "gid", 0, "mode", 0755); | |
run_program("/tmp/updater-unpack.sh") == "0" || abort("Failed to extract filesystem!"); | |
ui_print("Flashing hybris-boot.img ..."); | |
package_extract_file("hybris-boot.img", "/dev/block/platform/msm_sdcc.1/by-name/boot"); | |
ui_print("Unmounting filesystems ..."); | |
unmount("/data"); | |
ui_print("Done!"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment