[Hardware Hacking General] wladimir_tm:
recovery script for collecting the partitions info (mmcblk0info.sh/zip)

designed shell script (mmcblk0info.sh) for collecting the partitions infos

(that is "beginner version"$ but it does work ;) ))

prefer - use it from recovery - as using dir /tmp as $WorkingDir ;)

thats why script was "packed into zip file" (mmcblk0part_info.zip) with appropriate update-binary and updater-script

thanks to [MENTION=4864296]darkspr1te[/MENTION] for collected tools (used in):

mmcblk0info.sh:

#!/sbin/sh
###COPYRIGHT
################################
#mmcblk0info.sh script for run from recovery
#for mmcblk0 partitions info toolkit
###
#version: 20150907
###
#update:
#replace for universal version: ls -l /dev/block/platform/*/by-name/
###
#Copyright (C) 2015 wladimir_tm4xda
###
#This program is free software: you can redistribute it and/or modify it
#under the terms of the GNU General Public License
#as published by #the Free Software Foundation,
#either version 3 of the License, or any later version.
###
#This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
#without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#See the GNU General Public License for more details.
###
#You should have received a copy of the GNU General Public License
#along with this program. If not, see http://www.gnu.org/licenses/
###
#Contact:
## mailto: wladimir.tm4xda@gmail.com
###
###############################
#This Toolkit is inspired by E:V:A's Thread "El Grande Partition Table Reference":
#http://xdaforums.com/showthread.php?t=1959445
###
#Please post the result of this script there in appropriate format
#Thanks
###
################################
###
################################
###setting variables
TIMESTAMP=$(date +%Y%m%d%H%M%S)
ROPRODUCTNAME=$(grep ro.product.name /default.prop | cut -f 2 -d "=")
LOGDEST="/sdcard"
################################
##############################
###check if /sdcard is mouted
if [ ! -d /sdcard ] ; then
echo "/sdcard is not mounted"
echo "trying to mount external SD-card (/dev/block/mmcblk1p1) as /sdcard"
mount /dev/block/mmcblk1p1 /sdcard
if [ ! -d /sdcard ] ; then
echo "/sdcard is not mounted after mount /dev/block/mmcblk1p1 /sdcard"
echo "trying to mount -a"
mount -a
if [ ! -d /sdcard ] ; then
echo "/sdcard can not be mounted!"
echo "using /cache as LOGDEST"
LOGDEST="/cache"
fi
fi
fi
################################
###setting log file
LOGF="$LOGDEST/mmcblk0info.txt"
################################
###check if log file is present
if [ -f $LOGF ] ; then
LOGF="$LOGDEST/mmcblk0info-$TIMESTAMP.txt"
fi
echo "ro.product.name: $ROPRODUCTNAME"
echo "logging file: $LOGF"
##############################
###start_logging
echo "--------------">"$LOGF"
echo "--------------">>"$LOGF" 2>&1
echo "mmcblk0 partitions info toolkit">>"$LOGF" 2>&1
echo "by wladimir_tm4xda">>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "date:">>"$LOGF" 2>&1
date >>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "logging file:">>"$LOGF" 2>&1
echo "$LOGF">>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "system info:">>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "cat /default.prop:">>"$LOGF" 2>&1
cat /default.prop>>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "df:">>"$LOGF" 2>&1
df >>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "mount:">>"$LOGF" 2>&1
mount >>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "partitions info:">>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "cat /proc/partition:">>"$LOGF" 2>&1
cat /proc/partitions>>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "cat /proc/mtd:">>"$LOGF" 2>&1
cat /proc/mtd>>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "cat /proc/emmc:">>"$LOGF" 2>&1
cat /proc/emmc>>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "using additional tools:">>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "partx -s /dev/block/mmcblk0:">>"$LOGF" 2>&1
/tmp/static/partx -s /dev/block/mmcblk0>>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "gdisk -l /dev/block/mmcblk0:">>"$LOGF" 2>&1
/tmp/static/gdisk -l /dev/block/mmcblk0>>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "parted /dev/block/mmcblk0 print all:">>"$LOGF" 2>&1
/tmp/static/parted /dev/block/mmcblk0 print all>>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "fdisk -l /dev/block/mmcblk0:">>"$LOGF" 2>&1
/tmp/static/fdisk -l /dev/block/mmcblk0>>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "blkid:">>"$LOGF" 2>&1
/tmp/static/blkid>>"$LOGF" 2>&1
###HEX dump of header of mmcblk0
echo "--------------">>"$LOGF" 2>&1
echo "HEX dump of header of mmcblk0:">>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "if=/dev/block/mmcblk0 count=34 | hexdump -C:">>"$LOGF" 2>&1
dd if=/dev/block/mmcblk0 count=34 | /tmp/static/hexdump -C>>"$LOGF" 2>&1
###additional system info
echo "--------------">>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "additional system info:">>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "cat /proc/uptime:">>"$LOGF" 2>&1
cat /proc/uptime>>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "cat /proc/version:">>"$LOGF" 2>&1
cat /proc/version>>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "cat /proc/cmdline:">>"$LOGF" 2>&1
cat /proc/cmdline>>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "cat /proc/cpuinfo:">>"$LOGF" 2>&1
cat /proc/cpuinfo>>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "cat /proc/meminfo:">>"$LOGF" 2>&1
cat /proc/meminfo>>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "ls -l:">>"$LOGF" 2>&1
ls -l >>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "ls -l /dev/block/:">>"$LOGF" 2>&1
ls -l /dev/block/ >>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "ls -l /dev/block/platform/*/by-name/:">>"$LOGF" 2>&1
ls -l /dev/block/platform/*/by-name/>>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "cat /etc/recovery.fstab:">>"$LOGF" 2>&1
cat /etc/recovery.fstab>>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
cat /etc/fstab>>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "cat /tmp/recovery.log:">>"$LOGF" 2>&1
cat /tmp/recovery.log>>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "cat /cache/recovery/last_log:">>"$LOGF" 2>&1
cat /cache/recovery/last_log>>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
###finish_logging
echo finish>>"$LOGF" 2>&1
date +"%Y%m%d%H%M%S" >>"$LOGF" 2>&1
echo "Thank you for using mmcblk0 partitions info toolkit">>"$LOGF" 2>&1
echo "by wladimir_tm 4xda">>"$LOGF" 2>&1
cp "$LOGF" /cache
exit

updater-script:

ui_print("=======================================");
ui_print("mmcblk0 partitions info toolkit");
ui_print("=======================================");
ui_print("Starting the process");
ui_print("Setting up required tools...");
ui_print("Copying files...");
package_extract_dir("static", "/tmp/static");
package_extract_file("script/mmcblk0info.sh", "/tmp/mmcblk0info.sh");
ui_print("Setting permissions...");
set_perm_recursive(0, 0, 0755, 0755, "/tmp/static");
set_perm(0, 0, 0777, "/tmp/mmcblk0info.sh");
ui_print(" ");
ui_print("Starting process...");
show_progress(0.500000, 0);
run_program("/tmp/mmcblk0info.sh");
ui_print("Finished!");
ui_print("Cleaning up temp files...");
delete_recursive("/tmp/static");
delete("/tmp/mmcblk0info.sh");
ui_print("Done!");
ui_print("=======================================");
ui_print("Thank You for using mmcblk0 partitions info toolkit!");
ui_print("by wladimir_tm4xda");
ui_print("=======================================");
ui_print("exit");

upd20150907: mmcblk0part_info2.zip

replace for universal version:

echo "ls -l /dev/block/platform/:">>"$LOGF" 2>&1
ls -l /dev/block/platform/>>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "ls -l /dev/block/platform/msm_sdcc.1/:">>"$LOGF" 2>&1
ls -l /dev/block/platform/msm_sdcc.1/>>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "ls -l /dev/block/platform/msm_sdcc.1/by-name/:">>"$LOGF" 2>&1
ls -l /dev/block/platform/msm_sdcc.1/by-name/>>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1
echo "ls -l /dev/block/platform/mtk-sd.0/:">>"$LOGF" 2>&1
ls -l /dev/block/platform/mtk-sd.0/>>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1

with:

echo "ls -l /dev/block/platform/*/by-name/:">>"$LOGF" 2>&1
ls -l /dev/block/platform/*/by-name/>>"$LOGF" 2>&1
echo "--------------">>"$LOGF" 2>&1