Advertisement
Guest User

Größere Daten-Partition

a guest
Sep 7th, 2013
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. #!/system/bin/sh
  2. export PATH=/system/bin:/system/xbin:$PATH
  3. BLOCK_DEVICE=$1
  4. MOUNT_POINT=$2
  5. LOG_FILE="/dev/null"
  6. LOG_LOCATION="/data/.fsck_log/"
  7.  
  8. # get syspart-flag from cmdline
  9. set -- $(cat /proc/cmdline)
  10. for x in "$@"; do
  11. case "$x" in
  12. syspart=*)
  13. SYSPART=$(echo "${x#syspart=}")
  14. ;;
  15. esac
  16. done
  17.  
  18. # storage log
  19. if [ "${MOUNT_POINT}" == "/storage_int" ]; then
  20. mkdir ${LOG_LOCATION}
  21. busybox find /data/.fsck_log/ -type f -mtime +7 -exec rm {} \;
  22. TIMESTAMP=`date +%F_%H-%M-%S`
  23. LOG_FILE=${LOG_LOCATION}/storage_${TIMESTAMP}.log
  24. fi
  25.  
  26. # mount partition
  27. if [ -e ${BLOCK_DEVICE} ]; then
  28. # userdata
  29. if [ "${BLOCK_DEVICE}" == "/dev/block/platform/msm_sdcc.1/by-name/userdata" ];then
  30. if [ "${SYSPART}" == "system" ];then
  31. BINDMOUNT_PATH="/storage_int/sddata/system0"
  32. elif [ "${SYSPART}" == "system1" ];then
  33. BINDMOUNT_PATH="/storage_int/sddata/system1"
  34. else
  35. reboot recovery
  36. fi
  37.  
  38. # early sd-card mount
  39. mount -t ext4 -o nosuid,nodev,barrier=1,noauto_da_alloc /dev/block/platform/msm_sdcc.1/by-name/storage /storage_int
  40.  
  41. # bind mount
  42. mkdir -p ${BINDMOUNT_PATH}
  43. chmod 0755 ${BINDMOUNT_PATH}
  44. mount -o bind ${BINDMOUNT_PATH} ${MOUNT_POINT}
  45.  
  46. # storage
  47. elif [ "${BLOCK_DEVICE}" == "/dev/block/platform/msm_sdcc.1/by-name/storage" ];then
  48. # mount /data as second sd-card (root only)
  49. mkdir -p /storage/sdcard1
  50. chmod 0777 /storage/sdcard1
  51. mount -t ext4 -o rw,nosuid,nodev,barrier=1,noauto_da_alloc /dev/block/platform/msm_sdcc.1/by-name/userdata /storage/sdcard1
  52. # normal mount
  53. else
  54. mount -t ext4 -o nosuid,nodev,barrier=1,noauto_da_alloc ${BLOCK_DEVICE} ${MOUNT_POINT}
  55. fi
  56. fi
  57.  
  58. # hide recovery partition
  59. RECOVERY_NODE="$(busybox readlink -f /dev/block/platform/msm_sdcc.1/by-name/recovery)"
  60. busybox mv "${RECOVERY_NODE}" /dev/recovery_moved
  61. busybox mknod -m 0600 "${RECOVERY_NODE}" b 1 3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement