Last Comment Bug 709015 - Modify the install-gaia target to generate a default webapps,json for b2g/
: Modify the install-gaia target to generate a default webapps,json for b2g/
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: General (show other bugs)
: unspecified
: x86_64 Linux
: -- normal (vote)
: ---
Assigned To: Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-09 04:20 PST by Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please)
Modified: 2011-12-28 02:03 PST (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
B2G patch (924 bytes, patch)
2011-12-19 09:12 PST, Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please)
no flags Details | Diff | Splinter Review
Patch v0.2 (1.12 KB, patch)
2011-12-21 05:57 PST, Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please)
21: review+
Details | Diff | Splinter Review

Description Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please) 2011-12-09 04:20:45 PST

    
Comment 1 Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please) 2011-12-09 04:24:18 PST
The install-gaia target in B2G needs to build a webapps.json for the default profile.

Also in order to support one domain name per application and until we have a working application cache installed by default we need to add some hostname to /etc/hosts per application (homescreen.gaia.org, browser.gaia.org, etc...)
Comment 2 Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please) 2011-12-19 09:09:01 PST
(In reply to Vivien Nicolas (:vingtetun) from comment #1)

> Also in order to support one domain name per application and until we have a
> working application cache installed by default we need to add some hostname
> to /etc/hosts per application (homescreen.gaia.org, browser.gaia.org, etc...)

At the moment we don't really need to add anything to the /etc/hosts file since using the webapps is disabled. I want to add them to the profile folder first and then active the usage into another bug once I will be sure everybody has this directory into his/her profile.
Comment 3 Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please) 2011-12-19 09:12:15 PST
Created attachment 582849 [details] [diff] [review]
B2G patch

The patch add the webapps/webapps.json and some subfolders to the b2g profile. It used the pre-existing profile or create a new one called b2g.default is there is none.

The webapps.json file come from Gaia.

The patch is untested on the device. I've burst mine and i need to find a way to repair it or to buy a new one...
Comment 4 Michael Wu [:mwu] 2011-12-19 12:47:21 PST
Is there no way to just autogenerate this if it isn't there?
Comment 5 Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please) 2011-12-20 06:55:24 PST
(In reply to Michael Wu [:mwu] from comment #4)
> Is there no way to just autogenerate this if it isn't there?

We could but IMO this is not the role of B2G to do that, but of Gaia.
If Gaia want to provide a specific webapps.json or a specific Offline Cache version that by choice.
Comment 6 Michael Wu [:mwu] 2011-12-20 08:25:19 PST
(In reply to Vivien Nicolas (:vingtetun) from comment #5)
> (In reply to Michael Wu [:mwu] from comment #4)
> > Is there no way to just autogenerate this if it isn't there?
> 
> We could but IMO this is not the role of B2G to do that, but of Gaia.
> If Gaia want to provide a specific webapps.json or a specific Offline Cache
> version that by choice.

So can we have gaia provide/install a default webapps.json if there isn't one available?
Comment 7 Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please) 2011-12-20 08:31:39 PST
(In reply to Michael Wu [:mwu] from comment #6)
> (In reply to Vivien Nicolas (:vingtetun) from comment #5)
> > (In reply to Michael Wu [:mwu] from comment #4)
> > > Is there no way to just autogenerate this if it isn't there?
> > 
> > We could but IMO this is not the role of B2G to do that, but of Gaia.
> > If Gaia want to provide a specific webapps.json or a specific Offline Cache
> > version that by choice.
> 
> So can we have gaia provide/install a default webapps.json if there isn't
> one available?

I guess my english skills have failed again :/

The goal of this patch is to copy-paste the webapps/ folder provided by Gaia to /data/b2g/mozilla/xyz.default/webapps. The webapps folder contains the webapps.json file. If there is no webapps/ folder, then there is no need for a webapps.json file.
Comment 8 Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please) 2011-12-21 05:57:21 PST
Created attachment 583470 [details] [diff] [review]
Patch v0.2

Per IRC we need have a copy somewhere of the pre-installed apps in case something went wrong.

This version does 2 things:
- Create a copy of the Gaia's profile/ directory to /system/home/profile.
This is done in the gaia-hack target of the makefile to be run during build time.

- Change the install-gaia makefile to erase the webapps/ folder in the current profile for developing.

Next part of the plan is to create an xpcom component in b2g/components to restore the system if there is no webapps/ folder in the profile.

It will will do 2 things:
 - initialize the webapps dir at first-run. Later we can optimize to create that during the build time if we want better first-run perf.

 - restore a webapps/ folder if the profile has been deleted/altered.
Comment 9 Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please) 2011-12-27 10:47:30 PST
Comment on attachment 583470 [details] [diff] [review]
Patch v0.2

r=mwu from IRC
Comment 10 Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please) 2011-12-28 02:03:00 PST
https://github.com/andreasgal/B2G/commit/e87959226824e3f2e16e26ab87ae7e931176e9a4

Note You need to log in before you can comment on or make changes to this bug.