[Android General] Oliberserk:
Help with RK3288 port

Hi and thanks for the extensive guide!

I'm trying to port TWRP to a digital signage display using a RK3288 chip (basically a huge 43 inch tablet)

I managed to find a version of TWRP for RockChip devices that I was able to flash using the official TWRP app. After rebooting to recovery however, TWRP wasn't able to find the partitions properly.

When trying to run a backup (the main scope is to be able to backup/restore), I got the following messages:

Full SELinux support is present.
Unable to mount /data/media/TWRP/.twrps
MTP Enabled
Updating partitions details...
Failed to mount '/cache' (Invalid argument)
Failed to mount '/system' (Invalid argument)
Failed to mount '/data' (Invalid argument)
Failed to mount '/metadata' (Invalid argument)
...done
Unable to mount storage
Failed to mount '/data' (Invalid argument)

and so on.

I'm assuming that it's because of the recovery.fstab/twrp.fstab that are not configured properly, but I seem not to be able to match the syntax of the original files with the new ones.

My original recovery.fstab looks like this:

# Android fstab file.
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
/dev/block/rknand_user /mnt/internal_sd vfat defaults defaults
/dev/block/mmcblk0p1 /mnt/external_sd vfat /dev/block/mmcblk0 defaults
/dev/block/rknand_system /system ext4 defaults defaults
/dev/block/rknand_cache /cache ext4 defaults defaults
/dev/block/rknand_metadata /metadata ext4 defaults defaults
/dev/block/rknand_userdata /data ext4 defaults defaults
/dev/block/rknand_cust /cust ext4 defaults defaults
/dev/block/rknand_custom /custom ext4 defaults defaults
/dev/block/rknand_radical_update /radical_update ext4 defaults defaults
misc /misc mtd defaults defaults
uboot /uboot mtd defaults defaults
charge /charge mtd defaults defaults
resource	/resource	mtd	defaults	defaults
parameter /parameter mtd defaults defaults
boot /boot mtd defaults defaults
recovery /recovery mtd defaults defaults
backup /backup mtd defaults defaults

And the twrp.fstab (for now) looks like this:

# mount point fstype device [flags]

/cache ext4 /dev/block/platform/ff520000.rksdmmc/by-name/cache flags=backup=1;display=Cache
/system ext4 /dev/block/platform/ff520000.rksdmmc/by-name/system flags=backup=1;display=System
/data ext4 /dev/block/platform/ff520000.rksdmmc/by-name/userdata flags=backup=1
/metadata ext4 /dev/block/platform/ff520000.rksdmmc/by-name/metadata flags=backup=1;display=Metadata

/uboot emmc /dev/block/platform/ff520000.rksdmmc/by-name/uboot flags=backup=1;display=Uboot;flashimg
/trust emmc /dev/block/platform/ff520000.rksdmmc/by-name/trust flags=backup=1;display=Trust;flashimg
/misc emmc /dev/block/platform/ff520000.rksdmmc/by-name/misc
/resource emmc /dev/block/platform/ff520000.rksdmmc/by-name/resource flags=backup=1;display=Resource;flashimg
/kernel emmc /dev/block/platform/ff520000.rksdmmc/by-name/kernel flags=backup=1;display=Kernel;flashimg
/boot emmc /dev/block/platform/ff520000.rksdmmc/by-name/boot flags=backup=1;display=Boot
/recovery emmc /dev/block/platform/ff520000.rksdmmc/by-name/recovery flags=backup=1;display=Recovery

/external_sd auto /dev/block/mmcblk1p1 flags=wipeingui;storage;removable;display="External SD"
/usb-otg auto /dev/block/sda1 flags=wipeingui;storage;removable;display="USB OTG"

What is confusing is that I also have a recovery.emmc.fstab in my orginal ramdisk/etc folder. It looks like this:

