Files
build/tools/fs_config/android_filesystem_config_test_data.h
Mark Salyzyn 256d339413 fs_config_generate: add -P <partitionlist> option
Add a -P option to fs_config_generate that allows us to filter on
a comma separated partition whitelist or minus prefixed -blacklist.
A partition is defined as accessible as <partition>/ or
system/<partition>/.

No change for legacy, where no -P flag is specified.

For system.img, but not vendor, oem or odm file references:
fs_config_generate -P -vendor,-oem,-odm

For vendor.img file references:
fs_config_generate -P vendor

For oem.img file references:
fs_config_generate -P oem

For odm.img file references:
fs_config_generate -P odm

Add and fortify tests for each of these cases.

SideEffects: none
Test: gTest host fs_config-unit-test
Bug: 36071012
Change-Id: I0537453bb289d41ef98ad76e69f78ae49358a1b3
2017-04-25 15:09:01 -07:00

57 lines
2.6 KiB
C

/*
* Copyright (C) 2017 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.
*/
#include <private/android_filesystem_config.h>
/* Test Data */
#undef NO_ANDROID_FILESYSTEM_CONFIG_DEVICE_DIRS
#undef NO_ANDROID_FILESYSTEM_CONFIG_DEVICE_FILES
static const struct fs_path_config android_device_dirs[] = {
{00555, AID_ROOT, AID_SYSTEM, 0, "system/etc"},
{00555, AID_ROOT, AID_SYSTEM, 0, "vendor/etc"},
{00555, AID_ROOT, AID_SYSTEM, 0, "oem/etc"},
{00555, AID_ROOT, AID_SYSTEM, 0, "odm/etc"},
{00755, AID_SYSTEM, AID_ROOT, 0, "system/oem/etc"},
{00755, AID_SYSTEM, AID_ROOT, 0, "system/odm/etc"},
{00755, AID_SYSTEM, AID_ROOT, 0, "system/vendor/etc"},
{00755, AID_SYSTEM, AID_ROOT, 0, "data/misc"},
{00755, AID_SYSTEM, AID_ROOT, 0, "oem/data/misc"},
{00755, AID_SYSTEM, AID_ROOT, 0, "odm/data/misc"},
{00755, AID_SYSTEM, AID_ROOT, 0, "vendor/data/misc"},
{00555, AID_SYSTEM, AID_ROOT, 0, "etc"},
};
static const struct fs_path_config android_device_files[] = {
{00444, AID_ROOT, AID_SYSTEM, 0, "system/etc/fs_config_dirs"},
{00444, AID_ROOT, AID_SYSTEM, 0, "vendor/etc/fs_config_dirs"},
{00444, AID_ROOT, AID_SYSTEM, 0, "oem/etc/fs_config_dirs"},
{00444, AID_ROOT, AID_SYSTEM, 0, "odm/etc/fs_config_dirs"},
{00444, AID_ROOT, AID_SYSTEM, 0, "system/etc/fs_config_files"},
{00444, AID_ROOT, AID_SYSTEM, 0, "vendor/etc/fs_config_files"},
{00444, AID_ROOT, AID_SYSTEM, 0, "oem/etc/fs_config_files"},
{00444, AID_ROOT, AID_SYSTEM, 0, "odm/etc/fs_config_files"},
{00644, AID_SYSTEM, AID_ROOT, 0, "system/vendor/etc/fs_config_dirs"},
{00644, AID_SYSTEM, AID_ROOT, 0, "system/oem/etc/fs_config_dirs"},
{00644, AID_SYSTEM, AID_ROOT, 0, "system/odm/etc/fs_config_dirs"},
{00644, AID_SYSTEM, AID_ROOT, 0, "system/vendor/etc/fs_config_files"},
{00644, AID_SYSTEM, AID_ROOT, 0, "system/oem/etc/fs_config_files"},
{00644, AID_SYSTEM, AID_ROOT, 0, "system/odm/etc/fs_config_files"},
{00644, AID_SYSTEM, AID_ROOT, 0, "etc/fs_config_files"},
{00666, AID_ROOT, AID_SYSTEM, 0, "data/misc/oem"},
};