OK, in the spirit of helping out my fellow modders, I took some time to sit down and read some of the sourcecode for the updater binary that goes in what we commonly refer to as CWM flash-able zips. I have compiled this list of commands for updater-script, a good bit taken directly from teh comments in the source itself, some from my own interpretation of the code.
I believe this is more complete than anything else I've been able to find from searching.
anyways, enjoy
mount(fs_type, partition_type, location, mount_point)
fs_type="yaffs2" partition_type="MTD" location=partition
fs_type="ext4" partition_type="EMMC" location=device
Returns mountpoint if successful
is_mounted(mount_point)
Returns mount_point if mounted
unmount(mount_point)
Returns mountpoint if successful
format(fs_type, partition_type, location)
fs_type="yaffs2" partition_type="MTD" location=partition
fs_type="ext4" partition_type="EMMC" location=device
Returns location if successful
show_progress(frac, sec)
update progress bar by 'frac' over 'sec' seconds
frac represents a double precision value from 0 = 0% to 1 = 100%
returns 'frac' as a string if successful
set_progress(frac)
set progress bar to 'frac'
returns 'frac' as a string if successful
delete(file1,...,fileN)
delete_recursive(file1,...,fileN)
delete files or folders recursively
returns a count of files or folders deleted
package_extract_dir(package_path, destination_path)
extract package_path from zip to destination_path
returns "t" if successful
package_extract_file(package_path, destination_path)
extract the file at package_path from zip to destination_path
returns "t" if successful
or
package_extract_file(package_path)
to return the entire contents of the file
symlink(target, src1 ...)
unlinks any previously existing src1, src2, etc before creating symlinks.
returns empty string
set_perm(uid,gid,mode,target)
set_perm_recursive(uid,gid,dirmode,filemode,target)
set file(s) user to uid, group to gid, and permissions to mode/filemode for files, and dirmode for directories
returns empty string
getprop(key)
returns value of key or "" if key is not defined
file_getprop(file, key)
interprets 'file' as a getprop-style file (key=value pairs, one
per line, # comment lines and blank lines okay), and returns the value
for 'key' (or "" if it isn't defined).
write_raw_image(file, partition)
writes the contents of file to MTD device: partition.
does not support EMMC devices
returns partition if successful
apply_patch(srcfile, tgtfile, tgtsha1, tgtsize, sha1_1, patch_1, ...)
apply srcfile to tgtfile patch_N .... you know what, this shit is rediculous and meant to save filespace in update.zips, I'm, skipping it and it's sha1 cousins
read_file(file)
return the contents of file
ui_print(msg1...)
concatenate arguments and display on screen
run_program(program)
or
run_program(program, arg1...)
run program with args
returns program exit status
Some items I skipped and why:
apply_patch
apply_patch_check
apply_patch_space
sha1_check
SHA1 stuff breaks my brain. This is all part of patching large files with lists of changes. Pretty useful for OTA updates where file sizes need to be kept small, but not as useful for the custom ROM community. If you absolutely NEED to use these, you either already know how to, or you can go read <android source directory>/bootable/recovery/updater/install.c and its defined includes
What the "Returns..." stuff means:
In theory, you should be able to use one command as an argument for another, leading to more complex, powerful updater-scripts.
I.E:
mount(getprop(systemfstype),getprop(systemparttype),unmount(getprop(systempart)),getprop(systemmountpoint))
I believe this is more complete than anything else I've been able to find from searching.
anyways, enjoy
mount(fs_type, partition_type, location, mount_point)
fs_type="yaffs2" partition_type="MTD" location=partition
fs_type="ext4" partition_type="EMMC" location=device
Returns mountpoint if successful
is_mounted(mount_point)
Returns mount_point if mounted
unmount(mount_point)
Returns mountpoint if successful
format(fs_type, partition_type, location)
fs_type="yaffs2" partition_type="MTD" location=partition
fs_type="ext4" partition_type="EMMC" location=device
Returns location if successful
show_progress(frac, sec)
update progress bar by 'frac' over 'sec' seconds
frac represents a double precision value from 0 = 0% to 1 = 100%
returns 'frac' as a string if successful
set_progress(frac)
set progress bar to 'frac'
returns 'frac' as a string if successful
delete(file1,...,fileN)
delete_recursive(file1,...,fileN)
delete files or folders recursively
returns a count of files or folders deleted
package_extract_dir(package_path, destination_path)
extract package_path from zip to destination_path
returns "t" if successful
package_extract_file(package_path, destination_path)
extract the file at package_path from zip to destination_path
returns "t" if successful
or
package_extract_file(package_path)
to return the entire contents of the file
symlink(target, src1 ...)
unlinks any previously existing src1, src2, etc before creating symlinks.
returns empty string
set_perm(uid,gid,mode,target)
set_perm_recursive(uid,gid,dirmode,filemode,target)
set file(s) user to uid, group to gid, and permissions to mode/filemode for files, and dirmode for directories
returns empty string
getprop(key)
returns value of key or "" if key is not defined
file_getprop(file, key)
interprets 'file' as a getprop-style file (key=value pairs, one
per line, # comment lines and blank lines okay), and returns the value
for 'key' (or "" if it isn't defined).
write_raw_image(file, partition)
writes the contents of file to MTD device: partition.
does not support EMMC devices
returns partition if successful
apply_patch(srcfile, tgtfile, tgtsha1, tgtsize, sha1_1, patch_1, ...)
apply srcfile to tgtfile patch_N .... you know what, this shit is rediculous and meant to save filespace in update.zips, I'm, skipping it and it's sha1 cousins
read_file(file)
return the contents of file
ui_print(msg1...)
concatenate arguments and display on screen
run_program(program)
or
run_program(program, arg1...)
run program with args
returns program exit status
Some items I skipped and why:
apply_patch
apply_patch_check
apply_patch_space
sha1_check
SHA1 stuff breaks my brain. This is all part of patching large files with lists of changes. Pretty useful for OTA updates where file sizes need to be kept small, but not as useful for the custom ROM community. If you absolutely NEED to use these, you either already know how to, or you can go read <android source directory>/bootable/recovery/updater/install.c and its defined includes
What the "Returns..." stuff means:
In theory, you should be able to use one command as an argument for another, leading to more complex, powerful updater-scripts.
I.E:
mount(getprop(systemfstype),getprop(systemparttype),unmount(getprop(systempart)),getprop(systemmountpoint))