[Android Software Development] StNickZA:
Hi everyone,

Firstly, my apologies for the lengthy poist. It seems as though there are a lot of helpful people here, so hopefully I can find some answers. I'm feeling totally out of my depth, and am rather stumped. :(

I am trying to port CM11 to my device, the Samsung SM-P605 (Galaxy Note 10.1 2014 Edition). I was unable to get a bootable recovery at all with the standard CM11 source, so I've now started trying with TWRP (which I prefer anyway). Furthermore, there is already a working official TWRP build for my device (which I'm currently using), so I know that this is possible.

There are a number of questions that I think I need to get answered before I can actually make head or tail of any of this.

Question 1:

From what I have read in the OP here, I need a "version 1" recovery.fstab. Unfortunately, I do not have this. The only fstab file I can find comes from the STOCK Samsung kernel, and it is a "version 2" file called fstab.qcom. The contents are below:

# 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/msm_sdcc.1/by-name/system /system ext4 ro,errors=panic wait
/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 nosuid,nodev,noatime,noauto_da_alloc,discard,journal_async_commit,errors=panic wait,check,encryptable=footer

# VOLD
/devices/msm_sdcc.3/mmc_host/mmc2	/storage/extSdCard	vfat	default	voldmanaged=sdcard:auto
/devices/platform/xhci-hcd/usb2,/devices/platform/xhci-hcd/usb1	/storage/UsbDriveA	vfat	default	voldmanaged=sda:auto
/devices/platform/xhci-hcd/usb2,/devices/platform/xhci-hcd/usb1	/storage/UsbDriveB	vfat	default	voldmanaged=sdb:auto
/devices/platform/xhci-hcd/usb2,/devices/platform/xhci-hcd/usb1	/storage/UsbDriveC	vfat	default	voldmanaged=sdc:auto
/devices/platform/xhci-hcd/usb2,/devices/platform/xhci-hcd/usb1	/storage/UsbDriveD	vfat	default	voldmanaged=sdd:auto
/devices/platform/xhci-hcd/usb2,/devices/platform/xhci-hcd/usb1	/storage/UsbDriveE	vfat	default	voldmanaged=sde:auto
/devices/platform/xhci-hcd/usb2,/devices/platform/xhci-hcd/usb1	/storage/UsbDriveF	vfat	default	voldmanaged=sdf:auto

Looking at the source for similar devices to mine, guys were simply pointing to this file with the TARGET_RECOVERY_FSTAB setting in BoardConfig.mk. I'm guessing I cannot do this for TWRP, correct? Do I need to convert that to a "version 1" file and rename it to recovery.fstab?

Question 2:

I have been creating a recovery.img using:

make -j# recoveryimage

I have then been flashing them using the following via adb:

dd if=/sdcard/recovery.img of=dev/block/platform/msm_sdcc.1/by-name/recovery

However, the OP of this thread states that if I have a "typical" Samsung device, I should be using:

make -j# bootimage

This creates a boot.img file, but I do not know how to flash these on my device. What is the correct procedure here?

Basically, absolutely EVERYTHING I try results in the phone attempting to boot into recovery, but winding up in ODIN mode with some text at the top left saying that it was unable to boot normally. I must be missing something very obvious.

My BoardConfig.mk currently looks like this:

USE_CAMERA_STUB := true

# inherit from the proprietary version
-include vendor/samsung/lt03lte/BoardConfigVendor.mk

TARGET_ARCH := arm
TARGET_NO_BOOTLOADER := true
TARGET_BOARD_PLATFORM := unknown
TARGET_CPU_ABI := armeabi-v7a
TARGET_CPU_ABI2 := armeabi
TARGET_ARCH_VARIANT := armv7-a-neon
TARGET_CPU_VARIANT := cortex-a7
ARCH_ARM_HAVE_TLS_REGISTER := true

TARGET_BOOTLOADER_BOARD_NAME := lt03lte

BOARD_KERNEL_CMDLINE := console=null androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3F
BOARD_KERNEL_BASE := 0x00000000
BOARD_KERNEL_PAGESIZE := 2048
BOARD_MKBOOTIMG_ARGS := --ramdisk_offset 0x02000000

# fix this up by examining /proc/mtd on a running device
BOARD_BOOTIMAGE_PARTITION_SIZE := 11534336
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 13631488
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2506096640
BOARD_USERDATAIMAGE_PARTITION_SIZE := 12828261888
BOARD_FLASH_BLOCK_SIZE := 131072

# TWRP
DEVICE_RESOLUTION := 2560x1600

TARGET_RECOVERY_FSTAB := device/samsung/lt03lte/rootdir/etc/fstab.qcom

TARGET_PREBUILT_KERNEL := device/samsung/lt03lte/kernel

Any advice that you can give me would be greatly appreciated, thank you.