forked from Flemmard/android_device_htc_pyramid
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize storage, use cache as secondary swap and reuse devlog as cache
Change-Id: I15cf136cf180f0e6686cd37641cc4170867adecd
- Loading branch information
Showing
6 changed files
with
72 additions
and
53 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,38 @@ | ||
#!/system/bin/sh | ||
|
||
export PATH=${PATH}:/system/bin/:/system/xbin/ | ||
LOG="/cache/${0}.log" | ||
|
||
log -p i -t userinit "[${0}][Start]" | ||
|
||
# Log related mounts and mount points before | ||
log -p i -t userinit "[${0}] Before" | ||
echo "[${0}] Before" >> /cache/${0}.log | ||
mount >> /cache/${0}.log | ||
ls -la /data/ >> /cache/${0}.log | ||
ls -la /data1/ >> /cache/${0}.log | ||
echo "[Start]" >> ${LOG} | ||
mount >> ${LOG} | ||
echo "[/]" >> ${LOG} | ||
ls -la / >> ${LOG} | ||
echo "[/data]" >> ${LOG} | ||
ls -la /data/ >> ${LOG} | ||
echo "[/data1]" >> ${LOG} | ||
ls -la /data1/ >> ${LOG} | ||
du -sch /data1/* >> ${LOG} | ||
|
||
# Attempt to link data content to secondary data (optional) | ||
# Attempt to link data components to secondary data (optional) | ||
# If we fail those locations will be used as usual | ||
# Ensure permissions are set correctly | ||
test -d /data1/app && chmod 0771 /data1/app && chown system:system /data1/app && rm -Rf /data/app && ln -s /data1/app /data/app && log -p i -t userinit "[${0}] Linked /data1/app" && echo "[${0}] Linked /data1/app" >> /cache/${0}.log | ||
#test -d /data1/app-asec && chmod 0700 /data1/app-asec && chown root:root /data1/app-asec && rm -Rf /data/app-asec && ln -s /data1/app-asec /data/app-asec && log -p i -t userinit "[${0}] Linked /data1/app-asec" && echo "[${0}] Linked /data1/app-asec" >> /cache/${0}.log | ||
#test -d /data1/app-lib && chmod 0771 /data1/app-lib && chown system:system /data1/app-lib && rm -Rf /data/app-lib && ln -s /data1/app-lib /data/app-lib && log -p i -t userinit "[${0}] Linked /data1/app-lib" && echo "[${0}] Linked /data1/app-lib" >> /cache/${0}.log | ||
#test -d /data1/app-private && chmod 0771 /data1/app-private && chown system:system /data1/app-private && rm -Rf /data/app-private && ln -s /data1/app-private /data/app-private && log -p i -t userinit "[${0}] Linked /data1/app-private" && echo "[${0}] Linked /data1/app-private" >> /cache/${0}.log | ||
test -d /data1/dalvik-cache && chmod 0771 /data1/dalvik-cache && chown root:root /data1/dalvik-cache && rm -Rf /data/dalvik-cache && ln -s /data1/dalvik-cache /data/dalvik-cache && log -p i -t userinit "[${0}] Linked /data1/dalvik-cache" && echo "[${0}] Linked /data1/dalvik-cache" >> /cache/${0}.log | ||
test -d /data1/data && chmod 0771 /data1/data && chown system:system /data1/data && rm -Rf /data/data && ln -s /data1/data /data/data && log -p i -t userinit "[${0}] Linked /data1/data" && echo "[${0}] Linked /data1/data" >> /cache/${0}.log | ||
test -d /data1/media && chmod 0770 /data1/media && chown media_rw:media_rw /data1/media && rm -Rf /data/media && ln -s /data1/media /data/media && log -p i -t userinit "[${0}] Linked /data1/media" && echo "[${0}] Linked /data1/media" >> /cache/${0}.log | ||
test -d /data1/dalvik-cache && chmod 0771 /data1/dalvik-cache && chown root:root /data1/dalvik-cache && rm -Rf /data/dalvik-cache && ln -s /data1/dalvik-cache /data/dalvik-cache && log -p i -t userinit "[${0}] Linked /data1/dalvik-cache" && echo "[${0}] Linked /data1/dalvik-cache" >> ${LOG} | ||
test -d /data1/app && chmod 0771 /data1/app && chown system:system /data1/app && rm -Rf /data/app && ln -s /data1/app /data/app && log -p i -t userinit "[${0}] Linked /data1/app" && echo "[${0}] Linked /data1/app" >> ${LOG} | ||
test -d /data1/data && chmod 0771 /data1/data && chown system:system /data1/data && rm -Rf /data/data && ln -s /data1/data /data/data && log -p i -t userinit "[${0}] Linked /data1/data" && echo "[${0}] Linked /data1/data" >> ${LOG} | ||
test -d /data1/media && chmod 0770 /data1/media && chown media_rw:media_rw /data1/media && rm -Rf /data/media && ln -s /data1/media /data/media && log -p i -t userinit "[${0}] Linked /data1/media" && echo "[${0}] Linked /data1/media" >> ${LOG} | ||
|
||
# Log related mounts and mount points after | ||
log -p i -t userinit "[${0}] After" | ||
echo "[${0}] After" >> /cache/${0}.log | ||
mount >> /cache/${0}.log | ||
ls -la /data/ >> /cache/${0}.log | ||
ls -la /data1/ >> /cache/${0}.log | ||
echo "[Stop]" >> ${LOG} | ||
mount >> ${LOG} | ||
echo "[/]" >> ${LOG} | ||
ls -la / >> ${LOG} | ||
echo "[/data]" >> ${LOG} | ||
ls -la /data/ >> ${LOG} | ||
echo "[/data1]" >> ${LOG} | ||
ls -la /data1/ >> ${LOG} | ||
du -sch /data1/* >> ${LOG} | ||
|
||
log -p i -t userinit "[${0}][Stop]" |
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