Skip to content

Commit

Permalink
Tweak system image size, prepare for installer, ubports mounter for r…
Browse files Browse the repository at this point in the history
…ecovery
  • Loading branch information
Flohack74 committed May 21, 2021
1 parent 6c4ae92 commit 94f1c35
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 3 deletions.
6 changes: 4 additions & 2 deletions BoardConfig.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion device.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions init.hardware.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions init.recovery.hardware.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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

4 changes: 4 additions & 0 deletions sepolicy/vendor/file_contexts
Original file line number Diff line number Diff line change
Expand Up @@ -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

3 changes: 3 additions & 0 deletions sepolicy/vendor/vendor_init.te
Original file line number Diff line number Diff line change
Expand Up @@ -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;
20 changes: 20 additions & 0 deletions ubuntu/recovery/ubports-mounter.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 94f1c35

Please sign in to comment.