Skip to content

Commit 15cd1cd

Browse files
Yifan HongGerrit Code Review
Yifan Hong
authored and
Gerrit Code Review
committed
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
2 parents cf539f1 + c7ed02f commit 15cd1cd

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

init/first_stage_init.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void PrepareSwitchRoot() {
117117

118118
auto dst_dir = android::base::Dirname(dst);
119119
std::error_code ec;
120-
if (!fs::create_directories(dst_dir, ec)) {
120+
if (!fs::create_directories(dst_dir, ec) && !!ec) {
121121
LOG(FATAL) << "Cannot create " << dst_dir << ": " << ec.message();
122122
}
123123
if (rename(src, dst) != 0) {
@@ -315,7 +315,7 @@ int FirstStageMain(int argc, char** argv) {
315315
std::string dest = GetRamdiskPropForSecondStage();
316316
std::string dir = android::base::Dirname(dest);
317317
std::error_code ec;
318-
if (!fs::create_directories(dir, ec)) {
318+
if (!fs::create_directories(dir, ec) && !!ec) {
319319
LOG(FATAL) << "Can't mkdir " << dir << ": " << ec.message();
320320
}
321321
if (!fs::copy_file(kBootImageRamdiskProp, dest, ec)) {

libcutils/fs_config.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,14 @@ static const struct fs_path_config android_files[] = {
203203
CAP_MASK_LONG(CAP_SETGID),
204204
"system/bin/simpleperf_app_runner" },
205205
{ 00755, AID_ROOT, AID_ROOT, 0, "first_stage_ramdisk/system/bin/e2fsck" },
206-
{ 00755, AID_ROOT, AID_ROOT, 0, "first_stage_ramdisk/system/bin/tune2fs" },
206+
#ifdef __LP64__
207+
{ 00755, AID_ROOT, AID_ROOT, 0, "first_stage_ramdisk/system/bin/linker64" },
208+
#else
209+
{ 00755, AID_ROOT, AID_ROOT, 0, "first_stage_ramdisk/system/bin/linker" },
210+
#endif
207211
{ 00755, AID_ROOT, AID_ROOT, 0, "first_stage_ramdisk/system/bin/resize2fs" },
208212
{ 00755, AID_ROOT, AID_ROOT, 0, "first_stage_ramdisk/system/bin/snapuserd" },
213+
{ 00755, AID_ROOT, AID_ROOT, 0, "first_stage_ramdisk/system/bin/tune2fs" },
209214
// generic defaults
210215
{ 00755, AID_ROOT, AID_ROOT, 0, "bin/*" },
211216
{ 00640, AID_ROOT, AID_SHELL, 0, "fstab.*" },

libsparse/Android.bp

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ cc_library {
44
name: "libsparse",
55
host_supported: true,
66
ramdisk_available: true,
7+
vendor_ramdisk_available: true,
78
recovery_available: true,
89
unique_host_soname: true,
910
vendor_available: true,

0 commit comments

Comments
 (0)