Software Update:HowToManuallyGenerateMARFiles: Difference between revisions

No edit summary
 
 
(16 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== How To Manually Generate a MAR file ==
== How To Manually Generate a MAR file ==


Here are my notes for generating your own partial and complete mars for testing purposes.
Here are some notes for generating your own partial and complete mars for testing purposes.


'''Important Note:''' this is is not how the official mars are created, this is just how (as a developer), you can generate mars for testing software update.
'''Important Note:''' this is is not how the official mars are created, this is just how (as a developer), you can generate mars for testing software update.
Line 7: Line 7:
== Getting set up ==
== Getting set up ==


* scripts live in mozilla/tools/update-packaging
=== Tools ===
* will need mbsdiff.exe (source in mozilla/other-licenses/bsdiff) and mar.exe (source in mozilla/modules/libmar/tool) in your path
 
* get a mar to start with as your "source", for example http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/firefox-3.0a2pre.en-US.win32.complete.mar
* You need the following scripts live in <code>[http://mxr.mozilla.org/mozilla-release/source/tools/update-packaging/ mozilla/tools/update-packaging]</code>
** <code>[http://mxr.mozilla.org/mozilla-release/source/tools/update-packaging/common.sh?raw=1 common.sh]</code>
** <code>[http://mxr.mozilla.org/mozilla-release/source/tools/update-packaging/make_full_update.sh?raw=1 make_full_update.sh]</code>
** <code>[http://mxr.mozilla.org/mozilla-release/source/tools/update-packaging/make_incremental_update.sh?raw=1 make_incremental_update.sh]</code>
** <code>[http://mxr.mozilla.org/mozilla-release/source/tools/update-packaging/unwrap_full_update.pl?raw=1 unwrap_full_update.pl]</code>
* will need the <code>mbsdiff(.exe)</code> and <code>mar(.exe)</code> binaries in your path
** available in the [https://developer.mozilla.org/en/Gecko_SDK Gecko SDK], under the folder <code>/host/bin</code>
 
=== Source ===
 
Get a mar to start with as your "source", for example <code>[http://releases.mozilla.org/pub/mozilla.org/firefox/releases/10.0/update/win32/en-US/firefox-10.0.complete.mar firefox-10.0.complete.mar]</code>


== Unwrap the original mar ==
== Unwrap the original mar ==


* mkdir old && cd old && unwrap_full_update.sh firefox-3.0a2pre.en-US.win32.complete.mar
mkdir old
* mkdir new && cd new && unwrap_full_update.sh firefox-3.0a2pre.en-US.win32.complete.mar
cd old
perl ../unwrap_full_update.pl ../firefox-10.0.complete.mar
cd ..
cp -r old new


== Make Changes ===
== Make Changes ==


* make changes to the files in the "new" directory.
Make changes to the files in the "new" directory.


== Create the partial mar ==
== Create the partial mar ==


* ./make_incremental_update.sh partial.mar old new
./make_incremental_update.sh partial.mar old new
* for your update snippet, do:
 
* ls -al partial.mar | awk '{print $5}'
for your update snippet, do:
* md5sum partial.mar  | awk '{print $1}'
<pre>
<patch type="partial" URL="http://foo.bar.com/partial.mar" hashFunction="MD5" hashValue="5b2469c51c585eed802a1d9eb7e22f8c" size="785"/>
</pre>


== Create the partial mar ==
ls -al partial.mar | awk '{print $5}'
openssl dgst -sha512 partial.mar | awk '{print $2}'
 
<patch type="partial" URL="http://foo.bar.com/partial.mar" hashFunction="SHA512" hashValue="e06fbd6c2989f83594dbee9c92dc6724965d0f5c99ce28091ff1a3e5b894de7e8d64ac1a99840c7b9f59b5cdd7592f6f46bf5e1b3ecaef2cc0d364e025e4c8bb" size="785"/>
 
== Create the complete mar ==
 
./make_full_update.sh complete.mar new
 
for your update snippet, do:
 
ls -al complete.mar | awk '{print $5}'
openssl dgst -sha512 complete.mar | awk '{print $2}'
 
<patch type="complete" URL="http://foo.bar.com/complete.mar" hashFunction="SHA512" hashValue="b481cdb5a0e01aa8e5b419a455696650facebc269636591663e9d94bb0a300ad707f6626b98ae3bb738c0b75525e539b5659d933b4095cd913dfcf5f40dcad16" size="8258749"/>


* ./make_full_update.sh complete.mar new
== Update Snippets ==
* for your update snippet, do:
* ls -al complete.mar | awk '{print $5}'
* md5sum complete.mar | awk '{print $1}'


<pre>
For more on update snippets, see [[Software_Update:HowToTestMajorUpdateUI]]
<patch type="complete" URL="http://foo.bar.com/complete.mar" hashFunction="MD5" hashValue="8181bb3967aa4c04905e432d29aa5091" size="8258749"/>
</pre>

Latest revision as of 08:07, 10 February 2012

How To Manually Generate a MAR file

Here are some notes for generating your own partial and complete mars for testing purposes.

Important Note: this is is not how the official mars are created, this is just how (as a developer), you can generate mars for testing software update.

Getting set up

Tools

Source

Get a mar to start with as your "source", for example firefox-10.0.complete.mar

Unwrap the original mar

mkdir old
cd old
perl ../unwrap_full_update.pl ../firefox-10.0.complete.mar
cd ..
cp -r old new

Make Changes

Make changes to the files in the "new" directory.

Create the partial mar

./make_incremental_update.sh partial.mar old new

for your update snippet, do:

ls -al partial.mar | awk '{print $5}'
openssl dgst -sha512 partial.mar | awk '{print $2}'
<patch type="partial" URL="http://foo.bar.com/partial.mar" hashFunction="SHA512" hashValue="e06fbd6c2989f83594dbee9c92dc6724965d0f5c99ce28091ff1a3e5b894de7e8d64ac1a99840c7b9f59b5cdd7592f6f46bf5e1b3ecaef2cc0d364e025e4c8bb" size="785"/>

Create the complete mar

./make_full_update.sh complete.mar new

for your update snippet, do:

ls -al complete.mar | awk '{print $5}'
openssl dgst -sha512 complete.mar | awk '{print $2}'
<patch type="complete" URL="http://foo.bar.com/complete.mar" hashFunction="SHA512" hashValue="b481cdb5a0e01aa8e5b419a455696650facebc269636591663e9d94bb0a300ad707f6626b98ae3bb738c0b75525e539b5659d933b4095cd913dfcf5f40dcad16" size="8258749"/>

Update Snippets

For more on update snippets, see Software_Update:HowToTestMajorUpdateUI