[Android Q&A, Help & Troubleshooting] OpenGG:
Hey guys, I have been trying to port cwm5 to my low-end samsung phone.

After a few days of effort, I managed to compile a half-working cwm:

Can be flashed by odin1.85

Boots successfully

All keys work, including volume up/down and power

Adb works, I can now mount /system and root my device

Something wrong with display, screen blurred and messed when boot into cwm

Partitions not correctly auto-mounted,

adb shell mount -a

said:

mount: mounting /dev/block/mmcblk0p8 on /boot failed: Invalid argument

After boot into cwm, I try a few methods including "adb reboot", and power down and up, but can't get it back to Android

Flashing stock recovery via odin1.85, and everything went back to normal

I tried to debug the three problem.

1. Screen blurred

Absolutely no idea

2. Partitions not correctly auto-mounted

In cwm, I tried these commands

adb shell cat /etc/fstab

/dev/block/mmcblk0p8 /boot auto rw
/dev/block/mmcblk0p17 /cache auto rw
/dev/block/mmcblk0p18 /data auto rw
/dev/block/mmcblk0p16 /system auto rw
/dev/block/mmcblk0p25 /sdcard auto rw

adb shell mount
rootfs on / type rootfs (rw)
tmpfs on /dev type tmpfs (rw,relatime,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)

adb shell mount -a
mount: mounting /dev/block/mmcblk0p8 on /boot failed: Invalid argument

Seems like

/etc/fstab

is not correct

adb shell cat /etc/recovery.fstab
[device]
# mount point fstype device format option mount op
tion device2

/boot emmc /dev/block/mmcblk0p8 default
default
/cache ext4 /dev/block/mmcblk0p17 default
default
/data ext4 /dev/block/mmcblk0p18 default
default
/misc emmc /dev/block/mmcblk0p21 default
default
/preload ext4 /dev/block/mmcblk0p22 default
default
/sdcard vfat /dev/block/mmcblk0p25 default
default /dev/block/mmcblk0
/system ext4 /dev/block/mmcblk0p16 default
default
/efs ext4 /dev/block/mmcblk0p19 default
default
/recovery emmc /dev/block/mmcblk0p12 default
default
/sys_boot vfat /dev/block/mmcblk0p3 default
default

[format]
#index option
rfs16 "/sbin/fat.format -F 16 -s 1 -S 4096"
rfs32 "/sbin/fat.format -F 32 -s 4 -S 4096"

[mount]
#index flags options
rfs_opt1 nosuid,noatime,nodev,nodiratime "check=no"
rfs_opt2 nosuid,nodev "check=no"

adb shell cp /etc/recovery.fstab /etc/fstab
adb shell mount

rootfs on / type rootfs (rw)
tmpfs on /dev type tmpfs (rw,relatime,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
/dev/block/mmcblk0p17 on /cache type ext4 (rw,relatime,barrier=1,data=ordered)
/dev/block/mmcblk0p18 on /data type ext4 (rw,relatime,barrier=1,data=ordered)
/dev/block/mmcblk0p16 on /system type ext4 (rw,relatime,barrier=1,data=ordered)
/dev/block/mmcblk0p25 on /sdcard type vfat (rw,relatime,fmask=0000,dmask=0000,al
low_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount -ro)

Looks like

/etc/recovery.fstab

is correct, but I have no idea how

/etc/fstab

is generated and why it is wrong.

3. Can't reboot to android system

I guess it has something to do with MSC partition not mounted, but not sure.