Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to make a firefox os rom package

540 views
Skip to first unread message

lap

unread,
Mar 19, 2013, 10:02:33 AM3/19/13
to dev...@lists.mozilla.org
Hey guys

hm..because i can't flash the system.img to my device,so i am thinking
about to make a rom package

so i want to ask what do i need to put in the rom package? Is it the
same to the android's rom?

Also, i want to know how can i unpack these "img" files etc.
system.img , usrdata.img, because i can't unpack these files by the
"unyaffs" or to mount it. can you guys give me some advices , i want
more details.

thank you:-)

lap

Alfredos (fredy) Damkalis

unread,
Mar 19, 2013, 11:12:06 AM3/19/13
to dev...@lists.mozilla.org
I will describe what have I done on samsung galaxy s2. Probably building
it the same way will give you a working rom package.

1. You have to gather to a folder these:
system directory from /out/target/product/<your device name>/
boot.img from /out/target/product/<your device name>/
META-INF extracted from a rom package for your device.

2. Go to the folder and zip the objects with the command |zip -r9 b2g.zip *
|This will create a b2g.zip file.

3. Download http://lazydroid.com/files/SignApk.zip and extract it.
This will give you a signapk.jar and some other files

4. Run this command |java -jar signapk.jar testkey.x509.pem testkey.pk8
b2g.zip ./signedB2G.zip|
where b2g.zip is the file that you have created and the rest are the
files that you have extracted.
This will give you a signedB2G.zip package that you can flash it for
example through CWM
More on signing roms can be found at
http://lazydroid.com/2011/03/howto-repack-and-sign-rom-image-update-zip-files/

5. After a successful flash procedure you will end up with a black
screen and you will have access with adb on your device. Then you have
to install Gaia:
git clone https://github.com/mozilla-b2g/gaia.git
cd gaia
make install-gaia (before this maybe you want to change the branch of
the gaia repository)

Disclaimer:
The above steps can brick your device, follow them at your own risk!!!

fredy
> _______________________________________________
> dev-b2g mailing list
> dev...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-b2g
>

Dave Hylands

unread,
Mar 19, 2013, 1:20:07 PM3/19/13
to Alfredos (fredy) Damkalis, dev...@lists.mozilla.org

> From: "Alfredos (fredy) Damkalis" <fr...@fredy.gr>
I just thought that I'd mention that some of these steps are already available in the form of the tools/update-tools/build-flash-fota.py script.
I don't know the full details, but I've used that script to create a FOTA based update (albeit the one I created only had /system/b2g files in it).
You should be able to create a full /system fota by using similar techniques.

> On 03/19/2013 04:02 PM, lap wrote:
> > Hey guys
> >
> > hm..because i can't flash the system.img to my device,so i am
> > thinking
> > about to make a rom package
> >
> > so i want to ask what do i need to put in the rom package? Is it
> > the
> > same to the android's rom?
> >
> > Also, i want to know how can i unpack these "img" files etc.
> > system.img , usrdata.img, because i can't unpack these files by
> > the
> > "unyaffs" or to mount it. can you guys give me some advices , i
> > want
> > more details.

The actual format of the system.img file may use yaffs or it may use ext4, or it may use something else. That's really phone specific.

We build the system.img by packing up all of the files in out/target/product/PHONE/system directory, so there really isn't a need to unpack it. out/target/product/PHONE/system already contains everything completely unpacked.

Dave Hylands

Julien Wajsberg

unread,
Mar 19, 2013, 1:22:50 PM3/19/13
to Dave Hylands, Alfredos (fredy) Damkalis, dev...@lists.mozilla.org
Le 19/03/2013 18:20, Dave Hylands a écrit :

> The actual format of the system.img file may use yaffs or it may use ext4, or it may use something else. That's really phone specific.
>
> We build the system.img by packing up all of the files in out/target/product/PHONE/system directory, so there really isn't a need to unpack it. out/target/product/PHONE/system already contains everything completely unpacked.
>
>


If for some reason you need to see what's inside one of our builds, you
first need to convert the image using Android SDK's simg2img utility.
And then you can just "mount -o loop" the resulting file :)

--
Julien

signature.asc

Dave Hylands

unread,
Mar 19, 2013, 1:35:08 PM3/19/13
to Julien Wajsberg, Alfredos (fredy) Damkalis, dev...@lists.mozilla.org
Hi Julien,
That works well when the underlying system.img file is ext4 based, but not so well when it's yaffs based.
Most desktop kernels don't have yaffs available, so you'd need to rebuild your kernel to add yaffs support.

You could probably put a yaffs based system.img on the sdcard and loop mount it using the actual device, since that kernel will have appropriate bits and pieces available.

