<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5995047474497669237</id><updated>2024-08-29T05:49:29.700-07:00</updated><title type='text'>Tech Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blogdatech.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5995047474497669237/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://blogdatech.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5995047474497669237.post-2627368748977366931</id><published>2011-04-28T05:57:00.001-07:00</published><updated>2011-04-28T06:19:44.028-07:00</updated><title type='text'>How to extract system.img</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Extract NAND image files&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
To extract .img files, visit&amp;nbsp; &lt;a href=&quot;http://code.google.com/p/unyaffs/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://code.google.com/p/unyaffs/&lt;/a&gt;  I have compiled it under ubuntu 64 (attached). Unyaffs works on  system.img but on no other .img file&lt;br /&gt;
&lt;br /&gt;
To extract boot.img use attached extract-kernel.pl and  extract-ramdisk.pl&lt;br /&gt;
# extract-kernel.pl boot.img&lt;br /&gt;
# extract-ramdisk.pl boot.img&lt;br /&gt;
&lt;br /&gt;
Should work for recovery.img.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Rebuild system.img&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
You just need &quot;to loopback mount an image on your linux box and  format it with YAFFS&quot;. &lt;br /&gt;
&lt;br /&gt;
But it is useless as because Hero&#39;s SPL does not allow flashing  system.img directly. You should use an update.zip package for that.  (read below)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Rebuild boot.img&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
After extracting your boot.img using attached extract-*.pl and tweaking  it,  in same folder run:&lt;br /&gt;
# mkbootfs boot.img-ramdisk | gzip &amp;gt; ramdisk-boot&lt;br /&gt;
# mkbootimg --kernel boot.img-kernel --ramdisk ramdisk-boot --cmdline  &quot;no_console_suspend=1 console=null&quot;  -o newBoot.img --base 0x19200000&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Creating an update.zip package&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Creating an update.zip package is quite easy in fact. For example, to  add a (valid) test.apk package to your rom:&lt;br /&gt;
&lt;br /&gt;
- create an empty folder &amp;lt;workdir&amp;gt;&lt;br /&gt;
- create folder structure for test.apk (&amp;lt;workdir&amp;gt;/system/app) and  copy the test.apk&lt;br /&gt;
- create folder structure for update-script  (&amp;lt;workdir&amp;gt;/META-INF/com/google/android)&lt;br /&gt;
- edit &amp;lt;workdir&amp;gt;/META-INF/com/google/android/update-script&lt;br /&gt;
- put in it:&lt;br /&gt;
&lt;br /&gt;
- compress the &amp;lt;workdir&amp;gt; content to zip (not the  &amp;lt;workdir&amp;gt; folder itself)&lt;br /&gt;
&lt;br /&gt;
Now you are going to sign the zip file. Download attached testsign.zip  and copy it in your &amp;lt;SDK&amp;gt;/tools folder. Extract it here. It should  create a sign subfolder with a testsign.jar file in it.&lt;br /&gt;
&lt;br /&gt;
Then, from &amp;lt;workdir&amp;gt; folder, do:&lt;br /&gt;
&lt;br /&gt;
java -classpath &amp;lt;SDK&amp;gt;/tools/sign/testsign.jar&quot; testsign file.zip  file-signed.zip&lt;br /&gt;
&lt;br /&gt;
Ok, now your zip file is ready to be deployed using cyanogen recovery  image. &lt;br /&gt;
&lt;br /&gt;
To find more command to use in update-script, look at other&#39;s.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Modify .apk package&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Seems it is easy to uncompress an .apk  package (zip) an to modify files  in it and then compress it. But after all: you must sign it like  update.zip packages. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/b&gt; &lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Porting an other device&#39;s rom&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
- extract the system.img&lt;br /&gt;
- extract boot.img&lt;br /&gt;
- replace boot.img-kernel with the one from your stock Hero rom one.&lt;br /&gt;
- rebuild boot.img&lt;br /&gt;
- build update.zip package (look someone&#39;s hero custom rom to see how to  do it)&lt;br /&gt;
- sign and flash&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blogdatech.blogspot.com/feeds/2627368748977366931/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blogdatech.blogspot.com/2011/04/how-to-extract-systemimg.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5995047474497669237/posts/default/2627368748977366931'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5995047474497669237/posts/default/2627368748977366931'/><link rel='alternate' type='text/html' href='http://blogdatech.blogspot.com/2011/04/how-to-extract-systemimg.html' title='How to extract system.img'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>