JoeyJiao/CustomMTD — comment on commit f68dbc8f1d51a7be10973ceed01911010ca009a6
File:  line 0
By Firerat:

:D

1. /dev/mtdpartmap is created by the readdmesg () {} in the script, it doesn't actually matter where it lives as long as it can be written to tbh, I will probably move it to /tmp/

2. yes, the new awk works better, I have revised it slightly

$dmesg | awk '/0x.*-0x.*:.*"$/ \
{ for(i=1; i <= NF; i++)
if ( $i ~ /^0x/ )
{ $i = toupper($i)
gsub(/0X0+0/,"0x",$i)
sub(/-/," ",$i)
gsub(/\"/,"",$NF)
printf "%s %s",$NF,$i"\n"
}
}' > $dmesgmtdpart

it will look for lines that match the pattern 0x-0x:"
which is basically what mtdparts prints
because the for loop checks each field it doesn't matter if the hexs start at $3 , 5 or even 10 :)

3. yeap, the BindCache script is 'old', as I mentioned I have dropped it from cMTD
however, a more generic fix for the script would be to get the device block before unmounting cache
e.g

cachemtd=$( awk '/\/cache / {print $1}' /proc/mounts )
busybox umount /cache

and then use $cachemtd instead of /dev/block/mtdblock(n)

a little more 'fool proof'

cachemtd=$( awk '/"cache"/ { sub(/mtd/,"/dev/block/mtdblock"); print $1 }' /proc/mtd )

since you are using the mtd map and not assuming the real cache partition is currently mounted

4. yes, you have a 20mb partition called cust, I have no idea what it is used for
as it stands it will be included in the final cmdline and will not be changed
if you want to shift some of cust's space into userdata you will need to work out where cust starts
e.g. to shrink cust to 5mb ( 5242880 bytes 0x500000 in hex )
0x20000000( where cust ends ) - 0x500000 = 0x1FB00000 which is the new userdata end and cust start

if you are going to look at that then you will probably be better off looking at the unstable branch, which I will get round to merging into stable soon, I promise :)
for one it will print the cmdline in the order that the partitions are found in dmsg

the cmdline bit in the kernel source is drivers/mtd/cmdlinepart.c