Resize /system in boot
Is it really safe? Tested on Allview V3 Viper and Huawei Mate 9
This commit is contained in:
parent
1e27cc1157
commit
25d7b4c539
3
base.mk
3
base.mk
@ -43,5 +43,8 @@ PRODUCT_COPY_FILES += \
|
|||||||
PRODUCT_COPY_FILES += \
|
PRODUCT_COPY_FILES += \
|
||||||
device/phh/treble/nfc/libnfc-nci.conf:system/etc/libnfc-nci.conf
|
device/phh/treble/nfc/libnfc-nci.conf:system/etc/libnfc-nci.conf
|
||||||
|
|
||||||
|
PRODUCT_COPY_FILES += \
|
||||||
|
device/phh/treble/resize-system.sh:system/bin/resize-system.sh
|
||||||
|
|
||||||
PRODUCT_PACKAGES += \
|
PRODUCT_PACKAGES += \
|
||||||
treble-environ-rc
|
treble-environ-rc
|
||||||
|
11
resize-system.sh
Normal file
11
resize-system.sh
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#!/system/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ "grep ' /system ' /proc/mounts |cut -d ' ' -f 1 |wc -l" -ne 1 ];then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
mount -o remount,rw /system
|
||||||
|
resize2fs $(grep ' /system ' /proc/mounts |cut -d ' ' -f 1)
|
||||||
|
mount -o remount,ro /system
|
@ -1,3 +1,4 @@
|
|||||||
/system/bin/phh-su u:object_r:phhsu_exec:s0
|
/system/bin/phh-su u:object_r:phhsu_exec:s0
|
||||||
/system/bin/vndk-detect u:object_r:vndk_detect_exec:s0
|
/system/bin/vndk-detect u:object_r:vndk_detect_exec:s0
|
||||||
/system/etc/usb_audio_policy_configuration.xml u:object_r:vendor_configs_file:s0
|
/system/etc/usb_audio_policy_configuration.xml u:object_r:vendor_configs_file:s0
|
||||||
|
/system/bin/resize-system.sh u:object_r:update_engine_exec:s0
|
||||||
|
6
sepolicy/resize.te
Normal file
6
sepolicy/resize.te
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
allow update_engine { toolbox_exec system_file }:file rx_file_perms;
|
||||||
|
allow update_engine labeledfs:filesystem remount;
|
||||||
|
|
||||||
|
allow update_engine sysfs_fs_ext4_features:dir r_dir_perms;
|
||||||
|
allow update_engine sysfs_fs_ext4_features:file r_file_perms;
|
||||||
|
allow update_engine self:capability { sys_resource };
|
1
vndk.rc
1
vndk.rc
@ -1,4 +1,5 @@
|
|||||||
on post-fs
|
on post-fs
|
||||||
exec - root -- /system/bin/vndk-detect
|
exec - root -- /system/bin/vndk-detect
|
||||||
|
exec - root -- /system/bin/resize-system.sh
|
||||||
mount none /system/etc/usb_audio_policy_configuration.xml /vendor/etc/usb_audio_policy_configuration.xml bind
|
mount none /system/etc/usb_audio_policy_configuration.xml /vendor/etc/usb_audio_policy_configuration.xml bind
|
||||||
export LD_CONFIG_FILE /system/etc/ld.config.${persist.sys.vndk}.txt
|
export LD_CONFIG_FILE /system/etc/ld.config.${persist.sys.vndk}.txt
|
||||||
|
Loading…
Reference in New Issue
Block a user