Skip to content

Commit

Permalink
Switch to nexus style mode completely v3
Browse files Browse the repository at this point in the history
This is a 3rd iteration of the patch in which we go completely Nexus.
We eliminate external sdcard completely and use it as /data that can be fully encrypted.
In addition we perform series of storage layout changes, cleanups and optimizations.

Now to the details:
* Use original "userdata" parititon as /system (60% more space for GApps and ODEX data).
* Use original system partiton as /cache (one can relocate dalvik-cache here
  to allow apps ODEX data to not be encrypted and to be fetched faster).
  This also allow much faster boot with encrypted data (dalvik-cache is available on boot for asking user's password).
* Reduce size of primary zram swap to 96MB since profiling showed this to be sufficient (20% more RAM).
* Use original "cache" partition as secondary swap (to provide backup swap for smaller zram swap).
* We create pre-odexed build optimized for "small" devices which should allow the following:
  - Avoid usage of userdata for DEX data of system apps and data duplication
  - Avoid encryption of ODEX data of system apps
  - Allow much faster access from /system partition
  - Enable ART-small mode which pre-compiles ODEX data for system apps and relocaes to dalvik-cache only bare minimum of clasees
* Add misc recovery related settings and coresponding changes to TWRP in order to support above.
* Modify recovery related settings (this device tree can be used for building TWRP image)
* Remove duplicated default init.rc code
* General cleanups

Change-Id: Ieb2b58569fcc20bb2d77def3f205fd009386d7bc
  • Loading branch information
eugenesan committed Oct 3, 2015
1 parent fd693a0 commit 7251d21
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion BoardConfig.mk
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ TW_INCLUDE_NTFS_3G := true
TW_BRIGHTNESS_PATH := "/sys/class/leds/lcd-backlight/brightness"
TW_BACKUP_DATA_MEDIA := true

# Dalvik/ART optimizations
# Dalvik/ART
WITH_DEXPREOPT := true
WITH_DEXPREOPT_COMP := false
WITH_DEXPREOPT_PIC := true
Expand Down
1 change: 1 addition & 0 deletions device_pyramid.mk
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ $(call inherit-product, device/htc/pyramid/media_a1026.mk)
## htc audio settings
$(call inherit-product, device/htc/pyramid/media_htcaudio.mk)

# setup dalvik vm configs
$(call inherit-product, frameworks/native/build/phone-hdpi-512-dalvik-heap.mk)

# Discard inherited values and use our own instead.
Expand Down
2 changes: 1 addition & 1 deletion recovery/root/etc/twrp.fstab
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
/recovery emmc /dev/block/mmcblk0p21
/system ext4 /dev/block/mmcblk0p23
/data f2fs /dev/block/mmcblk1 length=-16384
/cache f2fs /dev/block/mmcblk0p24
/cache ext4 /dev/block/mmcblk0p22
/misc emmc /dev/block/mmcblk0p31
/usbdisk vfat /dev/block/sda1 /dev/block/sda flags=display="usbdisk";storage;wipeingui;removable
8 changes: 4 additions & 4 deletions rootdir/etc/fstab.pyramid
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
/dev/block/platform/msm_sdcc.1/by-name/misc /misc emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/devlog /devlog ext4 rw,noatime,nosuid,nodev,barrier=0 wait
/dev/block/platform/msm_sdcc.1/by-name/userdata /system ext4 ro,noatime,barrier=0 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/system /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/system /cache f2fs rw,discard,nosuid,nodev,noatime,nodiratime,inline_xattr wait,check
/dev/block/platform/msm_sdcc.3/mmcblk1 /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.3/mmcblk1 /data f2fs noatime,nodiratime,nosuid,nodev,inline_xattr,discard,rw wait,check,encryptable=footer,length=-16384

# USB storage
/devices/platform/msm_hsusb_host.0/usb1 auto auto defaults voldmanaged=usbdisk:auto,noemulatedsd

# ZRAM
/dev/block/zram0 none swap defaults zramsize=134217728
/dev/block/zram0 none swap defaults zramsize=100663296

# System as secondary swap
/dev/block/platform/msm_sdcc.1/by-name/system none swap defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/cache none swap defaults defaults
3 changes: 0 additions & 3 deletions system_prop.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ PRODUCT_PROPERTY_OVERRIDES += \
PRODUCT_PROPERTY_OVERRIDES += \
windowsmgr.max_events_per_sec=300 \
pm.sleep_mode=1
# dalvik.vm.dexopt-data-only=1 \
# dalvik.vm.dexopt-flags=m=y \

# Display
PRODUCT_PROPERTY_OVERRIDES += \
Expand All @@ -42,7 +40,6 @@ PRODUCT_PROPERTY_OVERRIDES += \
PRODUCT_PROPERTY_OVERRIDES += \
ro.setupwizard.enable_bypass=1 \
ro.com.google.locationfeatures=1
# dalvik.vm.lockprof.threshold=500 \

# USB-OTG
persist.sys.isUsbOtgEnabled=true
Expand Down

0 comments on commit 7251d21

Please sign in to comment.