The zumapro targets that only boot with 16kb kernels will have this filesystem setup for data and metadata partitions: - data partition: f2fs - metadata partition: ext4 Important: For the HW file encryption to work in the data partition in 16kb kernels the `dusize_4k` parameter has to be set: ``` fileencryption=:aes-256-hctr2:inlinecrypt_optimized+wrappedkey_v0+dusize_4k ``` Bug: 350101696 Test: built pgagnostic target and checked the fs for mounted partitions. Flag: EXEMPT bugfix Change-Id: I566618e6fa1db2ff4463e00e8d091e7226ba0399
164 lines
5 KiB
Text
164 lines
5 KiB
Text
/*
|
|
* Copyright (C) 2024 The Android Open Source Project
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
// By default this device uses hardware-wrapped keys for storage encryption,
|
|
// which is intended to offer increased security over the traditional method
|
|
// (software keys). However, hardware-wrapped keys aren't compatible with
|
|
// FIPS-140 certification of the encryption hardware, and hence we have to
|
|
// disable the use of them in FIPS mode. This requires having two fstab files:
|
|
// one for the default mode, and one for FIPS mode selectable via
|
|
// androidboot.fstab_suffix on the kernel command line. These fstabs should be
|
|
// identical with the exception of the encryption settings, so to keep them in
|
|
// sync the rules below generate them from a template file.
|
|
|
|
soong_namespace {
|
|
imports: [
|
|
"device/google/zumapro",
|
|
],
|
|
}
|
|
|
|
package {
|
|
// See: http://go/android-license-faq
|
|
// A large-scale-change added 'default_applicable_licenses' to import
|
|
// all of the 'license_kinds' from "device_google_zumapro_license"
|
|
// to get the below license kinds:
|
|
// SPDX-license-identifier-Apache-2.0
|
|
default_applicable_licenses: ["device_google_zumapro_license"],
|
|
}
|
|
|
|
genrule {
|
|
name: "gen_fstab.zuma-hw-encrypt",
|
|
srcs: [
|
|
":fstab.zumapro.common",
|
|
"fstab.rw.zumapro.16kb",
|
|
],
|
|
out: ["fstab.zuma"],
|
|
cmd: "sed -e s/@fileencryption@/fileencryption=:aes-256-hctr2:inlinecrypt_optimized+wrappedkey_v0/" +
|
|
" -e s/@inlinecrypt@/inlinecrypt/ " +
|
|
" -e s/@metadata_encryption@/metadata_encryption=:wrappedkey_v0/ $(in) > $(out)",
|
|
}
|
|
|
|
genrule {
|
|
name: "gen_fstab.zumapro-hw-encrypt",
|
|
srcs: [
|
|
":fstab.zumapro.common",
|
|
"fstab.rw.zumapro.16kb",
|
|
],
|
|
out: ["fstab.zumapro"],
|
|
cmd: "sed -e s/@fileencryption@/fileencryption=:aes-256-hctr2:inlinecrypt_optimized+wrappedkey_v0+dusize_4k/" +
|
|
" -e s/@inlinecrypt@/inlinecrypt/ " +
|
|
" -e s/@metadata_encryption@/metadata_encryption=:wrappedkey_v0/ $(in) > $(out)",
|
|
}
|
|
|
|
genrule {
|
|
name: "gen_fstab.zuma-sw-encrypt",
|
|
srcs: [
|
|
":fstab.zumapro.common",
|
|
"fstab.rw.zumapro.16kb",
|
|
],
|
|
out: ["fstab.zuma"],
|
|
cmd: "sed -e s/@fileencryption@/fileencryption=aes-256-xts:aes-256-hctr2/" +
|
|
" -e s/@inlinecrypt@// " +
|
|
" -e s/@metadata_encryption@/metadata_encryption=/ $(in) > $(out)",
|
|
}
|
|
|
|
genrule {
|
|
name: "gen_fstab.zumapro-sw-encrypt",
|
|
srcs: [
|
|
":fstab.zumapro.common",
|
|
"fstab.rw.zumapro.16kb",
|
|
],
|
|
out: ["fstab.zumapro"],
|
|
cmd: "sed -e s/@fileencryption@/fileencryption=aes-256-xts:aes-256-hctr2/" +
|
|
" -e s/@inlinecrypt@// " +
|
|
" -e s/@metadata_encryption@/metadata_encryption=/ $(in) > $(out)",
|
|
}
|
|
|
|
genrule {
|
|
name: "gen_fstab.zuma-no-encrypt",
|
|
srcs: [
|
|
":fstab.zumapro.common",
|
|
"fstab.rw.zumapro.16kb",
|
|
],
|
|
out: ["fstab.zuma"],
|
|
cmd: "sed -e s/@fileencryption@//" +
|
|
" -e s/@inlinecrypt@// " +
|
|
" -e s/@metadata_encryption@// $(in) > $(out)",
|
|
}
|
|
|
|
genrule {
|
|
name: "gen_fstab.zumapro-no-encrypt",
|
|
srcs: [
|
|
":fstab.zumapro.common",
|
|
"fstab.rw.zumapro.16kb",
|
|
],
|
|
out: ["fstab.zumapro"],
|
|
cmd: "sed -e s/@fileencryption@//" +
|
|
" -e s/@inlinecrypt@// " +
|
|
" -e s/@metadata_encryption@// $(in) > $(out)",
|
|
}
|
|
|
|
genrule {
|
|
name: "gen_fstab.zuma-fips",
|
|
srcs: [
|
|
":fstab.zumapro.common",
|
|
"fstab.rw.zumapro.16kb",
|
|
],
|
|
out: ["fstab.zuma-fips"],
|
|
cmd: "sed -e s/@fileencryption@/fileencryption=aes-256-xts/" +
|
|
" -e s/@inlinecrypt@/inlinecrypt/ " +
|
|
" -e s/@metadata_encryption@/metadata_encryption=aes-256-xts/ $(in) > $(out)",
|
|
}
|
|
|
|
genrule {
|
|
name: "gen_fstab.zumapro-fips",
|
|
srcs: [
|
|
":fstab.zumapro.common",
|
|
"fstab.rw.zumapro.16kb",
|
|
],
|
|
out: ["fstab.zumapro-fips"],
|
|
cmd: "sed -e s/@fileencryption@/fileencryption=aes-256-xts/" +
|
|
" -e s/@inlinecrypt@/inlinecrypt/ " +
|
|
" -e s/@metadata_encryption@/metadata_encryption=aes-256-xts/ $(in) > $(out)",
|
|
}
|
|
|
|
prebuilt_etc {
|
|
name: "fstab.zuma",
|
|
src: ":gen_fstab.zuma-hw-encrypt",
|
|
vendor: true,
|
|
vendor_ramdisk_available: true,
|
|
}
|
|
|
|
prebuilt_etc {
|
|
name: "fstab.zumapro",
|
|
src: ":gen_fstab.zumapro-hw-encrypt",
|
|
vendor: true,
|
|
vendor_ramdisk_available: true,
|
|
}
|
|
|
|
prebuilt_etc {
|
|
name: "fstab.zuma-fips",
|
|
src: ":gen_fstab.zuma-fips",
|
|
vendor: true,
|
|
vendor_ramdisk_available: true,
|
|
}
|
|
|
|
prebuilt_etc {
|
|
name: "fstab.zumapro-fips",
|
|
src: ":gen_fstab.zumapro-fips",
|
|
vendor: true,
|
|
vendor_ramdisk_available: true,
|
|
}
|