Revert "Move fstab files to /vendor/etc/."

This reverts commit 03f297713036576a60f7a3cbc96e3f7b8bc0f677.

recovery fails to find /misc while it tries to load from /fstab.sailfish.

Bug: 35811655
Bug: 36502022
Test: boot into recovery on sailfish. No "failed to find /misc partition"
      message.
Change-Id: I6552411e601372ce3cfb11f6c9dff9fcf6ead384
(cherry picked from commit d037710937d1c15c2d5c70f06f752799e77eaf60)
diff --git a/aosp_marlin.mk b/aosp_marlin.mk
index 2c7e061..edc959f 100644
--- a/aosp_marlin.mk
+++ b/aosp_marlin.mk
@@ -31,7 +31,7 @@
 PRODUCT_MANUFACTURER := google
 PRODUCT_RESTRICT_VENDOR_FILES := true
 
-PRODUCT_COPY_FILES += device/google/marlin/fstab.common:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.marlin
+PRODUCT_COPY_FILES += device/google/marlin/fstab.aosp_common:root/fstab.marlin
 
 $(call inherit-product, device/google/marlin/device-marlin.mk)
 $(call inherit-product-if-exists, vendor/google_devices/marlin/device-vendor-marlin.mk)
diff --git a/aosp_sailfish.mk b/aosp_sailfish.mk
index d24877a..e3f77fc 100644
--- a/aosp_sailfish.mk
+++ b/aosp_sailfish.mk
@@ -31,7 +31,7 @@
 PRODUCT_MANUFACTURER := google
 PRODUCT_RESTRICT_VENDOR_FILES := true
 
-PRODUCT_COPY_FILES += device/google/marlin/fstab.common:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.sailfish
+PRODUCT_COPY_FILES += device/google/marlin/fstab.aosp_common:root/fstab.sailfish
 
 $(call inherit-product, device/google/marlin/device-sailfish.mk)
 $(call inherit-product-if-exists, vendor/google_devices/marlin/device-vendor-sailfish.mk)
diff --git a/device-marlin.mk b/device-marlin.mk
index 7f8a5bd..bd2f54f 100644
--- a/device-marlin.mk
+++ b/device-marlin.mk
@@ -56,7 +56,7 @@
 PRODUCT_COPY_FILES += \
     device/google/marlin/init.common.rc:$(INIT_RC) \
     device/google/marlin/init.common.usb.rc:$(INIT_USB_RC) \
-    device/google/marlin/fstab.common:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.marlin \
+    device/google/marlin/fstab.common:root/fstab.marlin \
     device/google/marlin/ueventd.common.rc:$(INIT_UEVENTD_RC) \
     device/google/marlin/init.recovery.common.rc:root/init.recovery.marlin.rc
 
diff --git a/device-sailfish.mk b/device-sailfish.mk
index 49b07b3..b3cb729 100644
--- a/device-sailfish.mk
+++ b/device-sailfish.mk
@@ -56,7 +56,7 @@
 PRODUCT_COPY_FILES += \
     device/google/marlin/init.common.rc:$(INIT_RC) \
     device/google/marlin/init.common.usb.rc:$(INIT_USB_RC) \
-    device/google/marlin/fstab.common:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.sailfish \
+    device/google/marlin/fstab.common:root/fstab.sailfish \
     device/google/marlin/ueventd.common.rc:$(INIT_UEVENTD_RC) \
     device/google/marlin/init.recovery.common.rc:root/init.recovery.sailfish.rc
 