# Android fstab file.
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
/dev/block/platform/ff0f0000.rksdmmc/by-name/user /mnt/internal_sd vfat defaults defaults
/dev/block/mmcblk1p1 /mnt/external_sd vfat /dev/block/mmcblk1 defaults
/dev/block/platform/ff0f0000.rksdmmc/by-name/system /system ext4 defaults defaults
/dev/block/platform/ff0f0000.rksdmmc/by-name/cache /cache ext4 defaults defaults
/dev/block/platform/ff0f0000.rksdmmc/by-name/metadata /metadata ext4 defaults defaults
/dev/block/platform/ff0f0000.rksdmmc/by-name/userdata /data ext4 defaults defaults
/dev/block/platform/ff0f0000.rksdmmc/by-name/cust /cust ext4 defaults defaults
/dev/block/platform/ff0f0000.rksdmmc/by-name/custom /custom ext4 defaults defaults
/dev/block/platform/ff0f0000.rksdmmc/by-name/radical_update /radical_update ext4 defaults defaults
/dev/block/platform/ff0f0000.rksdmmc/by-name/misc /misc emmc defaults defaults
/dev/block/platform/ff0f0000.rksdmmc/by-name/uboot /uboot emmc defaults defaults
/dev/block/platform/ff0f0000.rksdmmc/by-name/charge /charge emmc defaults defaults
/dev/block/platform/ff0f0000.rksdmmc/by-name/resource	/resource	emmc	defaults	defaults
/dev/block/platform/ff0f0000.rksdmmc/by-name/parameter /parameter emmc defaults defaults
/dev/block/platform/ff0f0000.rksdmmc/by-name/boot /boot emmc defaults defaults
/dev/block/platform/ff0f0000.rksdmmc/by-name/recovery /recovery emmc defaults defaults
/dev/block/platform/ff0f0000.rksdmmc/by-name/backup /backup emmc defaults defaults

Since this i s a port for the same board "family" (I see RK30boar mentioned all over the place), I'm I right assuming I only need to adapt the file system tables in order to get it working?

For good measure (and not to be blamed for not giving enough info when requesting help :D), here is the content of the original default.prop:

#
# ADDITIONAL_DEFAULT_PROPERTIES
#
ro.secure=0
ro.allow.mock.location=1
ro.debuggable=1
ro.zygote=zygote32
dalvik.vm.image-dex2oat-Xms=64m
dalvik.vm.image-dex2oat-Xmx=64m
dalvik.vm.dex2oat-Xms=64m
dalvik.vm.dex2oat-Xmx=512m
ro.dalvik.vm.native.bridge=0
debug.atrace.tags.enableflags=0
ro.enable_boot_charger_mode=0
#
# BOOTIMAGE_BUILD_PROPERTIES
#
ro.bootimage.build.date=2018年 08月 27日 星期一 10:16:17 CST
ro.bootimage.build.date.utc=1535336177
ro.bootimage.build.fingerprint=Android/rk3288/rk3288:6.0.1/MXC89K/tian08271013:eng/test-keys
persist.sys.usb.config=adb

# begin build properties
# autogenerated by buildinfo.sh
ro.build.id=MXC89K
ro.build.display.id=rk3288-eng 6.0.1 MXC89K user.tian.20180827.095513 test-keys
ro.build.version.incremental=user.tian.20180827.095513
ro.build.version.sdk=23
ro.build.version.preview_sdk=0
ro.build.version.codename=REL
ro.build.version.all_codenames=REL
ro.build.version.release=6.0.1
ro.build.version.security_patch=2016-07-05
ro.build.version.base_os=
ro.build.date=2018年 08月 27日 星期一 10:15:01 CST
ro.build.date.utc=1535336101
ro.build.type=eng
ro.build.user=tian
ro.build.host=tian-virtual-machine
ro.build.tags=test-keys
ro.build.flavor=rk3288-eng
ro.product.model=ZC-328
ro.product.brand=Android
ro.product.name=rk3288
ro.product.device=rk3288
ro.product.board=rk30sdk
# ro.product.cpu.abi and ro.product.cpu.abi2 are obsolete,
# use ro.product.cpu.abilist instead.
ro.product.cpu.abi=armeabi-v7a
ro.product.cpu.abi2=armeabi
ro.product.cpu.abilist=armeabi-v7a,armeabi
ro.product.cpu.abilist32=armeabi-v7a,armeabi
ro.product.cpu.abilist64=
ro.product.manufacturer=rockchip
ro.product.locale=en-US
ro.wifi.channels=
ro.board.platform=rk3288
# ro.build.product is obsolete; use ro.product.device
ro.build.product=rk3288
# Do not try to parse description, fingerprint, or thumbprint
ro.build.description=rk3288-eng 6.0.1 MXC89K user.tian.20180827.095513 test-keys
ro.build.fingerprint=Android/rk3288/rk3288:6.0.1/MXC89K/tian08271013:eng/test-keys
ro.build.characteristics=tablet
# end build properties
#
# from device/rockchip/rk3288/system.prop
#
#
# system.prop
#

