Merge changes from topic "e2fsprogs_vendor_ramdisk"

* changes:
  fs_config Add first_stage_ramdisk/system/bin/linker[64]
  libsparse: make vendor_ramdisk_available.
  init: don't abort if directory already exists
This commit is contained in:
Yifan Hong 2020-11-20 19:50:44 +00:00 committed by Gerrit Code Review
commit 15cd1cd8fd
3 changed files with 9 additions and 3 deletions

View file

@ -117,7 +117,7 @@ void PrepareSwitchRoot() {
auto dst_dir = android::base::Dirname(dst);
std::error_code ec;
if (!fs::create_directories(dst_dir, ec)) {
if (!fs::create_directories(dst_dir, ec) && !!ec) {
LOG(FATAL) << "Cannot create " << dst_dir << ": " << ec.message();
}
if (rename(src, dst) != 0) {
@ -315,7 +315,7 @@ int FirstStageMain(int argc, char** argv) {
std::string dest = GetRamdiskPropForSecondStage();
std::string dir = android::base::Dirname(dest);
std::error_code ec;
if (!fs::create_directories(dir, ec)) {
if (!fs::create_directories(dir, ec) && !!ec) {
LOG(FATAL) << "Can't mkdir " << dir << ": " << ec.message();
}
if (!fs::copy_file(kBootImageRamdiskProp, dest, ec)) {

View file

@ -203,9 +203,14 @@ static const struct fs_path_config android_files[] = {
CAP_MASK_LONG(CAP_SETGID),
"system/bin/simpleperf_app_runner" },
{ 00755, AID_ROOT, AID_ROOT, 0, "first_stage_ramdisk/system/bin/e2fsck" },
{ 00755, AID_ROOT, AID_ROOT, 0, "first_stage_ramdisk/system/bin/tune2fs" },
#ifdef __LP64__
{ 00755, AID_ROOT, AID_ROOT, 0, "first_stage_ramdisk/system/bin/linker64" },
#else
{ 00755, AID_ROOT, AID_ROOT, 0, "first_stage_ramdisk/system/bin/linker" },
#endif
{ 00755, AID_ROOT, AID_ROOT, 0, "first_stage_ramdisk/system/bin/resize2fs" },
{ 00755, AID_ROOT, AID_ROOT, 0, "first_stage_ramdisk/system/bin/snapuserd" },
{ 00755, AID_ROOT, AID_ROOT, 0, "first_stage_ramdisk/system/bin/tune2fs" },
// generic defaults
{ 00755, AID_ROOT, AID_ROOT, 0, "bin/*" },
{ 00640, AID_ROOT, AID_SHELL, 0, "fstab.*" },

View file

@ -4,6 +4,7 @@ cc_library {
name: "libsparse",
host_supported: true,
ramdisk_available: true,
vendor_ramdisk_available: true,
recovery_available: true,
unique_host_soname: true,
vendor_available: true,