OSDN Git Service

Replacing fs_mgr_read_fstab() with new fs_mgr APIs
authorBowgo Tsai <bowgotsai@google.com>
Fri, 10 Mar 2017 11:20:54 +0000 (19:20 +0800)
committerBowgo Tsai <bowgotsai@google.com>
Fri, 10 Mar 2017 11:22:24 +0000 (19:22 +0800)
The fstab settings of early-mounted partitions (e.g., /vendor)
will be in kernel device tree. Switch to the new API to get the
whole settings with those in device tree:

    fs_mgr_read_fstab_with_dt("/fstab.device")

The original default /fstab.{ro.hardware} might be moved to
/vendor/etc/. or /odm/etc/. Use another new API to get the default
fstab instead of using the hard-coded /fstab.{ro.hardware}.
This API also includes the settings from device tree:

    fs_mgr_read_fstab_default()

Bug: 35811655
Test: build pass
Change-Id: I14bee88b9f599b7bbc2be56042684709e5946de2

boot_control_copy/bootinfo.c

index 82a134f..66ccba2 100644 (file)
 // that's what's being used.
 static struct fstab *open_fstab(void)
 {
-  char propbuf[PROPERTY_VALUE_MAX];
-  char fstab_name[PROPERTY_VALUE_MAX + 32];
-  struct fstab *fstab;
-
-  property_get("ro.hardware", propbuf, "");
-  snprintf(fstab_name, sizeof(fstab_name), "/fstab.%s", propbuf);
-  fstab = fs_mgr_read_fstab(fstab_name);
+  struct fstab *fstab = fs_mgr_read_fstab_default();
   if (fstab != NULL)
     return fstab;
 
-  fstab = fs_mgr_read_fstab("/fstab.device");
+  fstab = fs_mgr_read_fstab_with_dt("/fstab.device");
   return fstab;
 }