Dave Hylands

César Martín Cristóbal

unread,
Mar 21, 2013, 7:26:24 AM3/21/13
to dev...@lists.mozilla.org
Thanks for the docs to make rom package.

I tested with this update-script:

assert(getprop("ro.product.device") == "tf300t" || getprop("ro.build.product") == "tf300t");
mount("ext4", "EMMC", "/dev/block/mmcblk0p1", "/system");
unmount("/system");
show_progress(0.500000, 0);
format("ext4", "EMMC", "/dev/block/mmcblk0p1", "0", "/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p1", "/system");
package_extract_dir("system", "/system");
set_perm_recursive(0, 0, 0755, 0644, "/system");
package_extract_file("boot.img", "/dev/block/mmcblk0p4");
show_progress(0.100000, 0);
unmount("/system");

but don't start, and I tested also with CM's file but nothing:

package_extract_file("boot.blob", "/dev/block/mmcblk0p4");

Any idea?

Un saludo!
----
César Martín Cristóbal
jil...@gmail.com

El 20/03/2013, a las 19:01, Guillermo López <willy...@mozilla-hispano.org> escribió:

> ---------- Mensaje reenviado ----------
> De: "Alfredos (fredy) Damkalis" <fr...@fredy.gr>
> Fecha: 19/03/2013 16:12
> Asunto: Re: [b2g] how to make a firefox os rom package
> Para: <dev...@lists.mozilla.org>
> Cc:
>
> I will describe what have I done on samsung galaxy s2. Probably building it the same way will give you a working rom package.
>
> 1. You have to gather to a folder these:
> system directory from /out/target/product/<your device name>/
> boot.img from /out/target/product/<your device name>/
> META-INF extracted from a rom package for your device.
>
> 2. Go to the folder and zip the objects with the command |zip -r9 b2g.zip *
> |This will create a b2g.zip file.
>
> 3. Download http://lazydroid.com/files/SignApk.zip and extract it.
> This will give you a signapk.jar and some other files
>
> 4. Run this command |java -jar signapk.jar testkey.x509.pem testkey.pk8 b2g.zip ./signedB2G.zip|
> where b2g.zip is the file that you have created and the rest are the files that you have extracted.
> This will give you a signedB2G.zip package that you can flash it for example through CWM
> More on signing roms can be found at http://lazydroid.com/2011/03/howto-repack-and-sign-rom-image-update-zip-files/
>
> 5. After a successful flash procedure you will end up with a black screen and you will have access with adb on your device. Then you have to install Gaia:
> git clone https://github.com/mozilla-b2g/gaia.git
> cd gaia
> make install-gaia (before this maybe you want to change the branch of the gaia repository)
>
> Disclaimer:
> The above steps can brick your device, follow them at your own risk!!!
>
> fredy
>
> On 03/19/2013 04:02 PM, lap wrote:
> Hey guys
>
> hm..because i can't flash the system.img to my device,so i am thinking about to make a rom package
>
> so i want to ask what do i need to put in the rom package? Is it the same to the android's rom?
>
> Also, i want to know how can i unpack these "img" files etc. system.img , usrdata.img, because i can't unpack these files by the "unyaffs" or to mount it. can you guys give me some advices , i want more details.
>

jacob...@gmail.com

unread,
Jan 23, 2014, 8:39:06 PM1/23/14
to
I know this is old, but why can't you include gaia in the ROM zip?

Alexandre Lissy

unread,
Jan 24, 2014, 6:58:00 AM1/24/14
to dev...@lists.mozilla.org
You can and on master we now have make targets that are able to produce
FOTA packages that does the job: gecko-update-fota and
gecko-update-fota-full

pazi...@gmail.com

unread,
Jan 25, 2014, 2:46:51 PM1/25/14
to
IMO the best way to create a zip update is from a running system, pulling /system with the aid of adb and using your vendor "update.script" as a base for your modifications.

If you want to test custom builds you'll need fastboot enabled, then you can flash your build and see if it works, after that you can create a zip just modifying your base system installation

Example: I've built an update.zip for ZTE Open, based on version 1.1.0B02(or B06), I used those blobs as part of the build proccess, then I delete some parts of the updater script (like reflashing stock recovery) and replace /system with my own pulled /system

You can see the difference:

go to ztedevices.com and download ZTE_OPEN_EU 1.1.0B02; then check my custom build at http://ul.to/2jwkruhj . Don't worry, Isn't technical at all. Differences are obvious.

nghirat...@gmail.com

unread,
Jan 26, 2014, 12:31:41 AM1/26/14
to
Hi pazos,

the /system you used is the /system in backup-inari folder or out/target/product/inari folder?
0 new messages