From 4e34e0ac28d8fed34e2ab7321fab5640938e9fb8 Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Fri, 5 Aug 2022 17:43:12 -0700 Subject: [PATCH] fstab: add back inlinecrypt for hw encryption Without this flag, fscrypt will return error for any filesystem operation involving the partitions mounted with the fileencryption=::inlinecrypt_optimized flag. Bug: 241606997 Test: enable KDN, switch to :gen_fstab.foo-hw-encrypt Signed-off-by: Kenny Root Change-Id: I9601fcdfa627df4e67f1586cd32ceef3c1f9ecac --- conf/Android.bp | 3 +++ conf/fstab.zuma.in | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/conf/Android.bp b/conf/Android.bp index 08850c78..4716b870 100644 --- a/conf/Android.bp +++ b/conf/Android.bp @@ -38,6 +38,7 @@ genrule { srcs: ["fstab.zuma.in"], out: ["fstab.zuma"], cmd: "sed -e s/@fileencryption@/::inlinecrypt_optimized+wrappedkey_v0/" + + " -e s/@inlinecrypt@/inlinecrypt/ " + " -e s/@metadata_encryption@/:wrappedkey_v0/ $(in) > $(out)", } @@ -46,6 +47,7 @@ genrule { srcs: ["fstab.zuma.in"], out: ["fstab.zuma"], cmd: "sed -e s/@fileencryption@/aes-256-xts/" + + " -e s/@inlinecrypt@// " + " -e s/@metadata_encryption@// $(in) > $(out)", } @@ -54,6 +56,7 @@ genrule { srcs: ["fstab.zuma.in"], out: ["fstab.zuma-fips"], cmd: "sed -e s/@fileencryption@/aes-256-xts/" + + " -e s/@inlinecrypt@/inlinecrypt/ " + " -e s/@metadata_encryption@/aes-256-xts/ $(in) > $(out)", } diff --git a/conf/fstab.zuma.in b/conf/fstab.zuma.in index 70e4988f..f49484ce 100644 --- a/conf/fstab.zuma.in +++ b/conf/fstab.zuma.in @@ -20,6 +20,6 @@ vendor_dlkm /vendor_dlkm /dev/block/platform/13200000.ufs/by-name/misc /misc emmc defaults wait /dev/block/platform/13200000.ufs/by-name/metadata /metadata f2fs noatime,nosuid,nodev,sync wait,check,formattable,first_stage_mount #/dev/block/platform/13200000.ufs/by-name/pvmfw /pvmfw emmc defaults wait,slotselect,avb=pvmfw,first_stage_mount -/dev/block/platform/13200000.ufs/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,reserve_root=32768,resgid=1065,fsync_mode=nobarrier,compress_extension=apk,compress_extension=apex,compress_extension=so,compress_extension=vdex,compress_extension=odex,atgc,checkpoint_merge,compress_cache latemount,wait,check,quota,formattable,sysfs_path=/dev/sys/block/bootdevice,checkpoint=fs,reservedsize=128M,fscompress,readahead_size_kb=128,fileencryption=@fileencryption@,metadata_encryption=@metadata_encryption@,keydirectory=/metadata/vold/metadata_encryption +/dev/block/platform/13200000.ufs/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,reserve_root=32768,resgid=1065,fsync_mode=nobarrier,compress_extension=apk,compress_extension=apex,compress_extension=so,compress_extension=vdex,compress_extension=odex,@inlinecrypt@,atgc,checkpoint_merge,compress_cache latemount,wait,check,quota,formattable,sysfs_path=/dev/sys/block/bootdevice,checkpoint=fs,reservedsize=128M,fscompress,readahead_size_kb=128,fileencryption=@fileencryption@,metadata_encryption=@metadata_encryption@,keydirectory=/metadata/vold/metadata_encryption /dev/block/platform/13200000.ufs/by-name/vbmeta /vbmeta emmc defaults slotselect,first_stage_mount /devices/platform/11210000.usb* auto vfat defaults voldmanaged=usb:auto