update-script commands - Hero, G2 Touch Android Development

Does anyone know where I can find information about the commands that can be used in the update-script file. Some of the commands are simple enough to understand but commands such as set_perm aren't. I also don't understand the numbers that are used in the show_progress command, in one script 0.1 0 is used then 0.5 0 after that 0.2 0 and 0.2 10 are used, i'm confused of which numbers i'm supposed to use can anyone tell me. Thanks Glennlh.

it uses the android init language http://www.kandroid.org/android_pdk/bring_up.html

Thank You, I'll check the link you posted.

I still don't understand which numbers to use, I would be very grateful if someone can explain:
which numbers to use after the show_progress command as in this example the numbers 0.200000 0, 0.200000 10, 0.100000 0 are used in that order.
set_perm_recursive command.
set_perm command.
Also my test script shown below doesn't work will someone have a look through and tell me the problem, thanks.
Code:
show_progress 0.1 0
format BOOT:
format SYSTEM:
show_progress 0.2 0
copy_dir PACKAGE:system SYSTEM:
write_raw_image PACKAGE:boot.img BOOT:
set_perm_recursive 0 0 0755 0644 SYSTEM:app
show_progress 0.2 10

try this, i think the main problem was the missing "progress 0.1 10":
Code:
show_progress 0.1 0
format SYSTEM:
copy_dir PACKAGE:system SYSTEM:
set_perm_recursive 0 0 0755 0644 SYSTEM:app
show_progress 0.1 10
show_progress 0.2 0
format BOOT:
write_raw_image PACKAGE:boot.img BOOT:
show_progress 0.2 10
idk how it works exactly, but it seems like the progress meter has two stages, that need to be started and ended (or at least one of them, iirc i have seen update-scripts with only the 0.1 meter commands).
set_perm sets unix-style permissions, google and wikipedia help you there.
set_perm_recursive does the same for the contents of a directory.
your update-script doesn't that much sense (you are trying to make apk files executable, which they shouldn't be), what exactly are you trying to do?
and please people, "doesn't work" is not an error msg. call an autoshop and say "my car doesn't work, can you tell me why?" what would they say...

Sorry i'll try and explain better, after installing the ROM there are no errors, but it boots straight back to the recovery menu. I believe this must be something to do with the boot.img not writing properly but the code for the boot.img seems to be correct, any ideas why it doesn't work.
Edit: I was trying to make the files executable from using the code giving in the tutorial by lox, I don't know why its there.
Edit 2: Tried using your code, still wont boot goes straight to recovery.

i need to know what you want to do... and where your boot.img comes from.
btw, if you are trying to flash a complete rom with that script it won't work. check the update-script of a generic rom to see what is the minimal action necessary to create a bootable rom on the phone.
if you attach your update.zip or upload it somewhere i can have a look.

What ive done is converted the newest ROM from the three network called RUU_Hero_H3G_UK_2.73.771.73_release_signed_NoDriver.exe to an update.zip. Using the update-script file that is suggested in the lox tutorial, the ROM works fine but the kernel image isn't updated. Using both scripts posted above I get the problem above. I kernel I used was the one which came packed with the official update.
Here is the script that works but doesn't update the kernel (which came from the tutorial here):
Code:
show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
set_perm_recursive 0 0 0755 0644 SYSTEM:app
show_progress 0.1 10

I've figured out the problem, sort of. The line format BOOT: seems to just overwrite the existing kernel without problems so thanks for the help and problem solved.

Related

Modifying update-script to replace apns-conf.xml

I'd like to create an update.zip to replace huge apns-conf.xml with my own apns-conf.xml.
Basically I took one of the simplest update.zip, for example 1.91-generic-hero-teknologist-custom-autosetup-signed.zip, unpack, delete all folder inside /system, and create /system/etc/ to place my own apns-conf.xml.
Now, the update-script inside /META-INF/com/google/android/. I don't know what line to put. I blindly copy Lox's tutorial, and paste
Code:
show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
set_perm_recursive 0 0 0755 0644 SYSTEM:app
show_progress 0.1 10
When I flash the update.zip, the error is E:Syntax error in update script
Now, is there any tutorial or paper on this update-script coding?
Code:
show_progress 0.1 0
delete SYSTEM:etc/apns-conf.xml
copy_dir PACKAGE:system SYSTEM:
show_progress 0.3 0
write_raw_image PACKAGE:boot.img BOOT:
show_progress 0.3 10
Also comes with syntax error.
Try
show_progress 0.1 0
delete SYSTEM:etc/apns-conf.xml
copy_dir PACKAGE:system SYSTEM:
show_progress 0.1 10
try the above. if it gives you errors check /tmp/recovery.log, there might be more information inside.
kendong2 said:
try the above. if it gives you errors check /tmp/recovery.log, there might be more information inside.
Click to expand...
Click to collapse
Do you have to delete db for telephony
com.android.providers.telephony/databases/telephony.db
?
have some problemes whit my own apns-conf.. does'nt seem to work
no idea why deleting telephony.db should help, and yet again i am tempetd to say: "doesn't work" is not an error message...
then again my translation website tells me the proper english term for this is "The proof of the pudding is in the eating", so nandroid and try...
With a update.zip the database needs to be rebuilded i think. Dont anyone know hos to write the update guld?
Sent from my HTC Hero using Tapatalk

Help/Advice Would Be Appreciated

Hi. I had Oxygen 1.0 installed with N1 Table. I fancied a change back to a HD Sense Rom - therefore I changed back to the Sense Partition Tables within S-Off. However when attempting to install the rom I keep getting an error message:-
E: Can't chown/mod /system/xbin
(No such file or directory)
E: Failure at Line 24:
set_perm_recursive 0 2000 0755 0755 SYSTEM:xbin
I have done a search and discovered I may need to reflash my SPL?
How is this done?
Regards
Andy
do you have an ext partition? hd roms are to big and the don't just fit in NAND, so they mostly require you to have an ext partition atleast 512mb.
murdoch1 said:
Hi. I had Oxygen 1.0 installed with N1 Table. I fancied a change back to a HD Sense Rom - therefore I changed back to the Sense Partition Tables within S-Off. However when attempting to install the rom I keep getting an error message:-
E: Can't chown/mod /system/xbin
(No such file or directory)
E: Failure at Line 24:
set_perm_recursive 0 2000 0755 0755 SYSTEM:xbin
I have done a search and discovered I may need to reflash my SPL?
How is this done?
Regards
Andy
Click to expand...
Click to collapse

[TUTORIAL] Everything about ADB - A reference for everyone

