diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk index fea4c0a..480a724 100644 --- a/BoardConfigCommon.mk +++ b/BoardConfigCommon.mk @@ -88,7 +88,7 @@ DEVICE_MANIFEST_FILE += $(COMMON_PATH)/manifest.xml # Kernel BOARD_BOOT_HEADER_VERSION := 2 BOARD_KERNEL_BASE := 0x00000000 -BOARD_KERNEL_CMDLINE := androidboot.hardware=qcom androidboot.console=ttyMSM0 androidboot.fstab_suffix=qcom androidboot.memcg=1 lpm_levels.sleep_disabled=1 msm_rtb.filter=0x237 service_locator.enable=1 androidboot.usbcontroller=a600000.dwc3 swiotlb=2048 loop.max_part=7 cgroup.memory=nokmem,nosocket reboot=panic_warm +BOARD_KERNEL_CMDLINE := androidboot.hardware=qcom androidboot.console=ttyMSM0 androidboot.memcg=1 lpm_levels.sleep_disabled=1 msm_rtb.filter=0x237 service_locator.enable=1 androidboot.usbcontroller=a600000.dwc3 swiotlb=2048 loop.max_part=7 cgroup.memory=nokmem,nosocket reboot=panic_warm BOARD_KERNEL_CMDLINE += androidboot.init_fatal_reboot_target=recovery BOARD_KERNEL_CMDLINE += kpti=off BOARD_KERNEL_IMAGE_NAME := Image @@ -151,7 +151,7 @@ BOARD_USES_QCOM_HARDWARE := true TARGET_BOARD_PLATFORM := lito # Recovery -TARGET_RECOVERY_FSTAB := $(COMMON_PATH)/rootdir/etc/fstab.qcom +TARGET_RECOVERY_FSTAB := $(COMMON_PATH)/rootdir/etc/recovery.fstab BOARD_INCLUDE_DTB_IN_BOOTIMG := true BOARD_INCLUDE_RECOVERY_DTBO := true TARGET_RECOVERY_PIXEL_FORMAT := RGBX_8888 diff --git a/lito.mk b/lito.mk index c548afa..772574f 100644 --- a/lito.mk +++ b/lito.mk @@ -381,12 +381,17 @@ PRODUCT_PACKAGES += \ init.fingerprint.rc \ init.qcom.power.rc \ init.qcom.rc \ - init.recovery.qcom.rc \ init.target.rc \ - fstab.qcom \ - fstab.qcom_ramdisk \ + fstab.default \ + fstab.emmc \ + recovery.fstab \ ueventd.qcom.rc +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/rootdir/etc/fstab.default:$(TARGET_COPY_OUT_RAMDISK)/fstab.default \ + $(LOCAL_PATH)/rootdir/etc/fstab.emmc:$(TARGET_COPY_OUT_RAMDISK)/fstab.emmc \ + $(LOCAL_PATH)/rootdir/etc/init.recovery.qcom.rc:recovery/root/init.recovery.qcom.rc + # Sensors PRODUCT_PACKAGES += \ android.hardware.sensors@1.0-impl \ diff --git a/rootdir/Android.bp b/rootdir/Android.bp index 60601a2..c0b5000 100644 --- a/rootdir/Android.bp +++ b/rootdir/Android.bp @@ -49,8 +49,14 @@ sh_binary { // fstab prebuilt_etc { - name: "fstab.qcom", - src: "etc/fstab.qcom", + name: "fstab.default", + src: "etc/fstab.default", + vendor: true, +} + +prebuilt_etc { + name: "fstab.emmc", + src: "etc/fstab.emmc", vendor: true, } @@ -76,13 +82,6 @@ prebuilt_etc { vendor: true, } -prebuilt_etc { - name: "init.recovery.qcom.rc", - src: "etc/init.recovery.qcom.rc", - sub_dir: "init", - recovery: true, -} - prebuilt_etc { name: "init.target.rc", src: "etc/init.target.rc", diff --git a/rootdir/Android.mk b/rootdir/Android.mk deleted file mode 100644 index 5fc2d98..0000000 --- a/rootdir/Android.mk +++ /dev/null @@ -1,11 +0,0 @@ -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -include $(CLEAR_VARS) -LOCAL_MODULE := fstab.qcom_ramdisk -LOCAL_MODULE_STEM := fstab.qcom -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := ETC -LOCAL_SRC_FILES := etc/fstab.qcom -LOCAL_MODULE_PATH := $(TARGET_RAMDISK_OUT) -include $(BUILD_PREBUILT) \ No newline at end of file diff --git a/rootdir/etc/fstab.default b/rootdir/etc/fstab.default new file mode 100644 index 0000000..9620cbf --- /dev/null +++ b/rootdir/etc/fstab.default @@ -0,0 +1,51 @@ +# Copyright (c) 2018, The Linux Foundation. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# 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 + +# +system /system ext4 ro,barrier=1,discard wait,avb,logical,first_stage_mount,avb_keys=/avb/q-gsi.avbpubkey:/avb/r-gsi.avbpubkey:/avb/s-gsi.avbpubkey,readahead_size_kb=128 +system /system erofs ro wait,avb,logical,first_stage_mount,avb_keys=/avb/q-gsi.avbpubkey:/avb/r-gsi.avbpubkey:/avb/s-gsi.avbpubkey,readahead_size_kb=128 +system_ext /system_ext ext4 ro,barrier=1,discard wait,avb,logical,first_stage_mount,readahead_size_kb=128 +system_ext /system_ext erofs ro wait,avb,logical,first_stage_mount,readahead_size_kb=128 +product /product ext4 ro,barrier=1,discard wait,avb,logical,first_stage_mount,readahead_size_kb=128 +product /product erofs ro wait,avb,logical,first_stage_mount,readahead_size_kb=128 +vendor /vendor ext4 ro,barrier=1,discard wait,avb=vbmeta,logical,first_stage_mount,readahead_size_kb=128 +vendor /vendor erofs ro wait,avb=vbmeta,logical,first_stage_mount,readahead_size_kb=128 +odm /odm ext4 ro,barrier=1,discard wait,avb,logical,first_stage_mount +odm /odm erofs ro wait,avb,logical,first_stage_mount +/dev/block/by-name/metadata /metadata ext4 noatime,nosuid,nodev,discard wait,formattable,first_stage_mount +/dev/block/bootdevice/by-name/cache /cache ext4 nosuid,noatime,nodev,barrier=1 wait +/dev/block/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,reserve_root=32768,resgid=1065,fsync_mode=nobarrier,inlinecrypt latemount,wait,check,formattable,fileencryption=ice,wrappedkey,quota,reservedsize=128M,checkpoint=fs,readahead_size_kb=128 +/dev/block/bootdevice/by-name/persist /mnt/vendor/persist ext4 noatime,nosuid,nodev,barrier=1 wait +/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults +/devices/platform/soc/a600000.ssusb/a600000.dwc3/xhci-hcd.*.auto* /storage/usbotg vfat nosuid,nodev wait,voldmanaged=usbotg:auto +/dev/block/bootdevice/by-name/modem /vendor/firmware_mnt vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait +/dev/block/bootdevice/by-name/dsp /vendor/dsp ext4 ro,nosuid,nodev,barrier=1 wait +/dev/block/bootdevice/by-name/bluetooth /vendor/bt_firmware vfat ro,shortname=lower,uid=1002,gid=3002,dmask=227,fmask=337,context=u:object_r:bt_firmware_file:s0 wait \ No newline at end of file diff --git a/rootdir/etc/fstab.emmc b/rootdir/etc/fstab.emmc new file mode 100644 index 0000000..b07874e --- /dev/null +++ b/rootdir/etc/fstab.emmc @@ -0,0 +1,48 @@ +# Copyright (c) 2018, 2020, The Linux Foundation. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# 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 + +# +system /system ext4 ro,barrier=1,discard wait,avb,logical,first_stage_mount,avb_keys=/avb/q-gsi.avbpubkey:/avb/r-gsi.avbpubkey:/avb/s-gsi.avbpubkey +system_ext /system_ext ext4 ro,barrier=1,discard wait,avb,logical,first_stage_mount +product /product ext4 ro,barrier=1,discard wait,avb,logical,first_stage_mount +vendor /vendor ext4 ro,barrier=1,discard wait,avb=vbmeta,logical,first_stage_mount +odm /odm ext4 ro,barrier=1,discard wait,avb,logical,first_stage_mount +/dev/block/by-name/metadata /metadata ext4 noatime,nosuid,nodev,discard wait,check,formattable,first_stage_mount +/dev/block/bootdevice/by-name/cache /cache ext4 nosuid,noatime,nodev,barrier=1 wait +/dev/block/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,reserve_root=32768,resgid=1065,fsync_mode=nobarrier,inlinecrypt latemount,wait,check,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+emmc_optimized+wrappedkey_v0,quota,reservedsize=128M,checkpoint=fs +/dev/block/bootdevice/by-name/persist /mnt/vendor/persist ext4 noatime,nosuid,nodev,barrier=1 wait +/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults +/devices/platform/soc/8804000.sdhci/mmc_host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto,encryptable=footer +/devices/platform/soc/1da4000.ufshc_card/host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto,encryptable=footer +/devices/platform/soc/a600000.ssusb/a600000.dwc3/xhci-hcd.*.auto* /storage/usbotg vfat nosuid,nodev wait,voldmanaged=usbotg:auto +/dev/block/bootdevice/by-name/modem /vendor/firmware_mnt vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait +/dev/block/bootdevice/by-name/dsp /vendor/dsp ext4 ro,nosuid,nodev,barrier=1 wait +/dev/block/bootdevice/by-name/bluetooth /vendor/bt_firmware vfat ro,shortname=lower,uid=1002,gid=3002,dmask=227,fmask=337,context=u:object_r:bt_firmware_file:s0 wait \ No newline at end of file diff --git a/rootdir/etc/init.target.rc b/rootdir/etc/init.target.rc index 3b724c8..d1e5e07 100644 --- a/rootdir/etc/init.target.rc +++ b/rootdir/etc/init.target.rc @@ -58,7 +58,7 @@ on early-fs on fs start hwservicemanager - mount_all /vendor/etc/fstab.qcom --early + mount_all --early chown root system /mnt/vendor/persist chmod 0771 /mnt/vendor/persist restorecon_recursive /mnt/vendor/persist @@ -87,7 +87,7 @@ on post-fs on late-fs wait_for_prop hwservicemanager.ready true exec_start wait_for_keymaster - mount_all /vendor/etc/fstab.qcom --late + mount_all --late on post-fs-data mkdir /vendor/data/tombstones 0771 system system diff --git a/rootdir/etc/recovery.fstab b/rootdir/etc/recovery.fstab new file mode 100644 index 0000000..13a64a3 --- /dev/null +++ b/rootdir/etc/recovery.fstab @@ -0,0 +1,49 @@ +# Copyright (c) 2017, The Linux Foundation. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# non-A/B recovery.fstab variant. + +#device mount point fstype [device2] [length=] + +system /system ext4 ro,barrier=1,discard wait,avb,logical,first_stage_mount +system /system erofs ro wait,avb,logical,first_stage_mount +system_ext /system_ext ext4 ro,barrier=1,discard wait,avb,logical,first_stage_mount +system_ext /system_ext erofs ro wait,avb,logical,first_stage_mount +vendor /vendor ext4 ro,barrier=1,discard wait,avb,logical,first_stage_mount +vendor /vendor erofs ro wait,avb,logical,first_stage_mount +odm /odm ext4 ro,barrier=1,discard wait,avb,logical,first_stage_mount +odm /odm erofs ro wait,avb,logical,first_stage_mount +product /product ext4 ro,barrier=1,discard wait,avb,logical,first_stage_mount +product /product erofs ro wait,avb,logical,first_stage_mount +/dev/block/by-name/metadata /metadata ext4 noatime,nosuid,nodev,discard wait,check,formattable,first_stage_mount +/dev/block/bootdevice/by-name/cache /cache ext4 noatime,nosuid,nodev,barrier=1,data=ordered wait,check +/dev/block/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,reserve_root=32768,resgid=1065,fsync_mode=nobarrier latemount,wait,check,formattable,encryptable=footer,quota,reservedsize=128M,checkpoint=fs +/dev/block/mmcblk1p1 /sdcard vfat nosuid,nodev wait +/dev/block/bootdevice/by-name/boot /boot emmc defaults defaults +/dev/block/bootdevice/by-name/recovery /recovery emmc defaults defaults +/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults +/dev/block/bootdevice/by-name/cust /cust ext4 ro,nosuid,nodev,barrier=1 wait,check \ No newline at end of file