diff --git a/BoardConfig.mk b/BoardConfig.mk index bcbb042e1..0450b4813 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -35,7 +35,7 @@ BOARD_KERNEL_CMDLINE += swiotlb=2048 BOARD_KERNEL_CMDLINE += firmware_class.path=/vendor/firmware BOARD_KERNEL_CMDLINE += loop.max_part=7 BOARD_KERNEL_CMDLINE += raid=noautodetect -BOARD_KERNEL_CMDLINE += usbcore.autosuspend=7 console=tty0 +BOARD_KERNEL_CMDLINE += usbcore.autosuspend=7 console=tty0 datapart=/dev/sda13 BOARD_KERNEL_BASE := 0x00000000 BOARD_KERNEL_PAGESIZE := 4096 @@ -62,7 +62,9 @@ TARGET_RECOVERY_FSTAB := device/google/wahoo/fstab.hardware BOARD_AVB_ENABLE := true BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flag 2 -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2684354560 +BOARD_BUILD_DISABLED_VBMETAIMAGE := true + +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 409600000 BOARD_SYSTEMIMAGE_JOURNAL_SIZE := 0 BOARD_SYSTEMIMAGE_EXTFS_INODE_COUNT := 4096 TARGET_USERIMAGES_USE_EXT4 := true diff --git a/device.mk b/device.mk index f68002e33..f87e0969a 100755 --- a/device.mk +++ b/device.mk @@ -677,7 +677,8 @@ PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/ubuntu/display.conf:system/halium/etc/ubuntu-touch-session.d/android.conf \ $(LOCAL_PATH)/ubuntu/config-default.xml:system/halium/usr/share/powerd/device_configs/config-default.xml \ $(LOCAL_PATH)/ubuntu/system/on-post-fs-data.rc:system/etc/init/on-post-fs-data.rc \ - $(LOCAL_PATH)/ubuntu/system/on-post-fs-data.sh:system/bin/on-post-fs-data.sh + $(LOCAL_PATH)/ubuntu/system/on-post-fs-data.sh:system/bin/on-post-fs-data.sh \ + $(LOCAL_PATH)/ubuntu/recovery/ubports-mounter.sh:root/ubports-mounter.sh # Ubuntu Touch additional packages diff --git a/init.hardware.rc b/init.hardware.rc index 5e8da7fd6..6f06e4846 100644 --- a/init.hardware.rc +++ b/init.hardware.rc @@ -499,6 +499,9 @@ on boot # ftm4 VR mode chown system system /sys/devices/virtual/input/ftm4_touch/vrmode + # Ubuntu Touch: relax access perms to vibrator + chmod 0666 /sys/class/timed_output/vibrator/enable + service vendor.init-elabel-sh /system/bin/init.elabel.sh class late_start user system @@ -769,6 +772,7 @@ service vendor.qti /vendor/bin/qti class main user radio group radio net_raw diag usb net_admin + disabled on property:wc_transport.start_hci=true start vendor.hci_filter diff --git a/init.recovery.hardware.rc b/init.recovery.hardware.rc index b40464eea..361f83d6a 100644 --- a/init.recovery.hardware.rc +++ b/init.recovery.hardware.rc @@ -22,3 +22,12 @@ on property:sys.usb.ffs.ready=1 write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "adb" symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1 write /config/usb_gadget/g1/UDC "a800000.dwc3" + +on post-fs-data + start ubports-mounter + wait_for_prop halium.datamount.done 1 + +service ubports-mounter /sbin/sh /ubports-mounter.sh + disabled + oneshot + diff --git a/sepolicy/vendor/file_contexts b/sepolicy/vendor/file_contexts index 1649712ae..1cf9f501c 100644 --- a/sepolicy/vendor/file_contexts +++ b/sepolicy/vendor/file_contexts @@ -287,3 +287,7 @@ # b/70518189 vDSO experiments /sys/module/vdso/parameters u:object_r:sysfs_vdso:s0 + +# Ubuntu Touch +/ubports-mounter\.sh u:object_r:ubports-mounter_file:s0 + diff --git a/sepolicy/vendor/vendor_init.te b/sepolicy/vendor/vendor_init.te index ef333dbfc..ea7e7f477 100644 --- a/sepolicy/vendor/vendor_init.te +++ b/sepolicy/vendor/vendor_init.te @@ -30,3 +30,6 @@ set_prop(vendor_init, vendor_charge_prop) dontaudit vendor_init unlabeled:dir getattr; dontaudit vendor_init unlabeled:file getattr; + +# Ubuntu Touch +type ubports-mounter_file, file_type; diff --git a/ubuntu/recovery/ubports-mounter.sh b/ubuntu/recovery/ubports-mounter.sh new file mode 100644 index 000000000..07316cdd9 --- /dev/null +++ b/ubuntu/recovery/ubports-mounter.sh @@ -0,0 +1,20 @@ +#!/sbin/sh + +DATA_MOUNT_CODE=1 + +while [ "$DATA_MOUNT_CODE" != "0" ]; do + mount -t ext4 /dev/block/bootdevice/by-name/userdata /data > /dev/kmsg + DATA_MOUNT_CODE=$? + sleep 1 +done + +mkdir /cache > /dev/kmsg +mkdir /data/android-data > /dev/kmsg +mkdir /data/android-data/cache > /dev/kmsg +mkdir /data/android-data/cache/recovery > /dev/kmsg +mount -o bind /data/android-data/cache /cache > /dev/kmsgs + +setprop halium.datamount.done 1 + +exit 0 +