TUTORIAL - EVERYTHING ABOUT ADB - Fully Illustrated
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
This will be part of a series of Tutorials compiled to better educate the Beginner-Intermediate users in XDA thread, and help them get rid of the "n00b" or "newbie" tag thrown at them!
1. WHAT IS ADB?
ADB or Android Debug Bridge is a command line program which is used to communicate with your Android phone (or an emulator used by programmers). The use of Adb for Android phone users ranges from using it as a tool to get the logcat- A realtime log of the Android system, which allows one to know the cause of any errors. It is very helpful to app hackers to know exctly what block of code does what, and to modify apps accordingly
2. HOW TO USE ADB - Running adb.exe
adb.exe is part of a package of tools called Android SDK or Software Development Kit. For users, the main applications useful for them are adb.exe, fastboot.exe and aapt.exe.
2.1 Installing adb.exe (Windows)
First, download the Android SDK package(exe file) from here The installer will prompt you to download and install the JDK (Java Development Kit) if you dont have it already installed
Next install the exe file and note the location where you install it to.
After install is over, use Windows explorer and navigate to the folder where you installed the SDK.
Double-click the SDK Manager.exe/SDK Setup.exe file at the root of the Android SDK directory.
This will open up the SDK Installation window, where you can choose from a list of packages to install
If you want to use only adb.exe and fastboot.exe, choose to install only the "Android SDK Tools" from the list (See fig 1 below)
That's it, adb.exe is now installed
Fig1:
Take a note of where you install it. It usually installs to a folder named Android-sdk-windows. Once you have it installed, you can copy the entire folder on a portable usb key/CD and use it on any other PC without a need to install it. I recommend that you make it a part of your Android CD (with rooting tools, unrooting tools, gold card etc).
2.2 Using adb.exe-Preparing your PC for running adb.exe quickly
Adding Adb to your Windows Path
Once installed, you should add the location of adb.exe to the* Windows Environment Path variable. To do that, go the subfolder of Android-sdk-windows where adb.exe can be found. Click on the Windows Explorer path displayed on Top, and copy the path to the Clipboard
Go to Start Menu, and Right click Computer, Choose Properties
Choose Advanced System Settings and then Environment variables
Now, add the Location you copied to the Clipboard earlier, to the end of the current path, after adding a ";"(without the quotes) to the end of the current path.
So, in my case, the current path shows:
c:\droidzone\windows; c:\droidzone\blahblah
It now becomes:
c:\droidzone\windows; c:\droidzone\blahblah;C:\Software\Phone\android-sdk-windows\tools
Hit Enter to everything.
From now, whenever you open a Command prompt in Windows, you will be able to execute Adb and Fastboot from there without needing to navigate to the folder where they are installed.
Next step: Elementary Adb commands
Don't forget to Hit the Thanks button to let me know that my posts helped you!
Elementary Adb commands
Ok, now that you've got adb all setup and prepared your computer to use it, you're ready to learn some basic adb commands. I'll be teaching some of them in this section.
Understanding how adb and the shell works
Let's first check if adb is working by asking it to communicate with our phone. Connect the phone with a usb cable to the PC. Note that you should have installed the HTC drivers already (They come with HTC Sync)
From your Windows Start Menu, Click on Run, then type the following and press enter. That should open a command shell:
Code:
cmd
Once there, type out the following:
Code:
adb devices
This will display a list showing the connected phones with their serial numbers (and emulators-But let us not worry about what these are, right now)
Great, now we have confirmation that adb is working! We're now ready to issue our basic commands.
First thing to note is the basic command to enter the Android custom linux shell. Like Windows has cmd.exe to enter the dos shell, the graphical eyecandy with Sense overlay that you see on your device has a custom linux kernel running, so basically the language of its shell is the Linux shell language.
Accessing the Linux terminal (adb shell) is what we do to issue commands. To enter the shell of our device, the basic command is:
Code:
adb shell
Immediately, you will get a prompt like this:
Code:
sh-3.2#
Now we can type out any (most) linux commands and these will be executed in our device.
The file system on Android is laid out over MTD partitions in your device's NAND (Internal memory), and the SD card. The Nand is strictly organized in a Linux system with Linux file permissions and ownership rights (Just know that these exist, for now)
So, right now, you will be dropped in the "root" of the filesystem, from where you can navigate to other places.
Note! An important difference between Linux and Windows is that while Windows uses the Backslash (\), Linux/Android uses the forward slash (/) to depict directory hierarchies. Another one you shouldnt forget is that in Linux/Android, a file named boot.img is different from Boot.img, BOOT.IMG and BoOt.img, while on Windows, they are all the same.
Click to expand...
Click to collapse
My tutorial is about adb commands, and not linux, so I'll give only a short summary of elementary linux commands below. I will expand the list and explanation for this at a later date if you require it:
pwd-Shows the current working directory
cp-copy a file
mv-move a file (copy a file and then delete the original file)
chmod-set file permissions
chown-set file ownerships
rm-delete a file
cd-change directory
rmdir-delete a directory
Click to expand...
Click to collapse
Elementary Adb commands
Installing applications with adb
You can install any apk from your PC to the phone very easily. Open a cmd shell, and then type in:
Code:
adb install
followed by a space. Now drag an apk file in Windows explorer to the shell we have opened. Immediately, the path of the file becomes inserted in our prompt that it becomes:
Code:
adb install C:\Desktop\TitaniumBackup.apk
assuming that the file TitaniumBackup.apk was present in the location C:\Desktop. Hit enter and you will notice that it gets installed.
Transferring files to the sdcard without connecting the device as Disk drive:
Code:
adb push C:\Desktop\TitaniumBackup.apk /sdcard/
will trasfer the file C:\Desktop\TitaniumBackup.apk to the root (main) directory of your sdcard. Likewise, you can transfer any file from the PC to any location on your device.
Eg: I want to transfer a file called wallpaper.zip to a location /data/local. The command would be:
Code:
adb push C:\Desktop\wallpaper.zip /data/local/
Contd..
Don't forget to Hit the Thanks button to let me know that my posts helped you!
More elementary adb commands:
Getting a file from your phone to your PC:
To get a file /system/etc/init.d/01data to your PC, you would type out the following:
Code:
adb pull /system/etc/init.d/01data
which will transfer the spcified file to the location on your pc where you have opened the cmd.exe shell.
Mounting the system partition as Read Write to transfer files to your /system partition:
Method 1:
Code:
adb remount
Method 2:
This can also be accomplished with the more advanced mount command in the adb shell. First we need to know the mount point of the partitions.
Type:
Code:
adb shell
mount
For me, it displays:
Code:
rootfs / rootfs rw,relatime 0 0
tmpfs /dev tmpfs rw,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
/sys/kernel/debug /sys/kernel/debug debugfs rw,relatime 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0
tmpfs /app-cache tmpfs rw,relatime,size=8192k,mode=755,gid=1000 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
[B]/dev/block/mtdblock3 /system yaffs2 ro,relatime 0 0[/B]
/dev/block/mtdblock4 /cache yaffs2 rw,nosuid,nodev,relatime 0 0
/dev/block/mtdblock5 /system/data yaffs2 rw,nosuid,nodev,noatime,nodiratime 0 0
/dev/block/mmcblk0p2 /data ext4 rw,nosuid,nodev,noatime,nodiratime,commit=50,bar
rier=0,stripe=64,data=ordered,noauto_da_alloc 0 0
/dev/block/vold/179:1 /mnt/sdcard vfat rw,dirsync,nosuid,nodev,noexec,relatime,u
id=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset
=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:1 /mnt/secure/asec vfat rw,dirsync,nosuid,nodev,noexec,relat
ime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,ioch
arset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
tmpfs /mnt/sdcard/.android_secure tmpfs ro,relatime,size=0k,mode=000 0 0
sh-3.2#
Note that the entry for system partition shows:
/dev/block/mtdblock3 /system yaffs2 ro,relatime 0 0
The ro means that /system is mounted as RO-i.e Read Only. The whole line means that the Nand MTD block device on /dev/block/mtdblock3 is mounted on the mount point /system, to use technical jargon.
We need to mount it as RW (Read Write)
The command is:
Code:
mount -o rw,remount /dev/block/mtdblock3 /system
This essentially mounts the /system as Read Write so that you can write to it (Normally you cant write to the /system partition), which is what "adb remount " also does. However the commands above can be executed from a Terminal Emulator application too.
Next: Getting an Adb logcat
Don't forget to Hit the Thanks button to let me know that my posts helped you!
Getting an adb logcat
Many a time, you might have heard people telling you to get a logcat to report your error with a Rom installation.
What is a logcat?
A logcat is a report from the Android logging system, which takes place in the background the whole time your phone is on. It starts the moment you switch on the phone, and continues till you shut it down completely. This log is extremely useful for finding out what went wrong with your system. It is useful to find out why your phone is having bootloops or force closes. It is infact useful for all errors!
How to get the logcat?
Basically, you can view the logcat log with the following command:
Code:
adb logcat
But that means getting overwhelmed by an endless haze of output flowing at a rate that you cant read and will overwhelm your command shell's capacity very soon.
So the system we normally use is to output the log to a file from which we can read later. This is done by the following command:
Code:
adb logcat > log.txt
My Technique
As a Rom developer and apk patcher, I have to constantly check for errors in my system. So I've devised an ingenous method to easily log logcat, and view them readily. I use a combo of commands executed in succession:
Code:
adb kill-server
echo "" > log.txt
start log.txt
adb logcat > log.txt
These commands essentially create a blank file named log.txt in the same path as the command shell you've opened. Then, it opens the file log.txt (which is blank at this point of time. Then it logs logcat output to that file. Once you refresh the opened file, it will show the output of logcat to this point of time. Refresh it once again, and it updates once more. You should install Notepad++ and associate .txt files with it, to get best results.
Instead of executing these four commands, you can download the batch file getlog.cmd and extract it from the zip file to the folder containing adb.exe. Once you type in the following command (from anywhere in Windows), you will achieve the same result as typing the four commands as above! Ingenious, eh?
Don't forget to Hit the Thanks button to let me know that my posts helped you!
Summary of other adb commands
The following is the partial list of commands supported by adb. You can obtain this list by the following command:
Code:
adb /?
Code:
C:\Users>adb /?
Android Debug Bridge version 1.0.26
-d - directs command to the only connected USB devic
e
returns an error if more than one USB device is
present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is r
unning.
-s <serial number> - directs command to the USB device or emulator w
ith
the given serial number. Overrides ANDROID_SERI
AL
environment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices - list all connected devices
connect <host>:<port> - connect to a device via TCP/IP
disconnect <host>:<port> - disconnect from a TCP/IP device
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> [<local>] - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] [-s] <file> - push this package file to the device and i
nstall it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data
)
('-s' means install on SD card instead of inter
nal storage)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories
)
adb bugreport - return all information from the device
that should be included in a bug report.
adb help - show this help message
adb version - show version num
DATAOPTS:
(no option) - don't touch the data partition
-w - wipe the data partition
-d - flash the data partition
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specifie
d device
adb remount - remounts the /system partition on the device re
ad-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the boo
tloader or recovery program
adb reboot-bootloader - reboots the device into the bootloader
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on th
e specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be u
pdated.
- If it is "system" or "data", only the corresponding partition
is updated.
I will add notes for these if you require them.
See the next post for Kernel errors..
How to get Kernel error messages
You can get debug messages from a running kernel with:
Code:
adb shell
dmesg
If you have reboots due to kernel panic, you should make users capture the last_kmsg log from /proc immediately on the reboot.
Note that dmesg can be disabled by the kernel maintainer, and hence some roms/kernels may not support the command.
Code:
adb shell
cat /proc/last_kmsg > /sdcard/last_kmsg
Should be done immediately after the reboot..Otherwise it will just get overwritten by newer kernel message.
So in brief, if you'd like to look at what the kernel is doing right now (any errors etc), you should use dmesg. If you want to know why your kernel rebooted, use the file proc/last_kmsg
It's extremely useful!
Don't forget to Hit the Thanks button to let me know that my posts helped you!
Guys, part of the tutorial is over.. Hope it is helpful. Will add more useful and advanced stuff later.. Hope it helps the newbies and some more seasoned users.
Feel free to ask any doubt that you think is silly, without fear of being ridiculed or being asked to search the thread! It should be related to adb though!
Impressive tutorial. You'll get my thanks when im back at my home pc
Sent from my HTC Desire S using XDA App
Nice tutorial bro. shoud be on dev section...???
coolexe said:
Nice tutorial bro. shoud be on dev section...???
Click to expand...
Click to collapse
Thanks bro.. I thought that might scare away newbies, plus since I havent done any actual development..
Droidzone said:
Thanks bro.. I thought that might scare away newbies, plus since I havent done any actual development..
Click to expand...
Click to collapse
Hi,
there is lots of thread in dev. section which doesn't belong to development...anyway nice tutorial for noobs...if possible add QtADB tool...
EDIT: Added to my threads
Will add a GUI section. Good tip.. It's a very useful tool
Hi there.
Well this is a nice tut for android newbies like me
can you also add a basic symlinking tut? (especially how to symlink a folder to an already existing symlink )
thanks!
jesseuy said:
Hi there.
Well this is a nice tut for android newbies like me
can you also add a basic symlinking tut? (especially how to symlink a folder to an already existing symlink )
thanks!
Click to expand...
Click to collapse
Does this answer your query?
From http://uw714doc.sco.com/en/SDK_sysprog/_Using_Symbolic_Links.html
Code:
[B]Creating symbolic links[/B]
To create a symbolic link, the new system call [URL="http://uw714doc.sco.com/en/man/html.2/symlink.2.html"]symlink(2)[/URL] is used and the owner must have write permission in the directory where the link will reside. The file is created with the user's user-id and group-id but these are subsequently ignored. The mode of the file is created as 0777.
CAUTION: No checking is done when a symbolic link is created. There is nothing to stop a user from creating a symbolic link that refers to itself or to an ancestor of itself or several links that loop around among themselves. Therefore, when evaluating a pathname, it is important to put a limit on the number of symbolic links that may be encountered in case the evaluation encounters a loop. The variable MAXSYMLINKS is used to force the error ELOOP after MAXSYMLINKS symbolic links have been encountered. The value of MAXSYMLINKS should be at least 20.
To create a symbolic link, the ln command is used with the -s option (see [URL="http://uw714doc.sco.com/en/man/html.1/ln.1.html"]ln(1)[/URL]). If the -s option is not used and a user tries to create a link to a file on another file system, a symbolic link will not be created and the command will fail.
The syntax for creating symbolic links is as follows:
ln -s sourcefile1 [ sourcefile2 ... ] target With two arguments:
[LIST]
[*] sourcefile1 may be any pathname and need not exist.
[*] target may be an existing directory or a non-existent file.
[*] If target is an existing directory, a file is created in directory target whose name is the last component of sourcefile1 (`basename sourcefile1`). This file is a symbolic link that references sourcefile1.
[*] If target does not exist, a file with name target is created and it is a symbolic link that references sourcefile1.
[*] If target already exists and is not a directory, an error is returned.
[*] sourcefile1 and target may reside on different file systems.
[/LIST]
With more than two arguments:
[LIST]
[*] For each sourcefile, a file is created in target whose name is sourcefile or its last component (`basename sourcefile`) and is a symbolic link to sourcefile.
[*] If target is not an existing directory, an error is returned.
[*] Each sourcefile and target may reside on different file systems.
[/LIST]
[B]Examples[/B]
The following examples show how symbolic links may be created.
ln -s /usr/src/uts/sys /usr/include/sys In this example /usr/include is an existing directory. But file sys does not exist so it will be created as a symbolic link that refers to /usr/src/uts/sys. The result is that when file /usr/include/sys/x is accessed, the file /usr/src/uts/sys/x will actually be accessed. This kind of symbolic link may be used when files exist in the directory /usr/src/uts/sys but programs often refer to files in /usr/include/sys. Rather than creating corresponding files in /usr/include/sys that are hard links to files in /usr/src/uts/sys, one symbolic link can be used to link the two directories. In this example /usr/include/sys becomes a symbolic link that links the former /usr/include/sys directory to the /usr/src/uts/sys directory.
ln -s /etc/group . In this example the target is a directory (the current directory), so a file called group (`basename /etc/group`) is created in the current directory that is a symbolic link to /etc/group. ln -s /fs1/jan/abc /var/spool/abc In this example we imagine that /fs1/jan/abc does not exist at the time the command is issued. Nevertheless, the file /var/spool/abc is created as a symbolic link to /fs1/jan/abc. Later, /fs1/jan/abc may be created as a directory, regular file, or any other file type. The following example illustrates the use of more than two arguments:
ln -s /etc/group /etc/passwd . The user would like to have the group and passwd files in the current directory but cannot use hard links because /etc is a different file system. When more than two arguments are used, the last argument must be a directory; here it is the current directory. Two files, group and passwd, are created in the current directory, each a symbolic link to the associated file in /etc. [B]Removing symbolic links[/B]
Normally, when accessing a symbolic link, one follows the link and actually accesses the referenced file. However, this is not the case when one attempts to remove a symbolic link. When the [URL="http://uw714doc.sco.com/en/man/html.1/rm.1.html"]rm(1)[/URL] command is executed and the argument is a symbolic link, it is the symbolic link that is removed; the referenced file is not touched.
[B]Accessing symbolic links[/B]
Suppose abc is a symbolic link to file def. When a user accesses the symbolic link abc, it is the file permissions (ownership and access) of file def that are actually used; the permissions of abc are always ignored. If file def is not accessible (that is, either it does not exist or it exists but is not accessible to the user because of access permissions) and a user tries to access the symbolic link abc, the error message will refer to abc, not file def.
[B]Copying symbolic links[/B]
This section describes the behavior of the [URL="http://uw714doc.sco.com/en/man/html.1/cp.1.html"]cp(1)[/URL] command when one or more arguments are symbolic links. With the [URL="http://uw714doc.sco.com/en/man/html.1/cp.1.html"]cp(1)[/URL] command, if any argument is a symbolic link, that link is followed. Suppose the command line is
cp sym file3 where sym is a symbolic link that references a regular file test1 and file3 is a regular file. After execution of the command, file3 gets overwritten with the contents of the file test1. If the last argument is a symbolic link that references a directory, then files are copied to that directory. Suppose the command line is
cp file1 sym symd where file1 is a regular file, sym is a symbolic link that references a regular file test1, and symd is a symbolic link that references a directory DIR. After execution of the command, there will be two new files, DIR/file1 and DIR/sym that have the same contents as file1 and test1.
[B]Linking symbolic links[/B]
This section describes the behavior of the [URL="http://uw714doc.sco.com/en/man/html.1/ln.1.html"]ln(1)[/URL] command when one or more arguments are symbolic links. To understand the difference in behavior between this and the [URL="http://uw714doc.sco.com/en/man/html.1/cp.1.html"]cp(1)[/URL] command, it is useful to think of a copy operation as dealing with the contents of a file while the link operation deals with the name of a file.
Let us look at the case where the source argument to ln is a symbolic link. If the -s option is specified to ln, the command calls the symlink system call (see [URL="http://uw714doc.sco.com/en/man/html.2/symlink.2.html"]symlink(2)[/URL]). symlink does not follow the symbolic link specified by the source argument and creates a symbolic link to it. If -s is not specified, ln invokes the [URL="http://uw714doc.sco.com/en/man/html.2/link.2.html"]link(2)[/URL] system call. link follows the symbolic link specified by the source argument and creates a hard link to the file referenced by the symbolic link.
For the target argument, ln invokes a stat system call (see [URL="http://uw714doc.sco.com/en/man/html.2/stat.2.html"]stat(2)[/URL]). If stat indicates that the target argument is a directory, the files are linked in that directory. Otherwise, if the target argument is an existing file, it is overwritten. This means that if the second argument is a symbolic link to a directory, it is followed, but if it is a symbolic link to a regular file, the symbolic link is overwritten.
For example, if the command line is
ln sym file1 where sym is a symbolic link that references a regular file foo, and file1 is a regular file, file1 is overwritten and hard-linked to foo. Thus a hard link to a regular file has been created.
If the command is
ln -s sym file1 where the files are the same as in first example, file1 is overwritten and becomes a symbolic link to sym. If the command is
ln file1 sym where the files are the same as in the first example, sym is overwritten and hard-linked to file1. When the last argument is a directory as in
ln file1 sym symd where symd is a symbolic link to a directory DIR, and file1 and sym are the same as in the first example, the file DIR/file1 is hard-linked to file1 and DIR/sym is hard-linked to foo. [B]Moving symbolic links[/B]
This section describes the behavior of the [URL="http://uw714doc.sco.com/en/man/html.1/mv.1.html"]mv(1)[/URL] command. Like the [URL="http://uw714doc.sco.com/en/man/html.1/ln.1.html"]ln(1)[/URL] command, [URL="http://uw714doc.sco.com/en/man/html.1/mv.1.html"]mv(1)[/URL] deals with file names rather than file contents. With two arguments, a user invokes the [URL="http://uw714doc.sco.com/en/man/html.1/mv.1.html"]mv(1)[/URL] command to rename a file. Therefore, one would not want to follow the first argument if it is a symbolic link because it is the name of the file that is to be changed rather than the file contents. Suppose that sym is a symbolic link to /etc/passwd and abc is a regular file. If the command
mv sym abc is executed, the file sym is renamed abc and is still a symbolic link to /etc/passwd. If abc existed (as a regular file or a symbolic link to a regular file) before the command was executed, it is overwritten. Suppose the command is
mv sym1 file1 symd where sym1 is a symbolic link to a regular file foo, file1 is a regular file, and symd is a symbolic link that references a directory DIR. When the command is executed, the files sym1 and file1 are moved from the current directory to the DIR directory so that there are two new files, DIR/sym1, which is still a symbolic link to foo, and DIR/file1. In UnixWare, the [URL="http://uw714doc.sco.com/en/man/html.1/mv.1.html"]mv(1)[/URL] command uses the [URL="http://uw714doc.sco.com/en/man/html.2/rename.2.html"]rename(2)[/URL] system call. If the first argument to [URL="http://uw714doc.sco.com/en/man/html.2/rename.2.html"]rename(2)[/URL] is a symbolic link, [URL="http://uw714doc.sco.com/en/man/html.2/rename.2.html"]rename(2)[/URL] does not follow it; instead it renames the symbolic link itself. In System V prior to Release 4, a file was moved using the [URL="http://uw714doc.sco.com/en/man/html.2/link.2.html"]link(2)[/URL] system call followed by the [URL="http://uw714doc.sco.com/en/man/html.2/unlink.2.html"]unlink(2)[/URL] system call. Since [URL="http://uw714doc.sco.com/en/man/html.2/link.2.html"]link(2)[/URL] and [URL="http://uw714doc.sco.com/en/man/html.2/unlink.2.html"]unlink(2)[/URL] do not follow symbolic links, the result of those two operations is the same as the result of a call to [URL="http://uw714doc.sco.com/en/man/html.2/rename.2.html"]rename(2)[/URL].
Thanks for adding the tut. Will be reading and will definitely try it out.
Thanks again!
Sent from my HTC Desire using XDA App
Thanks a lot for the tutorial. Basic stuff nicly explained. i tried the push method via adb to push a font into system/fonts directory still it says read only permission
C:\Users\Mayu>adb shell
# mount
mount
rootfs / rootfs ro 0 0
tmpfs /dev tmpfs rw,mode=755 0 0
devpts /dev/pts devpts rw,mode=600 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
none /acct cgroup rw,cpuacct 0 0
tmpfs /mnt/asec tmpfs rw,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,mode=755,gid=1000 0 0
none /dev/cpuctl cgroup rw,cpu 0 0
/dev/block/mtdblock0 /system yaffs2 rw 0 0
/dev/block/mtdblock1 /data yaffs2 rw,nosuid,nodev 0 0
/dev/block/mtdblock2 /cache yaffs2 rw,nosuid,nodev 0 0
/dev/block/vold/179:0 /mnt/sdcard vfat rw,dirsync,nosuid,nodev,n
id=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,io
1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:0 /mnt/secure/asec vfat rw,dirsync,nosuid,no
000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp4
8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
tmpfs /mnt/sdcard/.android_secure tmpfs ro,size=0k,mode=000 0 0
Click to expand...
Click to collapse
error mesg
C:\Users\Mayu>adb push E:\soft\Android\Indic\DroidSansFallback.ttf \system\fonts
failed to copy 'E:\soft\Android\Indic\DroidSansFallback.ttf' to '\system\fonts':
Read-only file system
Click to expand...
Click to collapse
PS: pull works like charm. please guide me if u hav time. Thanks.
DroidMayu said:
Thanks a lot for the tutorial. Basic stuff nicly explained. i tried the push method via adb to push a font into system/fonts directory still it says read only permission
error mesg
PS: pull works like charm. please guide me if u hav time. Thanks.
Click to expand...
Click to collapse
Yup, on an s on system, even though system can be mounted as rewrite, writing isn't allowed. You have to execute the commands in recovery mode
Sent from my HTC Desire using XDA App
Great tutorial! Thanks for that, definitely noob friendly...
Have a question about the following,
DATAOPTS:
(no option) - don't touch the data partition
-w - wipe the data partition
-d - flash the data partition
I have the Samsung Galaxy S I9000 (not sure if that makes a difference) and if my screen breaks or i have some sort of hardware problem. After flashing the stock rom back on do i use the above commands to wipe the evidence of any programs that suggest the device was previously rooted. If so which one wipe or flash?
Thanks
Thank You!!!
Hey Droidzone,
I'm really in awe of you, and need to thank you for the amazing work you're doing here - at XDA.
I just can't find the thank you button on the forums.(I could be blind !!!)
Thanks a zillion!!!

[TUTORIAL] Making Flashable ZIPs, EDIFY Script, ZIP Signing & Key Creation [19.01.13]

[TUTORIAL] Making Flashable ZIPs, EDIFY Script, ZIP Signing & Key Creation [19.01.13]
Recent Updates: Command Line Edify Script Tester, Further 'update-binary' info clarification, helpful links, additional credits. post#1
Hi all,
In the process of creating my [BOOTANIMATIONS - LINKS & INFO] thread I realised I needed to know more about how boot animations worked, as by default people tend to ask questions in that type of thread, so I wanted to be able to help.
This meant I came across the problem of creating flash-able ZIP files and Edify scripting and in the interests of sharing and helping this great community I would like to share what I have found and hopefully learn more through discussion, I certainly am no expert and am always willing to learn.
I have checked xda and various other websites whilst reseraching for this post and there is nothing that really explains all the basic concepts to just get up and running, also a lot of threads are quite old and focus on the old Amend scripting syntax or are a confusing mixture of the two.
I hope this helps people get started and that we can all collaborate to make this a thread a source of valuable information.
Contents:
Post #1: Tutorials
Post #2: Edify Commands
***Please, if there are any mistakes on this thread then let me know what I have done incorrectly in reply to this post and I will update the thread to correct it***
***As always, I accept no responsibiltiy for your handset, you modify it at your own risk, nobody is forcing you...be aware you can seriously bork your phone by flashing its internal partitions! Always make a nandroid back-up and think before you flash!***
***Have you made a nandroid back-up...no? Then make one!!***
You will need the following:
Android SDK, ADB & Fastboot set up for your handset.
Notepad++ [LINK]
7zip [LINK]
Setting up your zip directories:
you will need to create the following folder structure (these are case sensitive):
Code:
/META-INF/com/google/android
All flash-able zips include this file structure, the final folder 'android' will contain two files:
Code:
update-binary
updater-script
update-binary: I have been unable to find much information on the update-binary file other than they seem to be chip set specific (if anyone can shed further light on these I will include it here). For the sake of compatibility I have attached the update binary from the latest CyanogenMod Nightlies for the maguro at the bottom of this thread - You can of course download the latest nightly and extract the update-binary file yourself as the attached one will obviously begin to date (all credit to the great devs at CyanogenMod for this, many thanks).
Update: For more detailed info on the update binary you can find the sources in the bootable/recovery/updater directory at AndroidXRef here: [ xref: /bootable/recovery/updater/ ]. There is also an edify directory which looks like it handles the parsing of the script. Obviously with the sources there's nothing to stop you extending syntax/functionality should you wish given the fact the each zip comes with its own version. It will also help you understand how signature checking is handled.
Update II: For anybody having problems flashing it is worth ensuring you have an up to date version of the update-binary (obviously the one attached to this thread will gradually become out of date).
It is advisable to use the update-binary from the latest OTA image for your device, these images can be found in the following link:
Official Google OTA update URLs - efrant
updater-script: This we can create ourselves, to ensure it works properly we will use Notepad++.
Open Notepad++ and start a new file, with the following settings:
Format: Unix
Encoding: ANSI
Default Language: Normal Text
Save this file as:
File name: updater-script
File type: All types (*.*)
You can now edit this file, add the following text:
Code:
[COLOR="Red"]assert(getprop("ro.product.device") == "maguro" || getprop("ro.build.product") == "maguro");[/COLOR]
[COLOR="Green"]ui_print(" ");[/COLOR]
[COLOR="green"]ui_print("confirming device maguro");[/COLOR]
[COLOR="green"]ui_print(" ");[/COLOR]
[COLOR="green"]ui_print("success");[/COLOR]
[COLOR="green"]ui_print(" ");[/COLOR]
[COLOR="DarkOrange"]show_progress(0.200000, 5);[/COLOR]
[COLOR="green"]ui_print("mounting system");[/COLOR]
[COLOR="red"]mount("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/system", "/system");[/COLOR]
[COLOR="green"]ui_print(" ");[/COLOR]
[COLOR="DarkOrange"]show_progress(0.200000, 5);[/COLOR]
[COLOR="green"]ui_print("updating system files");[/COLOR]
[COLOR="red"]package_extract_dir("system", "/system");[/COLOR]
[COLOR="green"]ui_print(" ");[/COLOR]
[COLOR="DarkOrange"]show_progress(0.200000, 5);[/COLOR]
[COLOR="green"]ui_print("unmounting system");[/COLOR]
[COLOR="red"]unmount("/system");[/COLOR]
[COLOR="green"]ui_print(" ");[/COLOR]
[COLOR="DarkOrange"]show_progress(0.200000, 5);[/COLOR]
[COLOR="green"]ui_print("by yourusername");[/COLOR]
[COLOR="DarkOrange"]show_progress(0.200000, 5);[/COLOR]
[COLOR="green"]ui_print(" ");[/COLOR]
***EMPTY LINE***
Ok, I've colour coded this so we can break it down, the lines of code in RED are the actual commands, everything else is cosmetic.
assert(getprop("ro.product.device") == "maguro" || getprop("ro.build.product") == "maguro"); This is checking you are flashing the correct handset, this is not a requirement, but is best practice. Just insert another device name in the place of "maguro" if you so wish, or remove the command all together.
mount("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/system", "/system"); This is the specific mount point for the maguro system partition, if you wish to flash a different partition, data for instance you can get the mount points for your device by entering the following code over ADB:
Code:
adb shell "mount > /sdcard/PHONENAME_mountinfo.txt"
This will place a text file on your sdcard with the mount points for your specific device (remember to swap 'PHONENAME' with your device name e.g. 'maguro')
package_extract_dir("system", "/system"); This command extracts the files you wish to flash from the zip and flashes them to the phone, it is formatted as follows ("package-path", "/destination-path"). So for this example you are telling it to flash everything from the 'system' folder in your zip to the /system partition of your handset. You can obviously change these values for different partitions.
unmount("/system"); This simply unmounts whatever partition you previously mounted.
ui_print(" "); Shows text in the recovery whilst the flash is ongoing, you can put whatever you please between the speech marks, you must leave a space if you wish to have a blank line.
show_progress(0.200000, 5); Controls what the progress bar in the background is displaying, it is formatted as follows (fragment, seconds).
***EMPTY LINE*** This is not actually text, you simply need to leave a blank line at the end of your script before you save it for it to work.
FYI, this means in fact your script could look like this and still work:
Code:
[COLOR="Green"]ui_print(" ");[/COLOR]
[COLOR="DarkOrange"]show_progress(1.000000, 30);[/COLOR]
[COLOR="red"]mount("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/system", "/system");[/COLOR]
[COLOR="red"]package_extract_dir("system", "/system");[/COLOR]
[COLOR="red"]unmount("/system");[/COLOR]
[COLOR="Green"]ui_print(" ");[/COLOR]
***EMPTY LINE***
But that just isn't that pretty, or as deceptively complicated lol!
Make sure you save your edify script.
Files to flash:
You now need to create a further folder, this needs to be named based on where within the system you are flashing, for the sake of this example we are flashing to the system partition, so:
Code:
/META-INF/com/google/android
/system/app
Place whatever files you wish to flash within this file e.g:
Code:
/META-INF/com/google/android
/system/app/nameofapp.apk
Creating your .zip file:
Select both of your top directories and their contents 'META-INF' and 'system' and package them into a .zip file with 7zip using the following settings:
Archive: name_of_your_file
Archive Format: zip
Compression level: Store
Update mode: Add and replace files
And there you have it, your very own flash-able .zip file.
I have attached an example flashable .zip file that includes this updater-script and the above mentioned CM update-binary.
How to sign your update.zip:
You don't actually need to sign your zip file for it to work as most custom recoveries now support unsigned zips, for aspiring developers and the more cautious among us though, here is how.
You will need to download the following files:
SignApk [LINK]
Java JDK (Java Development Kit) & JRE (Java Runtime Environment) [LINK]
Install Java JRE and JDK and restart your PC.
You then need to create a folder in the root of your c:\ drive named 'signapk' and extract the contents of the SignApk download (signapk.jar, key.pk8, certificate.pem) to this folder.
Place your .zip file into the same folder and then open cmd line. Input the following commands (remeber to change the name of 'myupdate.zip' to the name of your file and 'myupdate-signed.zip' to whatever you want your resulting .zip to be named):
Code:
cd\signapk\
java -jar signapk.jar certificate.pem key.pk8 c:\signapk\myupdate.zip myupdate-signed.zip
You should find that you now have the the following files in your 'META-INF' folder: CERT.RSA, CERT.SF, MANIFEST.MF
This can also to be used to sign .apk files using the below command (same stipulations for file name changing applies as above):
Code:
java -jar signapk.jar certificate.pem key.pk8 c:\signapk\myapplication.apk myapplication-signed.apk
How to create your own private signing key & certificate:
You will need the following download:
OpenSSL [LINK]
The above signapk file includes test keys, if you want to create your own private keys for signing, here's what you need to do.
As before extract the OpenSSL files to a folder in the root of your c:\ drive, preferably named 'openssl' for ease of cmd line navigation. Then input the following:
Code:
cd\openssl\
openssl genrsa -out key.pem 1024
openssl req -new -key key.pem -out request.pem
openssl x509 -req -days 9999 -in request.pem -signkey key.pem -out certificate.pem
openssl pkcs8 -topk8 -outform DER -in key.pem -inform PEM -out key.pk8 -nocrypt
You can then replace 'key.pk8' & 'certificate.pem' with your own files.
I really hope this has helped folks out, if so please consider hitting the 'Thanks' button!
Happy flashing!
Testing your script before you flash:
If you would like to test if your script commands are valid and will run properly on your PC first before you use them on your handset, therefore removing the fear of borking your current install/handset in the process then head to this post:
Command Line Edify Script Tester by: trevd
This great tool developed by trevd currently has the following features:
Validates function name.
Validates function parameter count.
It is available for Linux and Windows, so head over and check it out. Be sure to click trevd's thanks button if you find this useful.
Other helpful links & threads:
xda-developers: Edify script language wiki
Edify scripts in CWM recovery by: NFHimself
Phandroid - Edify Script Language Reference by: Koumajutsu
Introduction to edify updater script by: kurotsugi
Intelligent EDIFY updater-script - (Decides things during flash) by: lotherius
Credits:
CyanogenMod for (update-binary)
Lorenz's Blog for (SignAPK & Info)
JoeSyr for (Help with File Permissions)
efrant for (Help with various commands)
trevd for (further update-binary clarification and source links)
osm0sis for (Helpful info & forum links & help with update-binary info)
Edify Scripting Commands
I would like to try and put together a guide to Edify scripting commands and what their function is to compliment my above tutorial, I hope again we can all collaborate to make this a helpful source of information to all budding devs...we all have to start somewhere right!?
***Please, if there are any mistakes in this post or if you can help by adding further info please post below, thanks***
Ok...
Check you are flashing the correct device:
Code:
assert(getprop("ro.product.device") == "maguro" || getprop("ro.build.product") == "maguro" || getprop("ro.product.board") == "maguro");
This will check your device is showing the correct name in the build.prop, in this case "maguro", you can obviously replace this with your device name.
To explain this a little further, you have told the script to check certain properties within your 'build.prop' file located in your /system folder. The above command ensures the following categories have the correct definitions before proceeding with the flash:
Code:
ro.product.device=
ro.build.product=
ro.product.board=
Here are the main build properties within your build.prop:
Code:
ro.build.id=
ro.build.display.id=
ro.build.version.incremental=
ro.build.version.sdk=
ro.build.version.codename=
ro.build.version.release=
ro.build.date=
ro.build.date.utc=
ro.build.type=
ro.build.user=
ro.build.host=
ro.build.tags=
ro.product.model=
ro.product.brand=
ro.product.name=
ro.product.device=
ro.product.board=
ro.product.cpu.abi=
ro.product.cpu.abi2=
ro.product.manufacturer=
ro.product.locale.language=
ro.product.locale.region=
ro.wifi.channels=
ro.board.platform=
ro.build.description=
ro.build.fingerprint=
ro.build.characteristics=
ro.cm.device=
Print text in the recovery during flashing process:
Code:
ui_print("Your text here");
Code:
ui_print(" ");
This simply prints a line of text in the recovery, it has no actual effect on the flashing process, if you want a blank line just leave a blank space as the second example.
Controlling the progress bar:
I believe I understand this correctly, if not please do post below with further clarification.
Code:
show_progress(0.000000, 0);
or
Code:
set_progress(0.000000);
You have two choices when controlling the progress bar, the first example allows you to define fractions of the progress bar and how long they will take to fill. The second example just allows you to specify that the bar fills to a certain fraction at whatever point during the flashing process.
The command is defined as: (progress bar fraction, duration in seconds to fill defined fraction);
For example the following code lines interspersed with your other commands would fill a fifth of the progress bar every five seconds:
Code:
show_progress(0.200000, 5);
ui_print(" ");
show_progress(0.200000, 5);
ui_print(" ");
show_progress(0.200000, 5);
ui_print(" ");
show_progress(0.200000, 5);
ui_print(" ");
show_progress(0.200000, 5);
This process will only complete if the script takes long enough to flash, therefore you need to be aware of what you are actually flashing and how long it will take when defining these values.
If you wish to just define a fraction without fill without a time scale you can use the following command:
Code:
set_progress(0.000000);
It is also best practice to include this element in your scripts as it will reassure people that their handset hasn't frozen during a flash.
Mount/Unmount a partition:
To mount a partition you need to use the following syntax:
Code:
mount("filesystem-type", "partition-type", "device-specific-location", "mount-point");
filesystem-type: "ext4" or "yaffs2" (maguro is ext4)
partition-type: "EMMC" or "MTD" (maguro is EMMC)
location: Device specific address
mount-point: /system etc
So far I have managed to define the following Maguro specific mount points:
Code:
"/dev/block/platform/omap/omap_hsmmc.0/by-name/system", "/system"
"/dev/block/platform/omap/omap_hsmmc.0/by-name/userdata", "/data"
"/dev/block/platform/omap/omap_hsmmc.0/by-name/cache", "/cache"
"/dev/block/platform/omap/omap_hsmmc.0/by-name/efs" "/factory"
"/dev/block/platform/omap/omap_hsmmc.0/by-name/userdata", "/mnt/sdcard"
"/dev/block/platform/omap/omap_hsmmc.0/by-name/boot"
Example command would be:
Code:
mount("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/system", "/system");
I have taken these mount points from the file output by the maguro when you enter the following adb command:
Code:
adb shell "mount > /sdcard/maguro_mountinfo.txt"
I have to admit I am a little in the dark about the "/factory" partition, any info would be greatly appreciated!
To unmount a partition you need to input the following command:
Code:
unmount("/system");
Obviously replace the mount partition with whatever partition you are working in.
Format a partition:
To format a partition you need to use the following syntax:
Code:
format("filesystem-type", "partition-type", "device-specific-location", "0");
Example:
Code:
format("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/system", "0");
Some scripts include the "0" and some do not, not sure exactly on the function difference when included or not, again clarification would be great.
Flashing the contents of your ZIP file:
To flash an entire directory:
Code:
package_extract_dir("system", "/system");
To flash a single file:
Code:
package_extract_file("boot.img", "/dev/block/platform/omap/omap_hsmmc.0/by-name/boot");
These commands are structured as follows:
Entire directory: ("zipfileSource", "destination-partition");
Single File: ("file", "device-specific-mountpoint");
Deleting folders & files:
You can delete multiple folders or files using just one command, as follows:
To delete files:
Code:
delete("file-path-1", "file-path-2", "file-path-3);
To delete folders/directories:
Code:
delete_recursive("directory-path-1", "directory-path-2", "directory-path-3");
Setting Permissions
Here are the basics for setting permissions.
If you want to research the reasons behind this, there is some useful information on Linux permissions here: chmod wiki, linuxquestions.org linux wiki.
Thanks to JoeSyr for his input and help understanding this section of the tutorial.
Set permissions of a file or set of files:
Code:
set_perm(uid, gid, mode, "filepath1", "filepath2")
Example:
Code:
set_perm(0, 0, 06755, "/system/xbin/su");
uid - user id
gid - group id
mode - permission mode
filepath... - file to set permission on
Set permissions of a directory or set of directories and all files and folders within them:
Code:
set_perm_recursive(uid, gid, dirmode, filemode, "dirpath1", "dirpath2")
Example:
Code:
set_perm_recursive(0, 0, 0755, 0644, "/system");
uid - user id
gid - group id
dirmode - permission to set to directories contained within the specified directory
filemode - permission to set to files contained within the specified directory
dirpath... - directory to set permission on
Permissions syntax explained...so I can understand it lol (if I do then anyone can!):
The following are the pre-defined Android UID's & GID's. Taken from the following link: Android UIDs and GIDs
Code:
AID_ROOT 0 /* traditional unix root user */
AID_SYSTEM 1000 /* system server */
AID_RADIO 1001 /* telephony subsystem, RIL */
AID_BLUETOOTH 1002 /* bluetooth subsystem */
AID_GRAPHICS 1003 /* graphics devices */
AID_INPUT 1004 /* input devices */
AID_AUDIO 1005 /* audio devices */
AID_CAMERA 1006 /* camera devices */
AID_LOG 1007 /* log devices */
AID_COMPASS 1008 /* compass device */
AID_MOUNT 1009 /* mountd socket */
AID_WIFI 1010 /* wifi subsystem */
AID_ADB 1011 /* android debug bridge (adbd) */
AID_INSTALL 1012 /* group for installing packages */
AID_MEDIA 1013 /* mediaserver process */
AID_DHCP 1014 /* dhcp client */
AID_SHELL 2000 /* adb and debug shell user */
AID_CACHE 2001 /* cache access */
AID_DIAG 2002 /* access to diagnostic resources */
/* The 3000 series are intended for use as supplemental group id's only. */
/* They indicate special Android capabilities that the kernel is aware of. */
AID_NET_BT_ADMIN 3001 /* bluetooth: create any socket */
AID_NET_BT 3002 /* bluetooth: create sco, rfcomm or l2cap sockets */
AID_INET 3003 /* can create AF_INET and AF_INET6 sockets */
AID_NET_RAW 3004 /* can create raw INET sockets */
AID_MISC 9998 /* access to misc storage */
AID_NOBODY 9999
AID_APP 10000 /* first app user */
"root", AID_ROOT
"system", AID_SYSTEM
"radio", AID_RADIO
"bluetooth", AID_BLUETOOTH
"graphics", AID_GRAPHICS
"input", AID_INPUT
"audio", AID_AUDIO
"camera", AID_CAMERA
"log", AID_LOG
"compass", AID_COMPASS
"mount", AID_MOUNT
"wifi", AID_WIFI
"dhcp", AID_DHCP
"adb", AID_ADB
"install", AID_INSTALL
"media", AID_MEDIA
"shell", AID_SHELL
"cache", AID_CACHE
"diag", AID_DIAG
"net_bt_admin", AID_NET_BT_ADMIN
"net_bt", AID_NET_BT
"inet", AID_INET
"net_raw", AID_NET_RAW
"misc", AID_MISC
"nobody", AID_NOBODY
You will need to also understand the way file permissions are represented:
Example = drwxrwxrwx
-Use Root Explorer to find the UID, GID, and permissions for a file. Permissions are the string that looks like some variation on 'rwxr-xr--' next to each file. Long press and choose "change owner" to get the UID and GID. You just want the number next to "owner" and "group", respectively.
-If you're replacing a file, look up these settings for the existing copy and use them. If you're adding a file, just find a file that does the same functions and copy what it has (for example, installing an app to /system/app? Just look at these settings for any other app in that directory).
-MODE is technically a 4-bit string, but the first character can be omitted. There doesn't seem to be any android file permissions with the first character set. For good practice, I think it's safe to assume you can always use a leading 0 unless you know otherwise for something specific. Or, just use a 3-digit MODE, which says to leave those settings as they are (disabled by default). (I.e. 0644=644).
The next 9 characters define the file permissions. These permissions are
given in groups of 3 each.
The first 3 characters are the permissions for the owner of the file or directory.
Example = -rwx------
The next 3 are permissions for the group that the file is owned by.
Example = ----rwx---
The final 3 characters define the access permissions for everyone not part of the group.
Example = -------rwx
There are 3 possible attributes that make up file access permissions.
r - Read permission. Whether the file may be read. In the case of a
directory* this would mean the ability to list the contents of the
directory.
w - Write permission. Whether the file may be written to or modified. For
a directory* this defines whether you can make any changes to the contents
of the directory. If write permission is not set then you will not be able
to delete* rename or create a file.
x - Execute permission. Whether the file may be executed. In the case of a
directory* this attribute decides whether you have permission to enter*
run a search through that directory or execute some program from that
directory
You set these permissions using the following binary based numerical system:
Code:
0: --- No Permissions (the user(s) cannot do anything)
1: --x Execute Only (the user(s) can only execute the file)
2: -w- Write Only (the user(s) can only write to the file)
3: -wx Write and Execute Permissions
4: r-- Read Only
5: r-x Read and Execute Permissions
6: rw- Read and Write Permissions
7: rwx Read, Write and Execute Permissions
Default Linux permissions:
For Files:
"Read" means to be able to open and view the file
"Write" means to overwrite or modify the file
"eXecute" means to run the file as a binary
For Directories:
"Read" means to be able to view the contents of the directory
"Write" means to be able to create new files/directories within the directory
"eXecute" means to be able to "Change Directory" (cd) into the directory
Most of the time you set "Read" and "eXecute" together on directories (kind of useless when set by themselves)
Interestingly through further research it seems this system is based on the Octal Binary system...I may be wrong...
Code:
Octal
Binary is also easily converted to the octal numeral system, since octal uses a radix of 8, which is a power of two (namely, 23, so it takes exactly three binary digits to represent an octal digit).
The correspondence between octal and binary numerals is the same as for the first eight digits of hexadecimal in the table above.
Binary 000 is equivalent to the octal digit 0, binary 111 is equivalent to octal 7, and so forth.
Octal Binary
0 000
1 001
2 010
3 011
4 100
5 101
6 110
7 111
Converting from octal to binary proceeds in the same fashion as it does for hexadecimal:
658 = 110 1012
178 = 001 1112
And from binary to octal:
1011002 = 101 1002 grouped = 548
100112 = 010 0112 grouped with padding = 238
And from octal to decimal:
658 = (6 × 81) + (5 × 80) = (6 × 8) + (5 × 1) = 5310
1278 = (1 × 82) + (2 × 81) + (7 × 80) = (1 × 64) + (2 × 8) + (7 × 1) = 8710
Flash boot partition
This uses the following command but with some caveats:
Code:
write_raw_image("path to boot.img", "boot");
An example of this commands use would be to flash a custom kernel, as far as I can tell though you need to place the boot.img in a temp file before the actual flash (clarification on this would be helpful). You would therefore use the following commands as part of your edify script:
Code:
package_extract_file("boot.img","/tmp/boot.img");
write_raw_image("/tmp/boot.img", "device-specific-boot-partition-mount-point");
delete("/tmp/boot.img");
It seems this may only be for specific handsets though e.g HTC, having looked through quite a few updater-script files from maguro zips it seems this can just be flashed directly with the following command:
Code:
package_extract_file("boot.img", "/dev/block/platform/omap/omap_hsmmc.0/by-name/boot");
Many thanks for further clarification on this particular command from efrant below:
I feel more comfortable using something like this:
Code:
package_extract_file("boot.img", "/tmp/boot.img");
run_program("/sbin/busybox", "dd", "if=/tmp/radio.img", "of=/dev/block/platform/omap/omap_hsmmc.0/by-name/boot");
delete("/tmp/boot.img")
The second line is using the "dd" command to flash the image.
The dd command (included in busybox) is:
Code:
dd if=xxx of=yyy
where xxx is the source image/partition and yyy is the target image/partition. So, for example, to flash a radio image stored in /sdcard called xxlf1.img to a GNex, it would be:
Code:
busybox dd if=/sdcard/xxlf1.img of=/dev/block/platform/omap/omap_hsmmc.0/by-name/radio (I've added "busybox" the the beginning, just to be explicit.)
So, to put it in edify format, it becomes:
Code:
run_program("/sbin/busybox", "dd", "if=/sdcard/xxlf1.img", "of=/dev/block/platform/omap/omap_hsmmc.0/by-name/radio");
However, as I said, I believe your one line:
Code:
package_extract_file("boot.img", "/dev/block/platform/omap/omap_hsmmc.0/by-name/boot");
would work.
Further Commands:
In progress...
So, this is by no means an exhaustive list and I would appreciate it that if I have made any mistakes people make me aware in this thread and I can update this tutorial.
I would also like to add further commands and their uses, if people can provide more I will add them too.
I hope this helps people out! Many thanks!
Thx for your work. Will try it when I back @ home.
Mfg Daniel
Gesendet von meinem Galaxy Nexus mit Tapatalk 2
very interesting 3ad.i'm learning right now how to make these,yours guide resolve me a lot of questions!thanks mate!+1
Awesome. Thank you!
Thanks for the feedback folks!
Top post updated with guides for:
Signing ZIP files
Creating private ZIP signing keys
I have updated the second post with edify commands:
Contents:
Post #1: Tutorials
Post #2: Edify Commands
I would like to expand and update this information to help both others and myself learn, if people can help with more commands or any corrections this would be much appreciated!
Thanx a lot . Ive been looking into editing apks and themeing and this answers a lot of my questions. Exactly what I've been looking for.
Sent from my Galaxy Nexus using XDA
graffitiwriter said:
Thanx a lot . Ive been looking into editing apks and themeing and this answers a lot of my questions. Exactly what I've been looking for.
Click to expand...
Click to collapse
Many thanks for the feedback.
Everything I know about Android has been learned from internet research and tutorials. So as far as I can I like to then re-share the things I have learned in way that I understand in the hope it will in turn help others!
wilskywalker said:
Many thanks for the feedback.
Everything I know about Android has been learned from internet research and tutorials. So as far as I can I like to then re-share the things I have learned in way that I understand in the hope it will in turn help others!
Click to expand...
Click to collapse
Me too. What I've been doing is opening other people's flashable .zips and making changes that I needed to make so I can flash what I wanted to flash. I have something that I want to change in a ROM I've been helping to work on, and your guide will help in the setup process.
dsmryder said:
Me too. What I've been doing is opening other people's flashable .zips and making changes that I needed to make so I can flash what I wanted to flash. I have something that I want to change in a ROM I've been helping to work on, and your guide will help in the setup process.
Click to expand...
Click to collapse
Glad my guide helped out buddy! This community has helped me to learn so much, it's nice to give something back.
I'm looking to create a script that deletes system apps/sounds I don't want upon updating CM9 (nightly). I've taken a script from a different device and modified, what I hope is, accordingly. I only edited the mounts to: ext4 /dev/block/platform/omap/omap_hsmmc.0/by-name /system and of course the apps I want to delete upon first boot. Edit removed the detailed path as per someone's advice.
Does this look like it will accomplish my objective?
Edit: Annnnnnnd it doesn't.
Code:
#!/system/bin/sh
#mount system rw
mount -o remount, rw -t /system
#apps to delete
#send installed apps to /data/packages
pm list packages -f > /data/packages
for i in HoloSpiralWallpaper LiveWallpapers LiveWallpapersPicker MagicSmokeWallpapers Music PhaseBeam RomManager VisualizationWallpapers
do
if [ -e /system/app/$i.apk ]
then
rm -f /system/app/$i.apk
grep $i.apk /data/packages > /data/pname
pname2=$(sed 's/\(.*=\)\(.*\)/\2/' /data/pname)
pm uninstall $pname2
fi
done
rm -f /data/packages
rm -f /data/pname
#delete camera_click sound
if [ -e /system/media/audio/ui/camera_click.ogg ]
then
rm -f /system/media/audio/ui/camera_click.ogg
fi
#delete camera_focus sound
if [ -e /system/media/audio/ui/camera_focus.ogg ]
then
rm -f /system/media/audio/ui/camera_focus.ogg
fi
#mount system ro
mount -o remount,ro -t /system
Source: http://forum.xda-developers.com/showthread.php?t=1050288
CMNein said:
I'm looking to create a script that deletes system apps/sounds I don't want upon updating CM9 (nightly). I've taken a script from a different device and modified, what I hope is, accordingly. I only edited the mounts to: ext4 /dev/block/platform/omap/omap_hsmmc.0/by-name /system and of course the apps I want to delete upon first boot. Edit removed the detailed path as per someone's advice.
Does this look like it will accomplish my objective?
Edit: Annnnnnnd it doesn't.
Code:
#!/system/bin/sh
#mount system rw
mount -o remount, rw -t /system
#apps to delete
#send installed apps to /data/packages
pm list packages -f > /data/packages
for i in HoloSpiralWallpaper LiveWallpapers LiveWallpapersPicker MagicSmokeWallpapers Music PhaseBeam RomManager VisualizationWallpapers
do
if [ -e /system/app/$i.apk ]
then
rm -f /system/app/$i.apk
grep $i.apk /data/packages > /data/pname
pname2=$(sed 's/\(.*=\)\(.*\)/\2/' /data/pname)
pm uninstall $pname2
fi
done
rm -f /data/packages
rm -f /data/pname
#delete camera_click sound
if [ -e /system/media/audio/ui/camera_click.ogg ]
then
rm -f /system/media/audio/ui/camera_click.ogg
fi
#delete camera_focus sound
if [ -e /system/media/audio/ui/camera_focus.ogg ]
then
rm -f /system/media/audio/ui/camera_focus.ogg
fi
#mount system ro
mount -o remount,ro -t /system
Source: http://forum.xda-developers.com/showthread.php?t=1050288
Click to expand...
Click to collapse
Hey buddy,
This looks like an init.d script to me, this is different to Edify. init.d scripts are placed in the /system/etc/init.d folder and performs actions when you boot the phone.
Your post has piqued my interest in init.d scripting though, might have to make it my next thing to learn!
wilskywalker said:
Hey buddy,
This looks like an init.d script to me, this is different to Edify. init.d scripts are placed in the /system/etc/init.d folder and performs actions when you boot the phone.
Your post has piqued my interest in init.d scripting though, might have to make it my next thing to learn!
Click to expand...
Click to collapse
Yes init.d, wasn't sure if you'd have insight or not, but glad to have piqued your interest
Sent from my Galaxy Nexus
CMNein said:
Yes init.d, wasn't sure if you'd have insight or not, but glad to have piqued your interest
Click to expand...
Click to collapse
Sorry I couldn't help more buddy.
Interest definitely piqued though...only problem is that I am currently trying to teach myself HTML5, C++ and Edify as well...lol!
Whenever I am working on a particular project I always get sidetracked and end up trying to learn a whole new language...the only reason I started investigating Edify was so I could flash bootanimations and that led to this tutorial!
Hi, I just recently set out to teach myself making flashable zips and this was one of the more helpful guides that I found. Especially helps that it's for my phone, which eliminates a good chunk of confusion, and that it's recent, since a lot of guides that I've found seem to be a bit outdated.
However, you don't say anything about setting permissions and that's the topic that I've had the most trouble finding clear documentation for. I see it included enough that I figure that it's good practice to cover any time you're pushing files with a flash, instead of just assuming that you can run fix permissions afterwards out of habit. Without a background working with linux permissions this was all a lot to absorb, and googling terms was frustratingly unhelpful, but hopefully this goes on to help someone else.
Syntax:
Code:
set_perm (UID, GID, MODE, "PATH");
set_perm_recursive(UID, GID, DIRMODE, FILEMODE, "PATH");
So, I think I get this, but the UID and GID aspects, and the leading digit of mode still leaves me feeling like I can do this right, but not fully understand why. Here's what I'm working with:
-UID and GID set the ownership of the file/directory. List of options in android found here:
http://android-dls.com/wiki/index.php?title=Android_UIDs_and_GIDs
I've only ever seen this specified as 0 (root access) or 1000 (system access) in examples I've opened to look at. I'm not sure I entirely understand when to use 1000, but it seems like a good rule of thumb that pushing anything to a dir that usually requires root to access, set to 0.
-MODE is summed up nicely here, and it seems like for the most part you want to use a leading 0, or omit it (leave settings as is).
-And then path is just the file or directory in question. Multiple paths can be specified in the same command if desired.
So in general, a zip that pushes a file to an existing directory should include a line in the installer-script that sets the right permissions. Android seems to keep things pretty simple, so chances are you can browse to the directory and just check the permissions for anything there and use them. For example, everything in /system/app is set to rw-r--r--, which is 644. So if you wanted to push a file to /system/app, you'd use this:
Code:
set_perm (0, 0, 0644, "/system/app/[filename]");
.
If you are pushing multiple files to /system/app, you could use this:
Code:
set_perm (0, 0, 0644 "/system/app/[filename1]", "system/app/[filename2]");
Edit: I'm not sure I see an easy way to use set_perm_recursive to just cover all bases unless you're dealing with a folder that you know has only one uniform permission setting across the board (such as /system/app or /data/app). But if you're pushing a bunch of system apps, for example, you could use this:
Code:
set_perm_recursive (0, 0, 0755, 0644 "/system/app");
and it should have the same effect on the /system/app folder as just running fix permissions in recovery would do.
If I have anything wrong here please let me know. Gonna go tinker with it and try to make a working zip now as a test.
JoeSyr said:
Hi, I just recently set out to teach myself making flashable zips and this was one of the more helpful guides that I found. Especially helps that it's for my phone, which eliminates a good chunk of confusion, and that it's recent, since a lot of guides that I've found seem to be a bit outdated.
However, you don't say anything about setting permissions and that's the topic that I've had the most trouble finding clear documentation for...
...If I have anything wrong here please let me know. Gonna go tinker with it and try to make a working zip now as a test.
Click to expand...
Click to collapse
Ahh, permissions, this is my next set of commands in post #2. I really don't understand the whole permissions thing currently, so was having trouble writing it in simple terms for all to understand...if that makes sense!?
If you are happy, I would like to include your findings in the second post with all the commands (I may re-word/re-order etc for clarity as we learn more) I will of course credit you for all your help!?
I am literally trying to learn about setting permissions currently as well so its great to collaborate, this was what I was hoping for when I started this tutorial.
Ok, I have been researching Android file permissions and commands all afternoon, there really is not much documentation to be found.
I have found the info I think I need to add this to my tutorial, just need to make sense of it myself first and put it in some sort of understandable order!
Big update coming soon...
wilskywalker said:
Ahh, permissions, this is my next set of commands in post #2. I really don't understand the whole permissions thing currently, so was having trouble writing it in simple terms for all to understand...if that makes sense!?
If you are happy, I would like to include your findings in the second post with all the commands (I may re-word/re-order etc for clarity as we learn more) I will of course credit you for all your help!?
I am literally trying to learn about setting permissions currently as well so its great to collaborate, this was what I was hoping for when I started this tutorial.
Click to expand...
Click to collapse
Yes by all means feel copy and/or adapt anything I've written, and if I give the impression that I know what I'm talking about I'm happy to try and explain things as well.
I'll let you decide for yourself how much of an explanation you want to include in your guide, personally I'm going through and teaching myself a lot here, but I think I've just about figured out what you *need to know* to use the set_perm function in edify. You basically need one tool and the ability to do basic math in your head:
-Use Root Explorer to find the UID, GID, and permissions for a file. Permissions are the string that looks like some variation on 'rwxr-xr--' next to each file. Long press and choose "change owner" to get the UID and GID. You just want the number next to "owner" and "group", respectively.
-If you're replacing a file, look up these settings for the existing copy and use them. If you're adding a file, just find a file that does the same functions and copy what it has (for example, installing an app to /system/app? Just look at these settings for any other app in that directory).
-The permission string is a nine-character string. It is rwx repeated three times, each of which stands for one number. Within each rwx block, read r as 4, w as 2, and x as 1. A dash indicates 0 instead of whichever number. So, learn to read rwxrwxrwx as (4+2+1)|(4+2+1)|(4+2+1)=777; rwxr-xr-- is (4+2+1)|(4+0+1)|(4+0+0)=754, etc. This is what you enter for MODE, with one additional note:
-MODE is technically a 4-bit string, but the first bit is special and can be omitted. I've looked around, and have yet to find a single file on my phone that has anything set for the first bit. For good practice, I think it's safe to assume you can always use a leading 0 unless you know otherwise for something specific. Or, just use a 3-digit MODE, which says to leave those settings as they are (disabled by default). (I.e. 0644=644).
As another note, I personally use ES File Explorer w/ root access in my day-to-day tasks because I like the interface, but it will not give you UID or GID, or let you chance these settings.
For really understanding why this is all done this way, I think it helps to really get a grasp for why linux permissions work the way that they do (read this page) and how they are manipulated (this page). Then, consider that a lot of that is built on the assumption that there are multiple humans in the same environment, but android is built on the premise of one person and their phone. Security is largely reduced to limiting the abilities of apps (which all get their own user id, as though apps are a bunch of people signing into computers and trying to look at each others' files). Groups are pre-defined here, and the usual setup is that apps get to effectively request group permissions when installed, otherwise most things in userland don't get access to much other than writing and reading the sdcard.
Sort of makes you appreciate the work done to get phones rooted and turn them from a pallet of pre-defined actions set by OEMs into real computers.
wilskywalker said:
...
Format a partition:
To format a partition you need to use the following syntax:
Code:
format("filesystem-type", "partition-type", "device-specific-location", "0");
Example:
Code:
format("ext4", "EMMC", "/dev/block/platform/omap/omap_hsmmc.0/by-name/system", "0");
Some scripts include the "0" and some do not, not sure exactly on the function difference when included or not, again clarification would be great.
...
Click to expand...
Click to collapse
How to format boot? There is no that menu in CWM and TWRP

CWM 6.0.4.8 Advanced Edition / PhilZ Touch Recovery 6.40.1

CWM 6.0.4.8 Advanced Edition / PhilZ Touch Recovery 6.40.1
Main thread + Features + Dev support
http://forum.xda-developers.com/showthread.php?t=2201860
CWM 6.0.4.8 Advanced Edition / PhilZ Touch Recovery 6.40.1​
PhilZ Recovery is a CWM Advanced Edition that adds all the features you could ever miss in CWM.
It is a well proven recovery for many phones.
Please give your feedback, what works, and any bug you could encounter.
Read the features at the Main thread, and check if you are missing something.
To take a screen shot, just slide left!
And don't forget to read about powerful aroma file manager integration and double-tap shortcut (in FAQs).
How to install recovery?
From download link below, you'll get a 'recovery.img' file. Put that recovery.img file at root directory of your
sdcard. (means not in any folder)
Now, go to terminal emulator.
Give command:
Code:
su
You'll be asked to grant superuser permissions, grant it.
Now, give the following command:
Code:
flash_image recoveryonly /sdcard/recovery.img
Wait until it executes the command (4-5 seconds), it is installing the recovery.
Now, normally reboot to recovery and enjoy new recovery!
Download links
Latest version can be found here:
recovery.img (v6.40.1)
https://docs.google.com/uc?id=0B5c3gpyMBJusMUNiblRSSWg1UlU&export=download
aromafm_gio.zip (v1.91)
https://docs.google.com/uc?id=0B5c3gpyMBJusVjFrcWVtZlZRVG8&export=download
Click to expand...
Click to collapse
Special thanks to:
@Phil3759 : For this awesome open source recovery.
@chraso: For hosting and compatible flags.
AndroidARMv6 Team: For keeping this device alive.
Cyanogenmod Team: For making all these possible.
XDA:DevDB Information
PhilZ Touch Recovery for Galaxy Gio, Tool/Utility for the Samsung Galaxy Gio GT-S5660
Contributors
Bhargav97, chraso, Phil3759
Version Information
Status: Stable
Current Stable Version: 6.40.1
Stable Release Date: 2014-05-04
Created 2014-05-07
Last Updated 2014-05-07
:FAQs:​
Q: Wanna know about Aroma File manager?
Visit the aroma file manager main thread for more info---> Aroma file manager main thread
Aroma file manager is a touch file manager which can be used while in recovery. It has options for copy, paste, delete,
change permissions and many others. Also, it has a Terminal inside. So, if you forgot to give correct permissions to any
file you can do that directly from recovery. This file manager has got many themes, font, icons, etc. options and it's UI
is fully customizable.
Q: How to start this File manager in Recovery?
Rename the downloaded file to 'aromafm.zip'.
Create a folder 'aromafm' inside 'Clockworkmod' folder on your sdcard.
Now, move that 'aromafm.zip' file to the 'aromafm' folder.
We're ready now, when you want to use it in recovery just double tap anywhere OR go to "philz Settings" and select
"Aroma File Manager" and it will start up.
If you also want to browse /data, /system and /sd-ext then mount them in the "mounts & storage" option in recovery.
Q: Problems with Aroma file manager startup?
After doble-tapping OR selecting 'Aroma file Manager' option under 'philz settings' if recovery gives error: 'aromafm.zip
not found at /clockworkmod/aromafm' then, wait for 4-5 seconds and again select 'Aroma file Manager', because it maybe
busy mounting sdcard.
If still doesn't work, you've made mistakes in steps mentioned in first post, please do again carefully.
Q: Does your phone every time reboots to recovery?
This happens very rare when you flash the recovery using any bad app or via any wrong (not proper) method. What you can do
is:
-If you've made a backup of your current ROM then just restore only it's "boot" and then select 'reboot to system'.
OR
-You don't have a backup? Then just flash the ROM which you are using currently again and wipe 'dalvik-cache'. Then reboot
to system. Booting process will take time.
NEW: Now you can enjoy the full version of the recovery! Thanks to @Phil3759 for uploading necessary
commits for armv6. And, everything is expected to be bug-free. Please report the bug here if you find any.
SCREENSHOTS:
Main menu and PhilZ Settings
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
GUI Preferences: all is applied live (no reboot). Up to 14 menu height settings, scroll sensitivity, touch accuracy...
27 color settings + 5 alpha transparency levels for every GUI element
Change background image with a custom png (of your device resolution), a solid color (27 presets) or revert to original cwm image
User configurable touch gestures (feel free to request for new actions)
Setup your time-zone + 30mn offset, super wipe option to install a new ROM
Backup and Restore any partition in a complete freedom, include modem (.img + .bin) and efs (.img + .tar)
Custom backups can also be restored by original CWM Advanced Restore Menu
TWRP Backup and Restore Support + md5 + single/multivolume format
Support multi-cpu compression, md5 check toggle and custom .android_secure path
Choose ors backup volume target
Flash multiple zip files in a raw
Aroma File Manager + Terminal Emulator: launch with a gesture action (double tap is default)
Full Wipe to Install a new ROM (sdcard is preserved)
Free Browse Mode to install zip files: select a default folder to start with and browse up to the root
Bhargav97 said:
#Reserved
Testers needed. I need someone to confirm that install/backup and other things work.
Left/right swipe won't work now.
Click to expand...
Click to collapse
Installed. Launched just fine. The navigation seems to be confusing: touching the screen moves the cursor one step up and when I swipe up - it's ok, but swiping down moves the cursor first up and only then down.
Backing up complete with no errors
Now restoring. So far so good
What else would you like me to test?
P.S. restored ok. I managed to launch Aroma FM(through install zip option), worked quite well. Flashed a zip(Fly On Mod) - ok.
I had trouble rebooting to system - it will always reboot to recovery. So now I flashed the simple 6.0.4.7 recovery back. The system booted up successfully, no errors occured.
You're offline, so I'm gonna have some sleep too.
My wish came true
It can't reboot into System after going into recovery...
Okay....
Now, please do these things and report back.
-Wipe data/factory reset. (Not 'Clean to install a new ROM')
-Install any ROM.
-Now, reboot to system.
If it still goes to recovery...
I just wanna know...is Jenkins recoveries working fine for you? (I'm talking about new ones and not 2 months older)
EDIT:
I need some info about your recovery and boot partition. In what blocks are they located?
According to me:
Boot: 'bml8'
Recovery: 'bml9'
Is it okay or wrong?
Bhargav97 said:
Okay....
Now, please do these things and report back.
-Wipe data/factory reset. (Not 'Clean to install a new ROM')
-Install any ROM.
-Now, reboot to system.
If it still goes to recovery...
I just wanna know...is Jenkins recoveries working fine for you? (I'm talking about new ones and not 2 months older)
Click to expand...
Click to collapse
I wiped data, installed a ROM and still goes back to recovery. Even power off and then on brings me to the recovery
Bhargav97 said:
EDIT:
I need some info about your recovery and boot partition. In what blocks are they located?
According to me:
Boot: 'bml8'
Recovery: 'bml9'
Is it okay or wrong?
Click to expand...
Click to collapse
I wish I could help, but don't even know what you're talking about :silly: Where should I look for that info?
I may get that info myself from sources but I'm busy right now. So, any of your device developers can tell me then it would be nice.
belyava said:
I wish I could help, but don't even know what you're talking about :silly: Where should I look for that info?
Click to expand...
Click to collapse
You can give a command in Terminal emulator:
Code:
mount
Paste here the output in code tags or at pastebin.
Bhargav97 said:
You can give a command in Terminal emulator:
Code:
mount
Paste here the output in code tags or at pastebin.
Click to expand...
Click to collapse
here we go ))
Code:
[email protected]:/ $ su
yonly /sdcard/recovery.img <
[email protected]:/ #
[email protected]:/ # mount
rootfs / rootfs ro,relatime 0 0
tmpfs /dev tmpfs rw,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
none /sys/fs/cgroup tmpfs rw,relatime,mode=750,gid=1000 0 0
none /sys/fs/cgroup/memory cgroup rw,relatime,memory 0 0
/sys/kernel/debug /sys/kernel/debug debugfs rw,relatime 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
/dev/block/dm-0 /mnt/asec/com.keramidas.TitaniumBackup-1 ext4 ro,dirsync,nosuid,nodev,noatime,barrier=1,data=writeback 0 0
/dev/block/dm-1 /mnt/asec/com.alensw.PicFolder-1 ext4 ro,dirsync,nosuid,nodev,noatime,barrier=1,data=writeback 0 0
/dev/block/dm-2 /mnt/asec/org.adaway-1 ext4 ro,dirsync,nosuid,nodev,noatime,barrier=1,data=writeback 0 0
/dev/block/dm-3 /mnt/asec/com.buak.Link2SD-1 ext4 ro,dirsync,nosuid,nodev,noatime,barrier=1,data=writeback 0 0
tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/fuse tmpfs rw,relatime,mode=775,gid=1000 0 0
/dev/block/stl12 /system ext4 ro,relatime,barrier=1,data=ordered 0 0
/dev/block/stl13 /data ext4 rw,nosuid,nodev,relatime,barrier=1,data=ordered 0 0
/dev/block/mmcblk0p2 /data/sdext2 ext4 rw,relatime,barrier=1,data=ordered 0 0
/dev/block/stl14 /cache ext4 rw,nosuid,nodev,relatime,barrier=1,data=ordered 0 0
/dev/block/vold/179:1 /mnt/media_rw/sdcard0 vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:1 /mnt/secure/asec vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/fuse /storage/sdcard0 fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
[email protected]:/ #
Hop it helps )))
As expected, it doesn't have boot and recovery locations.
I'll search in sources or if anyone could tell me it would be nice.
Sent from my GT-I9500 using Tapatalk
belyava said:
Hop it helps )))
Click to expand...
Click to collapse
You can install this app from playstore:
https://play.google.com/store/apps/details?id=com.cls.partition
If there's something related to recovery or boot, just post a screenshot.
EDIT:
He I missed the easiest one:
In terminal emulator, type:
Code:
cat /proc/partitions
And paste the output here.
Bhargav97 said:
You can install this app from playstore:
https://play.google.com/store/apps/details?id=com.cls.partition
If there's something related to recovery or boot, just post a screenshot.
EDIT:
He I missed the easiest one:
In terminal emulator, type:
Code:
cat /proc/partitions
And paste the output here.
Click to expand...
Click to collapse
Code:
[email protected]:/ $ cat /proc/partitions
major minor #blocks name
7 0 8348 loop0
7 1 2111 loop1
7 2 3150 loop2
7 3 5229 loop3
253 0 49152 zram0
179 0 7830528 mmcblk0
179 1 7330078 mmcblk0p1
179 2 489982 mmcblk0p2
137 0 513024 bml0/c
137 1 1536 bml1
137 2 512 bml2
137 3 768 bml3
137 4 25600 bml4
137 5 9216 bml5
137 6 5120 bml6
137 7 2048 bml7
137 8 8192 bml8
137 9 8192 bml9
137 10 768 bml10
137 11 6144 bml11
137 12 222464 bml12
137 13 192768 bml13
137 14 29696 bml14
138 12 214784 stl12
138 13 185600 stl13
138 14 25856 stl14
254 0 8347 dm-0
254 1 2110 dm-1
254 2 3150 dm-2
254 3 5229 dm-3
[email protected]:/ $
Upd:I forgot to install the PhilZ recovery, does it matter? Should redo?
belyava said:
Upd:I forgot to install the PhilZ recovery, does it matter? Should redo?
Click to expand...
Click to collapse
No need.
I confirmed from sources. Everything is fine.
Now, there's only one way left:
-Install my recovery, and reboot to recovery.
-Install any ROM (no need for data-wipe) and then without rebooting anywhere, connect your phone to PC.
-Start ADB.
-Give this command:
Code:
adb pull /tmp/recovery.log
-Now, you'll get a file: "recovery.log" in your pc where adb is located.
Paste the contents inside this file at pastebin.com or just attach here after renaming to "recovery.log.txt"(because .log format is not supported in attachments, I think).
Bhargav97 said:
No need.
Now, you'll get a file: "recovery.log" in your pc where adb is located.
Paste the contents inside this file at pastebin.com or just attach here after renaming to "recovery.log.txt"(because .log format is not supported in attachments, I think).
Click to expand...
Click to collapse
here you are)
@Bhargav97, any progress? Sorry for ETA
Yes, I found the error hopefully. I'll be compiling today/tomorrow. My repo is messed up due to an other ongoing project.
Bhargav97 said:
Yes, I found the error hopefully. I'll be compiling today/tomorrow. My repo is messed up due to an other ongoing project.
Click to expand...
Click to collapse
Thanks) Waiting to test)))
UPDATE:
Changelog:
-Updated philZ sources to 6.23.8.
-Updated androidarmv6 sources. So, you'll be able to flash cm-ota without any Signature Verification error.
-Fixed kernel-defconfig of gio. Reboot to system bug is hopefully fixed.
Below is the recovery.img file, flash using Terminal Emulator method:
recovery.img
Testers needed. Please give me a brief report of what works and what not, especially for reboot to system function and cm-ota upgrades.
P.S. You guys are slow in testing than tass users. So, tass users have reported that reboot to system works and I hope that it should work for you also. Please test and give feedback. I'm adding it on first post because I'm damn sure it's all fixed.
Bhargav97 said:
UPDATE:
Changelog:
-Updated philZ sources to 6.23.8.
-Updated androidarmv6 sources. So, you'll be able to flash cm-ota without any Signature Verification error.
-Fixed kernel-defconfig of gio. Reboot to system bug is hopefully fixed.
Below is the recovery.img file, flash using Terminal Emulator method:
recovery.img
Testers needed. Please give me a brief report of what works and what not, especially for reboot to system function and cm-ota upgrades.
P.S. You guys are slow in testing than tass users. So, tass users have reported that reboot to system works and I hope that it should work for you also. Please test and give feedback. I'm adding it on first post because I'm damn sure it's all fixed.
Click to expand...
Click to collapse
I ain't slow, just busy
I confirm it's working. Flashes, backs up amd reboots to system

Categories

Resources