diff options
author | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2021-09-05 15:10:31 +0200 |
---|---|---|
committer | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2021-09-06 12:15:24 +0200 |
commit | af08db027b6214306683c8cbf9980798c5f85977 (patch) | |
tree | 97211afd7b11bace6ce508984d110ddf10dc41f2 /addonsu | |
parent | dc5051ce0272ddb572aaa72ecd0e1d00ad9b0f83 (diff) | |
download | external_wget-replicant-11.tar.gz external_wget-replicant-11.tar.bz2 external_wget-replicant-11.zip |
This way:
- We can rebase more easily if needed
- We don't have to bring in the other part of vendor/lineage that
is potentially incompatible with what we have
wget was also moved in the top directory along the way.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Diffstat (limited to 'addonsu')
-rw-r--r-- | addonsu/51-addonsu.sh | 41 | ||||
-rw-r--r-- | addonsu/mount-system.sh | 34 | ||||
-rw-r--r-- | addonsu/unmount-system.sh | 15 | ||||
-rw-r--r-- | addonsu/updater-script-install | 25 | ||||
-rw-r--r-- | addonsu/updater-script-remove | 23 |
5 files changed, 0 insertions, 138 deletions
diff --git a/addonsu/51-addonsu.sh b/addonsu/51-addonsu.sh deleted file mode 100644 index f2d200b9..00000000 --- a/addonsu/51-addonsu.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/sbin/sh -# -# ADDOND_VERSION=2 -# - -. /tmp/backuptool.functions - -list_files() { -cat <<EOF -bin/su -etc/init/superuser.rc -xbin/su -EOF -} - -case "$1" in - backup) - list_files | while read FILE DUMMY; do - backup_file $S/"$FILE" - done - ;; - restore) - list_files | while read FILE REPLACEMENT; do - R="" - [ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT" - restore_file $S/"$FILE" "$R" - done - ;; - pre-backup) - # Stub - ;; - post-backup) - # Stub - ;; - pre-restore) - # Stub - ;; - post-restore) - # Stub - ;; -esac diff --git a/addonsu/mount-system.sh b/addonsu/mount-system.sh deleted file mode 100644 index e5cc81ce..00000000 --- a/addonsu/mount-system.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/sbin/sh - -# Modern devices use /system as root ("/") -system_as_root=`getprop ro.build.system_root_image` -if [ "$system_as_root" == "true" ]; then - if mount /system_root; then - exit 0 - fi - - active_slot=`getprop ro.boot.slot_suffix` - if [ ! -z "$active_slot" ]; then - block=/dev/block/bootdevice/by-name/system$active_slot - else - block=/dev/block/bootdevice/by-name/system - fi - mkdir -p /system_root - if mount -o rw $block /system_root || - mount -o rw $block /system_root -t ext4 || - mount -o rw $block /system_root -t f2fs; then - exit 0 - fi -else - if mount /system; then - exit 0 - fi - - # Try to get the block from /etc/recovery.fstab - block=`cat /etc/recovery.fstab | cut -d '#' -f 1 | grep /system | grep -o '/dev/[^ ]*' | head -1` - if [ -n "$block" ] && mount $block /system; then - exit 0 - fi -fi - -exit 1 diff --git a/addonsu/unmount-system.sh b/addonsu/unmount-system.sh deleted file mode 100644 index 19b34311..00000000 --- a/addonsu/unmount-system.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/sbin/sh - -# Modern devices use /system as root ("/") -system_as_root=`getprop ro.build.system_root_image` -if [ "$system_as_root" == "true" ]; then - if umount /system_root; then - exit 0 - fi -else - if umount /system; then - exit 0 - fi -fi - -exit 1 diff --git a/addonsu/updater-script-install b/addonsu/updater-script-install deleted file mode 100644 index 996023c2..00000000 --- a/addonsu/updater-script-install +++ /dev/null @@ -1,25 +0,0 @@ -ui_print("Installing su addon..."); -ifelse(is_mounted("/system"), unmount("/system")); -package_extract_file("mount-system.sh", "/tmp/mount-system.sh"); -package_extract_file("unmount-system.sh", "/tmp/unmount-system.sh"); -set_metadata("/tmp/mount-system.sh", "uid", 0, "gid", 0, "mode", 0755); -set_metadata("/tmp/unmount-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/etc/init/superuser.rc", "uid", 0, "gid", 0, "mode", 0644, "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_root/system"); - set_metadata("/system_root/system/addon.d/51-addonsu.sh", "uid", 0, "gid", 0, "mode", 0755, "selabel", "u:object_r:system_file:s0"); - set_metadata("/system_root/system/etc/init/superuser.rc", "uid", 0, "gid", 0, "mode", 0644, "selabel", "u:object_r:system_file:s0"); - set_metadata("/system_root/system/xbin/su", "uid", 0, "gid", 2000, "mode", 0755, "selabel", "u:object_r:su_exec:s0"); - symlink("/system/xbin/su", "/system_root/system/bin/su"); -endif; - -run_program("/tmp/unmount-system.sh") == 0 || ui_print("Could not unmount /system"); -ui_print("Done"); -set_progress(1.000000); diff --git a/addonsu/updater-script-remove b/addonsu/updater-script-remove deleted file mode 100644 index 6531e55b..00000000 --- a/addonsu/updater-script-remove +++ /dev/null @@ -1,23 +0,0 @@ -ui_print("Removing su addon..."); -ifelse(is_mounted("/system"), unmount("/system")); -package_extract_file("mount-system.sh", "/tmp/mount-system.sh"); -package_extract_file("unmount-system.sh", "/tmp/unmount-system.sh"); -set_metadata("/tmp/mount-system.sh", "uid", 0, "gid", 0, "mode", 0755); -set_metadata("/tmp/unmount-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 - delete("/system/addon.d/51-addonsu.sh"); - delete("/system/bin/su"); - delete("/system/etc/init/superuser.rc"); - delete("/system/xbin/su"); -else - delete("/system_root/system/addon.d/51-addonsu.sh"); - delete("/system_root/system/bin/su"); - delete("/system_root/system/etc/init/superuser.rc"); - delete("/system_root/system/xbin/su"); -endif; - -run_program("/tmp/unmount-system.sh") == 0 || ui_print("Could not unmount /system"); -ui_print("Done"); -set_progress(1.000000); |