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.
Switch to Nexus style data layout and allow exporting data components…
… to external sdcard Use internal data as in Nexus devices (sdcard0 is emulated). External sdcard now called sdcard1. Optional second partition of external sdcard (data1) can be used to store selected data components such as: app, data, media and dalvik-cache. To do so, one must create a folder with a name of the component/s on data1. We register sdcard1 as secondary storage allowing built-in asec mechanism to be used to move apps to it. We also add misc recovery related settings and coresponding changes to TWRP in order to support above and backup of emulated internal sdcard and apps in asac container. To summarize, this patch allows user to encrypt device including sdcard0 and place selected data components on external sdcard. Change-Id: Ib52086347eb1f8fc9fd11031428f2c49bdda9afb
- Loading branch information
Showing
10 changed files
with
138 additions
and
88 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
# mount point fstype device [device2] [length=] | ||
# mount point fstype device [device2] [length=] | ||
|
||
/recovery emmc /dev/block/mmcblk0p21 | ||
/boot emmc /dev/block/mmcblk0p20 | ||
/cache ext4 /dev/block/mmcblk0p24 | ||
/data ext4 /dev/block/mmcblk0p23 length=-16384 | ||
/sd-ext ext4 /dev/block/mmcblk1p2 | ||
/sdcard vfat /dev/block/mmcblk1p1 | ||
/boot emmc /dev/block/mmcblk0p20 | ||
/recovery emmc /dev/block/mmcblk0p21 | ||
/system ext4 /dev/block/mmcblk0p22 | ||
/data f2fs /dev/block/mmcblk0p23 length=-16384 | ||
/cache f2fs /dev/block/mmcblk0p24 | ||
/misc emmc /dev/block/mmcblk0p31 | ||
/sdcard1 vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1 flags=display="sdcard1";storage;wipeingui;removable | ||
/data1 f2fs /dev/block/mmcblk1p2 /dev/block/mmcblk1 flags=display="data1";wipeingui;removable | ||
/usbdisk vfat /dev/block/sda1 /dev/block/sda flags=display="usbdisk";storage;wipeingui;removable |
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,12 +1,11 @@ | ||
# mount point fstype device [device2] [length=] | ||
|
||
/boot emmc /dev/block/mmcblk0p20 | ||
/recovery emmc /dev/block/mmcblk0p21 | ||
/system ext4 /dev/block/mmcblk0p22 | ||
/data ext4 /dev/block/mmcblk0p23 length=-16384 | ||
/cache ext4 /dev/block/mmcblk0p24 | ||
/misc emmc /dev/block/mmcblk0p31 | ||
/sdcard vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1 flags=display="MicroSD card";storage;wipeingui;removable | ||
/sd-ext ext4 /dev/block/mmcblk1p2 flags=display="SD-Ext";wipeingui;removable | ||
#/usb-otg vfat /dev/block/sda1 /dev/block/sda flags=display="USB OTG";storage;wipeingui;removable | ||
# mount point fstype device [device2] [length=] | ||
|
||
/boot emmc /dev/block/mmcblk0p20 | ||
/recovery emmc /dev/block/mmcblk0p21 | ||
/system ext4 /dev/block/mmcblk0p22 | ||
/data f2fs /dev/block/mmcblk0p23 length=-16384 | ||
/cache f2fs /dev/block/mmcblk0p24 | ||
/misc emmc /dev/block/mmcblk0p31 | ||
/sdcard1 vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1 flags=display="sdcard1";andsec;storage;wipeingui;removable | ||
/data1 f2fs /dev/block/mmcblk1p2 /dev/block/mmcblk1 flags=display="data1";wipeingui;removable | ||
/usbdisk vfat /dev/block/sda1 /dev/block/sda flags=display="usbdisk";storage;wipeingui;removable |
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,25 +1,26 @@ | ||
# Android fstab file. | ||
#<src> <mnt_point> <type> <mnt_flags> <fs_mgr_flags> | ||
#/dev/block/platform/msm_sdcc.1/by-name/dsps /firmware_dsps vfat ro,shortname=lower wait | ||
/dev/block/platform/msm_sdcc.1/by-name/radio /firmware_radio vfat ro,shortname=lower,context=u:object_r:firmware_file:s0 wait | ||
/dev/block/platform/msm_sdcc.1/by-name/adsp /firmware_q6 vfat ro,shortname=lower,context=u:object_r:firmware_file:s0 wait | ||
#/dev/block/platform/msm_sdcc.1/by-name/wcnss /firmware_wcnss vfat ro,shortname=lower wait | ||
|
||
/dev/block/platform/msm_sdcc.1/by-name/boot /boot emmc defaults defaults | ||
/dev/block/platform/msm_sdcc.1/by-name/recovery /recovery emmc defaults defaults | ||
/dev/block/platform/msm_sdcc.1/by-name/misc /misc emmc defaults defaults | ||
/dev/block/platform/msm_sdcc.1/by-name/devlog /devlog ext4 noatime,nosuid,nodev,barrier=0 wait | ||
/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 rw,noatime,barrier=0 wait | ||
/dev/block/platform/msm_sdcc.1/by-name/cache /cache ext4 noatime,nosuid,nodev,barrier=0 wait | ||
/dev/block/platform/msm_sdcc.1/by-name/cache /cache f2fs rw,discard,nosuid,nodev,noatime,nodiratime,inline_xattr wait,check | ||
/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 noatime,nosuid,nodev,noauto_da_alloc,barrier=0 wait,encryptable=footer,length=-16384 | ||
/dev/block/platform/msm_sdcc.1/by-name/userdata /data f2fs rw,discard,nosuid,nodev,noatime,nodiratime,inline_xattr wait,check,encryptable=footer,length=-16384 | ||
#<src> <mnt_point> <type> <mnt_flags> <fs_mgr_flags> | ||
#/dev/block/platform/msm_sdcc.1/by-name/dsps /firmware_dsps vfat ro,shortname=lower wait | ||
/dev/block/platform/msm_sdcc.1/by-name/radio /firmware_radio vfat ro,shortname=lower,context=u:object_r:firmware_file:s0 wait | ||
/dev/block/platform/msm_sdcc.1/by-name/adsp /firmware_q6 vfat ro,shortname=lower,context=u:object_r:firmware_file:s0 wait | ||
#/dev/block/platform/msm_sdcc.1/by-name/wcnss /firmware_wcnss vfat ro,shortname=lower wait | ||
/dev/block/platform/msm_sdcc.1/by-name/boot /boot emmc defaults defaults | ||
/dev/block/platform/msm_sdcc.1/by-name/recovery /recovery emmc defaults defaults | ||
/dev/block/platform/msm_sdcc.1/by-name/misc /misc emmc defaults defaults | ||
/dev/block/platform/msm_sdcc.1/by-name/devlog /devlog ext4 noatime,nosuid,nodev,barrier=0 wait | ||
/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 ro,noatime,barrier=1 wait | ||
/dev/block/platform/msm_sdcc.1/by-name/cache /cache ext4 noatime,nosuid,nodev,barrier=1,data=ordered,nomblk_io_submit,noauto_da_alloc,errors=panic wait,check | ||
/dev/block/platform/msm_sdcc.1/by-name/cache /cache f2fs rw,discard,nosuid,nodev,noatime,nodiratime,inline_xattr wait,check | ||
/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,data=ordered,nomblk_io_submit,noauto_da_alloc,errors=panic wait,check,encryptable=footer,length=-16384 | ||
/dev/block/platform/msm_sdcc.1/by-name/userdata /data f2fs noatime,nodiratime,nosuid,nodev,inline_xattr,discard,rw wait,check,encryptable=footer,length=-16384 | ||
/dev/block/platform/msm_sdcc.3/by-num/p2 /data1 ext4 noatime,nosuid,nodev,barrier=1,data=ordered,nomblk_io_submit,noauto_da_alloc,errors=panic wait,check | ||
/dev/block/platform/msm_sdcc.3/by-num/p2 /data1 f2fs noatime,nodiratime,nosuid,nodev,inline_xattr,discard,rw wait,check | ||
|
||
# SD card | ||
/devices/platform/msm_sdcc.3/mmc_host/mmc1* auto vfat defaults voldmanaged=sdcard0:auto,noemulatedsd | ||
/devices/platform/msm_sdcc.3/mmc_host/mmc1* auto vfat defaults voldmanaged=sdcard1:auto,noemulatedsd | ||
|
||
# USB storage | ||
/devices/platform/msm_hsusb_host.0/usb1* auto auto defaults voldmanaged=usbdisk:auto | ||
d* auto auto defaults voldmanaged=usbdisk:auto,noemulatedsd | ||
|
||
# ZRAM | ||
/dev/block/zram0 none swap defaults zramsize=268435456 | ||
/dev/block/zram0 none swap defaults zramsize=268435456 |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/system/bin/sh | ||
|
||
export PATH=${PATH}:/system/bin/:/system/xbin/ | ||
|
||
# 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 | ||
|
||
# Attempt to link data content 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 | ||
|
||
# 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 |
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,3 +1,3 @@ | ||
# Android fstab file. | ||
#<src> <mnt_point> <type> <mnt_flags> <fs_mgr_flags> | ||
/dev/block/mmcblk0p22 /system ext4 remount,ro,noatime,barrier=0 wait | ||
#<src> <mnt_point> <type> <mnt_flags> <fs_mgr_flags> | ||
/dev/block/mmcblk0p22 /system ext4 remount,ro,noatime,barrier=0 wait |