#rild.libpath=/system/lib/libreference-ril.so
#rild.libpath=/system/lib/libreference-ril-ec20.so
rild.libargs=-d /dev/ttyUSB2
# Default ecclist
ro.ril.ecclist=112,911
ro.opengles.version=196609
wifi.interface=wlan0
rild.libpath=/system/lib/libril-rk29-dataonly.so
#rild.libargs=-d /dev/ttyACM0
persist.tegra.nvmmlite = 1
ro.audio.monitorOrientation=true

#NFC
debug.nfc.fw_download=false
debug.nfc.se=false

#add Rockchip properties here
ro.rk.screenoff_time=2147483647
ro.rk.screenshot_enable=true
ro.rk.def_brightness=255
ro.rk.homepage_base=*removed_because_external_link_rule*
ro.rk.install_non_market_apps=false
sys.hwc.compose_policy=6
sys.wallpaper.rgb565=0
sf.power.control=2073600
sys.rkadb.root=0
ro.sf.fakerotation=false
ro.sf.hwrotation=0
ro.rk.MassStorage=false
ro.rk.systembar.voiceicon=true
ro.rk.systembar.tabletUI=false
ro.rk.LowBatteryBrightness=false
ro.tether.denied=false
sys.resolution.changed=false
ro.default.size=100
persist.sys.timezone=Asia/Shanghai
persist.sys.country=CN
persist.sys.language=zh
ro.product.usbfactory=rockchip_usb
wifi.supplicant_scan_interval=15
ro.factory.tool=0
ro.kernel.android.checkjni=0
#set default lcd density to Rockchip tablet
ro.sf.lcd_density=240
ro.adb.secure=0
ro.pinhe.version=ZC-328-20180827
ro.telephony.default_network=10
#ro.rotation.external=true
ro.orientation.einit=0
ro.rk.bt_enable=false
persist.sys.strictmode.visual=0
persist.sys.strictmode.disable=1
persist.sys.touchscreenrotation=0
persist.sys.camerarotation=0
persist.sys.zchideqs=false
qemu.hw.mainkeys=0
ro.sys.zcgsensor=false
persist.sys.zcdpi=240
persist.sys.rotation=0
persist.sys.rotation_hdmi=0
persist.sys.same_orientation=1
persist.sys.rotation_external=true
persist.sys.opensoftap=false
ro.zcupdate.boardtype=ZC-328
ro.zcupdate.bluetoothtype=bt00
ro.zcupdate.externtype=ext00
persist.sys.norebootrotation=false
persist.sys.alwayshidesystembar=0
persist.sys.soundoutputmode=0
persist.sys.silent=0
persist.sys.screen1920x360=0
persist.sys.zcscreenoff=0
#
# ADDITIONAL_BUILD_PROPERTIES
#
ro.target.product=tablet
dalvik.vm.heapstartsize=16m
dalvik.vm.heapgrowthlimit=192m
dalvik.vm.heapsize=512m
dalvik.vm.heaptargetutilization=0.75
dalvik.vm.heapminfree=512k
dalvik.vm.heapmaxfree=8m
ro.config.ringtone=Ring_Synth_04.ogg
ro.config.notification_sound=pixiedust.ogg
ro.carrier=unknown
ro.config.alarm_alert=Alarm_Classic.ogg
ro.rksdk.version=RK30_ANDROID6.0.1-SDK-v1.00.00
net.pppoe.cts=true
camera2.portability.force_api=1
persist.sys.strictmode.visual=false
ro.rk.bt_enable=true
ro.factory.hasUMS=false
persist.sys.usb.config=mtp,adb
testing.mediascanner.skiplist=/mnt/shell/emulated/Android/
ro.factory.hasGPS=false
ro.factory.storage_suppntfs=true
ro.factory.without_battery=true
ro.setupwizard.mode=OPTIONAL
ro.com.google.gmsversion=6.0_r4
keyguard.no_require_sim=true
ro.com.android.dataroaming=true
ril.function.dataonly=1
ro.config.enable.remotecontrol=false
ro.udisk.visible=true
ro.safemode.disabled=true
ro.product.version=1.0.0
ro.product.ota.host=*removed_because_external_link_rule*
persist.sys.dalvik.vm.lib.2=libart
dalvik.vm.isa.arm.variant=cortex-a15
dalvik.vm.isa.arm.features=default
ro.kernel.android.checkjni=1
dalvik.vm.lockprof.threshold=500
dalvik.vm.image-dex2oat-filter=verify-at-runtime
dalvik.vm.dex2oat-filter=verify-at-runtime
dalvik.vm.usejit=true
net.bt.name=Android
dalvik.vm.stack-trace-file=/data/anr/traces.txt

Help or a hint in the right direction would be much appreciated :)

Thanks and cheers

Oli