Hello guys,
i want to write a update-script that makes some changes on the phone,
but before i can extract files, set symlinks, etc. i have to mount some partitions.
The format of the partitions is MTD, but i don´t know how to find out which block is for /system, /hidden, /data, etc. and where is the block?
I searched much in the internet, have read the instructions for edify-scripting and so on,
but i´ve never found it for MTD and never found how to find out which block is which partition.
I hope you can help
Every phone is different, so for you to get useful advice you need to state what you are using.
I've always found it very helpful to look at the updater script for custom ROMs since they have mount instructions for /system.
Sent from my HTC Desire S
BillGoss said:
Every phone is different, so for you to get useful advice you need to state what you are using.
I've always found it very helpful to look at the updater script for custom ROMs since they have mount instructions for /system.
Sent from my HTC Desire S
Click to expand...
Click to collapse
I realy have to thank you for your reply
I´m using a Motorola Motoluxe XT615 and the problem is, theres no custom ROM out there.
A friend has developt a awesome JB-Design for it and we know how to mount system, but anything else doesn´t work.
The command we´ve used:
Code:
run_program("/sbin/busybox", "mount", "/system");
Thats the output when i´m in /dev/block and enter command "ls":
Code:
dm-2
dm-1
dm-0
vold
mtdblock11
mtdblock10
mtdblock9
mtdblock8
mtdblock7
mtdblock6
mtdblock5
mtdblock4
mtdblock3
mtdblock2
mtdblock1
mtdblock0
loop7
loop6
loop5
loop4
loop3
loop2
loop1
loop0
mmcblk0p1
platform
mmcblk0
Maybe this is usefull, too. Output of command "cat /proc/mtd":
Code:
dev: size erasesize name
mtd0: 00700000 00020000 "boot"
mtd1: 00300000 00020000 "misc"
mtd2: 00300000 00020000 "misc2"
mtd3: 00200000 00020000 "splash"
mtd4: 00700000 00020000 "recovery"
mtd5: 00d00000 00020000 "ftm"
mtd6: 00d00000 00020000 "hidden"
mtd7: 01500000 00020000 "cda"
mtd8: 00060000 00020000 "dbgmsk"
mtd9: 16300000 00020000 "system"
mtd10: 0a000000 00020000 "cache"
mtd11: 183e0000 00020000 "userdata"
Well, that will work if a ROM with busybox is already installed.
Here's what's in the updater script for the HTC Desire S ROMs:
assert(getprop("ro.product.device") == "saga" || getprop("ro.build.product") == "saga");
mount("ext4", "EMMC", "/dev/block/mmcblk0p25", "/system");
...
format("ext4", "EMMC", "/dev/block/mmcblk0p25", "0", "/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p25", "/system");
package_extract_dir("system", "/system");
Nope this helps. I think you need to use MTD instead of EMMC. And, obviously mtdblock9 instead of mmcblk0p25.
Sent from my HTC Desire S
BillGoss said:
Well, that will work if a ROM with busybox is already installed.
Here's what's in the updater script for the HTC Desire S ROMs:
assert(getprop("ro.product.device") == "saga" || getprop("ro.build.product") == "saga");
mount("ext4", "EMMC", "/dev/block/mmcblk0p25", "/system");
...
format("ext4", "EMMC", "/dev/block/mmcblk0p25", "0", "/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p25", "/system");
package_extract_dir("system", "/system");
Nope this helps. I think you need to use MTD instead of EMMC. And, obviously mtdblock9 instead of mmcblk0p25.
Sent from my HTC Desire S
Click to expand...
Click to collapse
Finally i got it, thank you
It wasn´t even that hard. The right command is:
Code:
mount("MTD", "userdata", "/data");
mount("MTD", "system", "/system");
mount("MTD", "hidden", "/hidden");
Thanks for your help
Related
now this is not that relevant to vibrant but i had no where else to post thats y its in Q/A section so please if someone knows help me out here
i just got a tablet and it has no support anywhere on the net yet , i got hold of an update from the manufacture, in the update it has this script
my questions are could someone please explain what is
nand_spl.bin used for?
x-boot.bin used for?
boot.img is for boot folder
system.img is system folder
userdata.img is user data folder
i am trying to extract recovery from it so i could flash the recovery to it, in case anything goes back i would re flash the original recovery
ui_print("Setup your device...");
ui_print("update nand_spl....");
format("MTD", "nand_spl");
package_extract_file("nand-spl.bin", "/tmp/nand-spl.bin");
write_raw_image("/tmp/nand-spl.bin","nand_spl");
ui_print("update xboot....");
format("MTD", "xboot");
package_extract_file("x-boot.bin", "/tmp/x-boot.bin");
write_raw_image("/tmp/x-boot.bin","xboot");
ui_print("update boot.img....");
set_progress("2");
show_progress("0.1", 1);
format("MTD", "boot");
package_extract_file("boot.img", "/tmp/boot.img");
write_raw_image("/tmp/boot.img","boot");
show_progress("0.1", 1);
ui_print("update system.img....");
set_progress("9");
show_progress("0.02", 1);
show_progress("0.02", 1);
show_progress("0.02", 1);
format("MTD", "system");
show_progress("0.02", 1);
show_progress("0.02", 1);
show_progress("0.02", 1);
package_extract_file("system.img", "/tmp/system.img");
show_progress("0.02", 1);
show_progress("0.02", 1);
show_progress("0.02", 1);
write_oob_image("/tmp/system.img","system");
show_progress("0.1", 1);
ui_print("update userdata.img....");
show_progress("0.1", 1);
show_progress("0.1", 1);
format("MTD", "userdata");
show_progress("0.1", 1);
show_progress("0.1", 1);
package_extract_file("userdata.img", "/tmp/userdata.img");
show_progress("0.1", 1);
write_oob_image("/tmp/userdata.img","userdata");
show_progress("0.1", 1);
ui_print("Done.");
set_progress("10");
show_progress("0.1", 1);
also when i run cat /proc/mtd
i get this
dev: size erasesize name
mtd0: 000400000 00080000 "misc"
mtd1: 000c00000 00080000 "recovery"
mtd2: 000c00000 00080000 "boot"
mtd3: 010000000 00080000 "system"
mtd4: 01f400000 00080000 "userdata"
mtd5: 008000000 00080000 "cache"
mtd6: 000400000 00080000 "kpanic"
mtd7: 004c00000 00080000 "storage"
mtd8: 001000000 00080000 "deviceID"
mtd9: 000100000 00080000 "nand_spl"
mtd10: 000f00000 00080000 "xboot"
now if i extract
cat /dev/mtd/mtd1 > /sdcard/img/recovery.img
is this recovery.img flashable?
This:
Code:
mount("yaffs2", "MTD", "system", "/system");
package_extract_dir("framework", "/system/framework");
package_extract_dir("apps", "/system/app");
ui_print("Done?");
unmount("/system");
Didn't work
Trying to replace the framework-res.apk
It's fine.
Worked this time.
My old trusty P8000 stopped reading it's sim card and I have to get a new phone, so I thought this would be the perfect time to do a little hacking on it.
I'm a total noob to android, I've managed to root the phone and install CWM.
I've also cooked up a custom rom in android kitchen, but I'm having some problems passing the proper mount command to the update-binary.
My updater script reads:
Code:
format("yaffs2", "MTD", "system");
mount("yaffs2", "MTD", "/dev/block/mtdblock5", "/system");
show_progress(0.500000, 0);
package_extract_dir("system", "/system");
When I run the update.zip in CWM it comes back with installation complete, but the log says unmount of system failed: no such volume.
Does anyone know the proper mount commands for these old MTD flash drives?
Yes I'm sure the "system" partition is /dev/block/mtdblock5
Code:
~ # cat /proc/mtd
dev: size erasesize name
mtd0: 008c0000 00040000 "boot"
mtd1: 008c0000 00040000 "recovery"
mtd2: 00f00000 00040000 "fota"
mtd3: 09880000 00040000 "cache"
mtd4: 002c0000 00040000 "persist"
mtd5: 0e940000 00040000 "system"
mtd6: 00280000 00040000 "splash"
mtd7: 20a00000 00040000 "userdata"
The format command only works if I use:
Code:
format("yaffs2", "MTD", "system");
It doesn't work as:
Code:
format("yaffs2", "MTD", "/system");
Something to do with the MTD partition table being hardcoded into the kernel.
Also, is there any way to view CWM installer logs other than from the advanced menu on the phone. I'm only able to see the last few lines of the log, and it doesn't give me any clue why "/system" doesn't mount.
Thanks for any advice you can offer.
Ok, I fond the answer in this thread http://forum.xda-developers.com/showpost.php?p=17594598&postcount=30
Code:
mount("yaffs2", "MTD", "system", "/system");
:laugh:
Hi guys..
I'm cooking a custom rom, and i'm testing the updater-script files for flashing..
If i flash my updater-script i will get always:
"Updater process ended with segnal: 11
Error installing zip file '/external_sd/test/test.zip'"
This is my test updater-script:
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system");
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/hidden", "/preload");
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/cache", "/cache");
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/userdata", "/data");
package_extract_dir("system", "/system");
unmount("/system");
unmount("/data");
unmount("/preload");
unmount("/cache");
Anyone have an idea on where is my error??
Thanks a lot,
BoGnY
Hi guys..
I'm cooking a custom rom, and i'm testing the updater-script files for flashing..
If i flash my updater-script i will get always:
"Updater process ended with segnal: 11
Error installing zip file '/external_sd/test/test.zip'"
This is my test updater-script:
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system");
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/hidden", "/preload");
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/cache", "/cache");
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/userdata", "/data");
package_extract_dir("system", "/system");
unmount("/system");
unmount("/data");
unmount("/preload");
unmount("/cache");
Anyone have an idea on where is my error??
Thanks a lot,
BoGnY
EDIT: The problem is caused by a wrong/corrupted/unknown problem with update-binary file!!
I attached the working update-binary file for anyone have the same problem in future