mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2025-05-02 06:26:20 -04:00
Manifest cleanup + always remove latemount from /cache
formatting/erasing /cache will result in selinux contexts being lost these are normally restored by system/core/rootdir/init.rc in post-fs but latemount causes /cache to not be mounted beforehand preventing it from ever being fixed result is broken ota and recovery updates
This commit is contained in:
parent
c5d2f25797
commit
6c4eadcdc7
5 changed files with 113 additions and 6 deletions
|
@ -206,7 +206,7 @@ export -f hardenLocation;
|
|||
|
||||
enableZram() {
|
||||
cd "$DOS_BUILD_BASE$1";
|
||||
sed -i 's|#/dev/block/zram0|/dev/block/zram0|' fstab.* root/fstab.* rootdir/fstab.* rootdir/etc/fstab.* &>/dev/null || true;
|
||||
sed -i 's|#/dev/block/zram0|/dev/block/zram0|' fstab.* root/fstab.* rootdir/fstab.* rootdir/*/fstab.* &>/dev/null || true;
|
||||
echo "Enabled zram for $1";
|
||||
cd "$DOS_BUILD_BASE";
|
||||
}
|
||||
|
@ -214,9 +214,14 @@ export -f enableZram;
|
|||
|
||||
hardenUserdata() {
|
||||
cd "$DOS_BUILD_BASE$1";
|
||||
|
||||
#Remove latemount to allow selinux contexts be restored upon /cache wipe
|
||||
#Fixes broken OTA updater and broken /recovery updater
|
||||
sed -i '/\/cache/s|latemount,||' fstab.* root/fstab.* rootdir/fstab.* rootdir/*/fstab.* &>/dev/null || true;
|
||||
|
||||
#TODO: Ensure: noatime,nosuid,nodev
|
||||
sed -i '/\/data/{/discard/!s|nosuid|discard,nosuid|}' fstab.* root/fstab.* rootdir/fstab.* rootdir/etc/fstab.* &>/dev/null || true;
|
||||
sed -i 's|encryptable=/|forceencrypt=/|' fstab.* root/fstab.* rootdir/fstab.* rootdir/etc/fstab.* &>/dev/null || true;
|
||||
sed -i '/\/data/{/discard/!s|nosuid|discard,nosuid|}' fstab.* root/fstab.* rootdir/fstab.* rootdir/*/fstab.* &>/dev/null || true;
|
||||
sed -i 's|encryptable=/|forceencrypt=/|' fstab.* root/fstab.* rootdir/fstab.* rootdir/*/fstab.* &>/dev/null || true;
|
||||
echo "Hardened /data for $1";
|
||||
cd "$DOS_BUILD_BASE";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue