Modify the install-gaia target to generate a default webapps,json for b2g/

RESOLVED FIXED

Status

()

Core
General
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: vingtetun, Assigned: vingtetun)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

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...)
(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.
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...
Assignee: nobody → 21
Attachment #582849 - Flags: review?(mwu)

Comment 4

6 years ago
Is there no way to just autogenerate this if it isn't there?
(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

6 years ago
(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?
(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.
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.
Attachment #582849 - Attachment is obsolete: true
Attachment #582849 - Flags: review?(mwu)
Attachment #583470 - Flags: review?(mwu)
Comment on attachment 583470 [details] [diff] [review]
Patch v0.2

r=mwu from IRC
Attachment #583470 - Flags: review?(mwu) → review+
https://github.com/andreasgal/B2G/commit/e87959226824e3f2e16e26ab87ae7e931176e9a4
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.