Edify and making update.zip files

unasoto

Member
Dec 19, 2011
37
5
I've been studying/Googleing/researching how to make an update.zip file as my mid1045 is stuck in boot screen and the only thing I can do is boot to stock recovery. so I thought I'd share what I've learned and let everyone pick it apart before I totally bork my bits :) but hey its been a fun ride. I have literally taken apart hundreds of .zips apart over the last 2 or 3 weeks :) I have 29 zips right now that I've taken apart several time each :( I emptied my recycle bin and had 71,000 files and 5.6GB in it. I've tried them all and none of them worked I've Googled till my eyes feel like they're going to bleed :) "https://www.google.com/search?q=edify+script+commands&biw=1920&bih=979&sa=X&ei=7Sm9Udy5GaGSyQGp-oGgDg&ved=0CBwQpwUoBg&source=lnt&tbs=cdr%3A1%2Ccd_min%3A6%2F15%2F2013%2Ccd_max%3A11%2F1%2F2012&tbm=" this [Tutorial] Edify Scripts,Making Flashable Zips - xda-developers and this are both good places to start.
OK all flashable zips have a directory structure \META-INF\com\google\android with update-binary and updater-script in them the updater-binary is what gets executed when you boot into recovery and it loades the updater-script. In the META-INF folder there is a directory com and 3 files cert.rsa, cert.sf and manifest.mf these are what the bootloader looks at for verification. Sometimes I've seen a google and android directory in the \META-INF\com in the android directory is a file named ota "Over The Air" correct me if I'm wrong but I believe its a sha1 cert from the vendor.

I'm not questioning your code Vampirefo, I trying to learn what I can and cant do with this :) http://www.androidtablets.net/forum...recovery-coby-allwinner-via-command-line.html I was wondering, this line does? reboots into recovery but why the busybox dd and what is nandf I know its /misc. I know what busybox and dd are but why are you makeing a copy of them there? I dont see nandf ever used again?


echo -n boot-recovery | busybox dd of=/dev/block/nandf count=1 conv=sync; sync; reboot


I cant use adb otherwise I wouldn have this problem, but I can copy the img files directly to my sdcard from my computer, so no need to adb push to sdcard
in push terminal
adb push bootloader.img /sdcard/bootloader.img
adb push boot.img /sdcard/boot.img
adb push system.tgz /sdcard/system.tgz
Now we get to the part that I might be able to use
in execute terminal
adb shell
cat /sdcard/bootloader.img > /dev/block/nanda
cat /sdcard/boot.img > /dev/block/nandc
Now if you need to restore system
adb shell
mount -t ext4 /dev/block/nandd /system
mount -t ext4 /dev/block/nande /data
rm -r /system/*
rm -r /data/*
busybox tar -xzvf /sdcard/system.tgz
once done reboot
Is cat part of busybox,or edify scripting language or is it from adb? can I use adb commands in my script? should I do a format before I cat my nand partitions? should they be unmounted? what is the order of operations for something like that unmount/format/mount and should I use busybox dd, or cat are those any better than package_extract_dir("system", "/system"). I think dd would be best as it does a bit for bit copy. the next part I understand your removing the /system and /data recursively I understand wipeing the system partition but why the data partition? and how does it get restored? and why rm -r and not format, or delete_recursive("directory-path-1", "directory-path-2") so if I make a update.zip with my recovery files in it and an updater-script that looks something like this
format("ext4", "EMMC", "/dev/block/nanda");
format("ext4", "EMMC", "/dev/block/nandc");
format("ext4", "EMMC", "/dev/block/nandd");
mount -t ext4 /dev/block/nanda /bootloader;
mount -t ext4 /dev/block/nandc /boot;
mount -t ext4 /dev/block/nandd /system;
cat /sdcard/bootloader.img > /dev/block/nanda; or
busybox dd if=/sdcard/bootloader.img of=/dev/block/nanda; or
package_extract_dir("bootloader.img", "/dev/block/nanda");
cat /sdcard/boot.img > /dev/block/nandc;
mount -t ext4 /dev/block/nandd /system;
rm -r /system/
busybox tar -xzvf /sdcard/system.tgz;
and reboot

would that work? and I hope you learned as much as I have and if you've got comments or code/commands to share post them here :):)
 
Last edited:

vampirefo.

Senior Member
Developer
Nov 8, 2011
3,836
1,394
Nothing you do will work until, you make a new cache partition and mount it. Your cache is damaged so nothing is going to install ever on your tablet until you fix it. Also in another post you stated you were using Linux so why not use adb from Linux instead of trying adb from windows which doesn't work for you cause of driver issues.
 
Last edited:

unasoto

Member
Dec 19, 2011
37
5
OK I went back and tried adb on Ubuntu and it didnt work. :( had to try. when I plug my phone in and use adb it works fine. its mot my computer or adb. usb debugging is turned off on the tablet. your right nothing I do will work untill I fix my cache, and to do that I need a cache.img to flash. all of this is not with the spirit of why I made this thread, this thread is for learning about making zip backups and edify scripts. I was asking about why your scripts were done the way you made them not intending to be rude or insulting. what I want to know is would the other things I mentioned work. what I'm trying to learn here is what can and cant be done like this is from your CW temp recovery that you made its the first 4 lines. When you delete sbin\recovery that is from the tablet but what partition is sbin on? I've seen others do similar things like package extract to partition/ folders that they just made up. Is this on the root of the tablet and all of the nand partitions are really just directories? is there a way to delete these partition like with fdisk or gparted?

I realize that untill I fix my cache that I cant do anything permanent with my tablet but your temp recovery gave me an idea what if I make a update.zip that I can use like a linux live distro CD ;)

ui_print("Replacing stock recovery with ClockworkMod recovery...");
delete("sbin/recovery");
package_extract_file("sbin/recovery", "/sbin/recovery");
set_perm(0, 0, 0755, "/sbin/recovery");
 
Top