[GUIDA] Sintassi Updater-script piu' creazione di zip flashabili da recovery
ecco una guida completa sulla sintassi dell'updater-script e sulla creazione di zip flashabili in recovery.
di seguito riporterò la sintassi in 2 versioni: AMEND(vecchio linguaggio usato nelle recovery) e EDIFY(linguaggio utilizzato attualmente nelle recovery)
successivamente vi spieghero' anche come creare zip da flashare in recovery. ;);)
come capire se la vostra recovery usa AMEND o EDIFY??
amend: il nome del file e' UPDATE-SCRIPT
edify: il nome del file e' UPDATER-SCRIPT
ovviamente noi sul DHD utilizziamo script EDIFY ma questa guida puo' essere utile anche per chi ha terminali piu' vecchiotti! ;);)
cominciamo!
visualizzazione messaggio:
codice:
mancante...----------ui_print("messaggio da visualizzare...");
Formattazione:
codice:
format SYSTEM:--------------------------format("MTD", "system");
format DATA:----------------------------format("MTD", "userdata");
format CACHE:---------------------------format("MTD", "cache");
format SDEXT:---------------------------mancante per ora...
Pulizia:
codice:
format("yaffs2", "MTD", "system");
format("yaffs2", "MTD", "userdata");
run_program("/sbin/busybox", "mount", "-t", "auto", "/dev/block/mmcblk0p2", "/sd-ext");
run_program("/sbin/busybox", "rm", "-rf", "/sd-ext/*");
run_program("/sbin/busybox", "rm", "-rf", "/sdcard/.android_secure/*");
run_program("/sbin/busybox", "umount", "/sd-ext");
run_program("/sbin/e2fsck", "-pv", "/dev/block/mmcblk0p2");
copiare file in /system o /data:
codice:
copy_dir PACKAGE:system SYSTEM:---------mount("MTD", "system", "/system");
........................................package_extract_dir("system", "/system");
copy_dir PACKAGE:data DATA:-------------mount("MTD", "userdata", "/data");
........................................package_extract_dir("data", "/data");
copiare file su SD:
codice:
copy_dir PACKAGE:sdcard SDCARD:---------mount("vfat","/dev/block/mmcblk0p1","/sdcard");
copiare su SD-EXT (ext /2/3/4):
codice:
copy_dir PACKAGE:SDEXT SDEXT:-----------run_program("/sbin/busybox", "mount", "-t", "auto", "/dev/block/mmcblk0p2", "/sd-ext");
........................................package_extract_dir("sdext", "/sd-ext");
OPPURE:
copy_dir PACKAGE:SDEXT SDEXT:-----------mount("ext4","/dev/block/mmcblk0p2","/sd-ext");
........................................package_extract_dir("sdext", "/sd-ext");
copy_dir PACKAGE:SDEXT SDEXT:-----------mount("ext3","/dev/block/mmcblk0p2","/sd-ext");
........................................package_extract_dir("sdext", "/sd-ext");
copy_dir PACKAGE:SDEXT SDEXT:-----------mount("ext2","/dev/block/mmcblk0p2","/sd-ext");
........................................package_extract_dir("sdext", "/sd-ext");
eliminare cartella:
codice:
delete_recursive DATA:app----------delete_recursive("/data/app");
eliminare file:
codice:
delete DATA:percorso/file--------------delete("/percorso/file/da-eliminare");
Permessi cartella:
codice:
set_perm_recursive 1000 1000 0771 0644 DATA:app---------set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
Permessi file:
codice:
set_perm 2000 2000 0771 DATA:etc------------------------set_perm(2000, 2000, 0771, "/data/etc");
Symlink file:
codice:
symlink /data/app/apps.apk SYSTEM:app/apps.apk----------symlink("/data/app/apps.apk", "/system/app/apps.apk");
symlink /data/etc/hosts SYSTEM:etc/hosts----------------symlink("/data/etc/hosts", "/system/etc/hosts");
setup toolbox:
codice:
symlink toolbox SYSTEM:bin/date-------------------------symlink("toolbox", "/system/bin/date");
Setup Busybox:
codice:
run_program PACKAGE:installbusybox----------------------run_program("installbusybox");
........................................................set_perm(0, 1000, 0755, "/system/xbin/busybox");
Scrittura Boot:
codice:
format BOOT:-------------------------------------------package_extract_file("boot.img","/tmp/boot.img");
write_raw_image PACKAGE:boot.img BOOT:..................write_raw_image("/tmp/boot.img", "boot");
........................................................delete("/tmp/boot.img");
Flash Radio:
codice:
write_radio_image PACKAGE:radio.img----------------------assert(package_extract_file("radio.img", "/tmp/radio.img"),
........................................................write_firmware_image("/tmp/radio.img", "radio"));
Setup Toolbox EDIFY:
codice:
symlink("toolbox", "/system/bin/cat","/system/bin/chmod",
"/system/bin/chown","/system/bin/chownto",
"/system/bin/cmp","/system/bin/date",
"/system/bin/dd","/system/bin/df",
"/system/bin/dmesg","/system/bin/getevent",
"/system/bin/getprop","/system/bin/hd",
"/system/bin/id","/system/bin/ifconfig",
"/system/bin/iftop","/system/bin/insmod",
"/system/bin/ioctl","/system/bin/ionice",
"/system/bin/kill","/system/bin/ln",
"/system/bin/log","/system/bin/ls",
"/system/bin/lsmod","/system/bin/mkdir",
"/system/bin/mount","/system/bin/mv",
"/system/bin/nandread","/system/bin/netstat",
"/system/bin/newfs_msdos","/system/bin/notify",
"/system/bin/printenv","/system/bin/ps",
"/system/bin/renice","/system/bin/rm",
"/system/bin/rmdir","/system/bin/rmmod",
"/system/bin/route","/system/bin/schedtop",
"/system/bin/sendevent","/system/bin/setconsole",
"/system/bin/setprop","/system/bin/sleep",
"/system/bin/smd","/system/bin/start",
"/system/bin/stop","/system/bin/sync",
"/system/bin/top","/system/bin/umount",
"/system/bin/vmstat","/system/bin/watchprops",
"/system/bin/wipe");
set_perm(0, 0, 04755, "/system/bin/toolbox");
continua nel secondo post!