Skip to content

Commit

Permalink
Remove SkipMountingPartitions from vendor libfstab
Browse files Browse the repository at this point in the history
SkipMountingPartitions() should only be called from a system process
as the config file is in /system_ext.
Remove it from the vendor variant of libfstab.

Bug: 158301941
Test: build hardware/interfaces/boot/1.1/default/boot_control and check symbol
Change-Id: I834183a623c0711dd79b89486fc3fc80f9710801
Merged-In: I834183a623c0711dd79b89486fc3fc80f9710801
(cherry picked from e7cb09d2264a9071425a45bd76d4e6be45607d5f)

Former-commit-id: 0a0f4b163a5fba68a656fd55cfaa6bca6ce69436
  • Loading branch information
Hung-ying Tyan committed Jul 3, 2020
1 parent 59a2423 commit 30f256f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions fs_mgr/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@ cc_library_static {
darwin: {
enabled: false,
},
vendor: {
cflags: [
// Skipping entries in fstab should only be done in a system
// process as the config file is in /system_ext.
// Remove the op from the vendor variant.
"-DNO_SKIP_MOUNT",
],
},
},
export_include_dirs: ["include_fstab"],
header_libs: [
Expand Down
6 changes: 6 additions & 0 deletions fs_mgr/fs_mgr_fstab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,9 @@ bool ReadFstabFromFile(const std::string& path, Fstab* fstab) {
TransformFstabForDsu(fstab, Split(lp_names, ","));
}

#ifndef NO_SKIP_MOUNT
SkipMountingPartitions(fstab);
#endif
EnableMandatoryFlags(fstab);

return true;
Expand Down Expand Up @@ -720,11 +722,14 @@ bool ReadFstabFromDt(Fstab* fstab, bool log) {
return false;
}

#ifndef NO_SKIP_MOUNT
SkipMountingPartitions(fstab);
#endif

return true;
}

#ifndef NO_SKIP_MOUNT
// For GSI to skip mounting /product and /system_ext, until there are well-defined interfaces
// between them and /system. Otherwise, the GSI flashed on /system might not be able to work with
// device-specific /product and /system_ext. skip_mount.cfg belongs to system_ext partition because
Expand Down Expand Up @@ -756,6 +761,7 @@ bool SkipMountingPartitions(Fstab* fstab) {

return true;
}
#endif

// Loads the fstab file and combines with fstab entries passed in from device tree.
bool ReadDefaultFstab(Fstab* fstab) {
Expand Down

0 comments on commit 30f256f

Please sign in to comment.