diff --git a/fstab.aosp_common b/fstab.aosp_common
new file mode 100755
index 0000000..9b5f0b1
--- /dev/null
+++ b/fstab.aosp_common
@@ -0,0 +1,16 @@
+# Android fstab file.
+# The filesystem that contains the filesystem checker binary (typically /system) cannot
+# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
+
+#TODO: Add 'check' as fs_mgr_flags with data partition.
+# Currently we dont have e2fsck compiled. So fs check would failed.
+
+#<src>                                  <mnt_point>       <type>  <mnt_flags and options>                     <fs_mgr_flags>
+/dev/block/platform/soc/624000.ufshc/by-name/system    /           ext4    ro,barrier=1                                wait,slotselect,verify
+# 'vendor' partition is now early-mounted and fstab entry is specified in device tree
+# /dev/block/platform/soc/624000.ufshc/by-name/vendor    /vendor     ext4    ro,barrier=1                                wait,slotselect
+/dev/block/platform/soc/624000.ufshc/by-name/modem     /firmware/radio    vfat    ro,shortname=lower,uid=1000,gid=0,dmask=227,fmask=337,context=u:object_r:firmware_file:s0   wait,slotselect
+/dev/block/platform/soc/624000.ufshc/by-name/userdata    /data             ext4    noatime,nosuid,nodev,barrier=1,noauto_da_alloc      latemount,wait,check,formattable,fileencryption=ice
+/dev/block/zram0                        none              swap    defaults                                            zramsize=536870912
+/dev/block/platform/soc/624000.ufshc/by-name/misc        /misc           emmc  defaults defaults
+/devices/*/xhci-hcd.0.auto/usb*           auto              vfat    defaults                                            voldmanaged=usb:auto
diff --git a/fstab.common b/fstab.common
index 0c1111f..803f1de 100755
--- a/fstab.common
+++ b/fstab.common
@@ -1,14 +1,16 @@
 # Android fstab file.
-# The filesystem that contains the filesystem e2fsck binary (typically /system) cannot
-# specify 'check', and must come before any filesystems that do specify 'check'
+# The filesystem that contains the filesystem checker binary (typically /system) cannot
+# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
 
-# NOTE: /vendor partition is now early-mounted and the fstab entry is specified in device tree:
-#       /proc/device-tree/firmware/android/fstab/vendor
-
-#<src>                                                  <mnt_point>         <type>  <mnt_flags and options>     <fs_mgr_flags>
-/dev/block/platform/soc/624000.ufshc/by-name/system     /                   ext4    ro,barrier=1                wait,slotselect,verify
-/dev/block/platform/soc/624000.ufshc/by-name/modem      /firmware/radio     vfat    ro,shortname=lower,uid=1000,gid=0,dmask=227,fmask=337,context=u:object_r:firmware_file:s0   wait,slotselect
-/dev/block/platform/soc/624000.ufshc/by-name/userdata   /data               ext4    noatime,nosuid,nodev,barrier=1,noauto_da_alloc  latemount,wait,check,formattable,fileencryption=ice,quota
-/dev/block/zram0                                        none                swap    defaults                    zramsize=536870912
-/dev/block/platform/soc/624000.ufshc/by-name/misc       /misc               emmc    defaults                    defaults
-/devices/*/xhci-hcd.0.auto/usb*                         auto                vfat    defaults                    voldmanaged=usb:auto
+#TODO: Add 'check' as fs_mgr_flags with data partition.
+# Currently we dont have e2fsck compiled. So fs check would failed.
+# NOTE: fstab.aosp_common is used for aosp. Make changes there as well.
+#<src>                                  <mnt_point>       <type>  <mnt_flags and options>                     <fs_mgr_flags>
+/dev/block/platform/soc/624000.ufshc/by-name/system    /           ext4    ro,barrier=1                                wait,slotselect,verify
+# 'vendor' partition is now early-mounted and fstab entry is specified in device tree
+# /dev/block/platform/soc/624000.ufshc/by-name/vendor    /vendor     ext4    ro,barrier=1                                wait,slotselect,verify
+/dev/block/platform/soc/624000.ufshc/by-name/modem     /firmware/radio    vfat    ro,shortname=lower,uid=1000,gid=0,dmask=227,fmask=337,context=u:object_r:firmware_file:s0   wait,slotselect
+/dev/block/platform/soc/624000.ufshc/by-name/userdata    /data             ext4    noatime,nosuid,nodev,barrier=1,noauto_da_alloc      latemount,wait,check,formattable,fileencryption=ice,quota
+/dev/block/zram0                        none              swap    defaults                                            zramsize=536870912
+/dev/block/platform/soc/624000.ufshc/by-name/misc        /misc           emmc  defaults defaults
+/devices/*/xhci-hcd.0.auto/usb*           auto              vfat    defaults                                            voldmanaged=usb:auto
diff --git a/init.common.rc b/init.common.rc
index 7297a71..5d1d72d 100644
--- a/init.common.rc
+++ b/init.common.rc
@@ -94,8 +94,8 @@
     wait /dev/block/platform/soc/${ro.boot.bootdevice}
     symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice
 
-    mount_all /vendor/etc/fstab.${ro.hardware} --early
-    swapon_all /vendor/etc/fstab.${ro.hardware}
+    mount_all fstab.${ro.hardware} --early
+    swapon_all fstab.${ro.hardware}
 
     # Keeping following partitions outside fstab file. As user may not have
     # these partition flashed on the device. Failure to mount any partition in fstab file
@@ -126,7 +126,7 @@
     start bootanim
 
     # mount RW partitions which need run fsck
-    mount_all /vendor/etc/fstab.${ro.hardware} --late
+    mount_all fstab.${ro.hardware} --late
 
     # boot time fs tune
     write /sys/block/sda/queue/iostats 0