forked from mer-hybris/hybris-boot
-
Notifications
You must be signed in to change notification settings - Fork 3
/
updater-script
36 lines (28 loc) · 1.14 KB
/
updater-script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
ui_print("");
ui_print("========================================");
ui_print("Hybris Installer");
ui_print("========================================");
ui_print(" Device: %DEVICE%");
ui_print(" Version: %VERSION%");
ui_print(" Image: %IMAGE_FILE%");
ui_print(" Size: %IMAGE_SIZE%");
ui_print(" Partitions:");
ui_print(" /boot -> %BOOT_PART%");
ui_print(" /data -> %DATA_PART%");
ui_print("========================================");
ui_print("");
%ASSERT_DEVICE%
ui_print("Device check succeeded, mounting filesystems ...");
mount("ext4", "EMMC", "%DATA_PART%", "/data");
ui_print("Copying filesystem archive ...");
package_extract_file("%IMAGE_FILE%", "/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_PERMISSIONS%
run_program("/tmp/updater-unpack.sh") == "0" || abort("Failed to extract filesystem!");
ui_print("Flashing hybris-boot.img ...");
package_extract_file("hybris-boot.img", "%BOOT_PART%");
ui_print("Unmounting filesystems ...");
unmount("/data");
ui_print("Done!");