summaryrefslogtreecommitdiffstats
path: root/addonsu/updater-script-install
diff options
context:
space:
mode:
authorWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2017-05-02 19:56:19 +0200
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2017-05-02 19:56:19 +0200
commit801e730e7e4d3e5a58d7af797d417c75870d4782 (patch)
tree4ad8d3ad37b4ece3c29d714d87924a40f269208b /addonsu/updater-script-install
parent2b5008db43131e21d7c100f55621457322bbc82d (diff)
parent109fef9e1e04b2faa44c5f9dc7c5b8d3ba559858 (diff)
downloadvendor_replicant-801e730e7e4d3e5a58d7af797d417c75870d4782.zip
vendor_replicant-801e730e7e4d3e5a58d7af797d417c75870d4782.tar.gz
vendor_replicant-801e730e7e4d3e5a58d7af797d417c75870d4782.tar.bz2
Merge branch 'cm-13.0' of https://github.com/LineageOS/android_vendor_cm into replicant-6.0
Diffstat (limited to 'addonsu/updater-script-install')
-rw-r--r--addonsu/updater-script-install21
1 files changed, 21 insertions, 0 deletions
diff --git a/addonsu/updater-script-install b/addonsu/updater-script-install
new file mode 100644
index 0000000..762ddc5
--- /dev/null
+++ b/addonsu/updater-script-install
@@ -0,0 +1,21 @@
+ui_print("Installing su addon...");
+ifelse(is_mounted("/system"), unmount("/system"));
+package_extract_file("mount-system.sh", "/tmp/mount-system.sh");
+set_metadata("/tmp/mount-system.sh", "uid", 0, "gid", 0, "mode", 0755);
+run_program("/tmp/mount-system.sh") == 0 || abort("Could not mount /system");
+
+if getprop("ro.build.system_root_image") != "true" then
+ package_extract_dir("system", "/system");
+ set_metadata("/system/addon.d/51-addonsu.sh", "uid", 0, "gid", 0, "mode", 0755, "selabel", "u:object_r:system_file:s0");
+ set_metadata("/system/xbin/su", "uid", 0, "gid", 2000, "mode", 0755, "selabel", "u:object_r:su_exec:s0");
+ symlink("/system/xbin/su", "/system/bin/su");
+else
+ package_extract_dir("system", "/system/system");
+ set_metadata("/system/system/addon.d/51-addonsu.sh", "uid", 0, "gid", 0, "mode", 0755, "selabel", "u:object_r:system_file:s0");
+ set_metadata("/system/system/xbin/su", "uid", 0, "gid", 2000, "mode", 0755, "selabel", "u:object_r:su_exec:s0");
+ symlink("/system/xbin/su", "/system/system/bin/su");
+endif;
+
+unmount("/system");
+ui_print("Done");
+set_progress(1.000000);