Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Initial build support for incremental gecko (OTA) updates #54

Open
wants to merge 1 commit into from

3 participants

@marshall
Owner

This adds the new make target "gecko-update-incremental", which requires a MAR path to generate an incremental update from.

An example of running this to generate an incremental update:

# build update 1
$ VARIANT=user ./build.sh
$ VARIANT=user ./build.sh gecko-update-full
$ mv objdir-gecko/dist/b2g-update/b2g-gecko-update.mar /tmp/update1.mar

# .. make some change in gecko ..

$ VARIANT=user ./build.sh
$ VARIANT=user ./build.sh gecko-update-incremental GECKO_UPDATE_FROM_MAR=/tmp/update1.mar
$ ls -lh objdir-gecko/dist/b2g-update/b2g-gecko-update-incremental.mar

r? @mwu

@dhylands
Owner

@marshall mwu's github name is @michaelwu

@marshall
Owner

@dhylands my bad.. the pull request form doesn't have autocomplete like comments do.. :(

r? @michaelwu

@marshall
Owner

I've updated this to use the new tools in this pull request:

mozilla-b2g/B2G#170

@michaelwu
Owner

Hmm this is kinda bad. You're making parts that are controlled by repo depend on parts that are outside of repo control. That's not allowed - the B2G repo is only allowed to contain helpers. It's not allowed to be required to build. The update tools need to be pulled into a repo that is controlled by repo. gonk-misc is fine for this purpose.

@dhylands
Owner

That's a good distinction to be aware of :)

@marshall
Owner

@michaelwu ah.. I had been going back and forth between putting these in gonk-misc or B2G. I ended up in B2G because of the other python tools there (many of the update tools are separate from the build system, and use .config to find GECKO_OBJDIR for example.)

I could also move the update make targets into a new Android.mk inside tools..

@michaelwu
Owner

Android.mk has access to the gecko objdir path too.

I think adding a Android.mk to the tools dir still counts as making the repo controlled parts depend on non-repo controlled parts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 30 additions and 5 deletions.
  1. +30 −5 Android.mk
View
35 Android.mk
@@ -165,11 +165,10 @@ endif
cp $(GAIA_PATH)/build/settings.json $(TARGET_OUT)/b2g/defaults/settings.json
cd $(TARGET_OUT) && tar xvfz $(abspath $<)
-# Target to create Gecko update package (MAR)
DIST_B2G_UPDATE_DIR := $(GECKO_OBJDIR)/dist/b2g-update
UPDATE_PACKAGE_TARGET := $(DIST_B2G_UPDATE_DIR)/b2g-gecko-update.mar
-MAR := $(GECKO_OBJDIR)/dist/host/bin/mar
-MAKE_FULL_UPDATE := $(GECKO_PATH)/tools/update-packaging/make_full_update.sh
+UPDATE_INCREMENTAL_TARGET := $(DIST_B2G_UPDATE_DIR)/b2g-gecko-update-incremental.mar
+BUILD_GECKO_MAR := tools/update-tools/build-gecko-mar.py
# Floating point operations hardware support
ARCH_ARM_VFP := toolchain-default
@@ -183,12 +182,38 @@ ifeq ($(ARCH_ARM_HAVE_NEON), true)
ARCH_ARM_VFP := neon
endif
+# Targets for creating full and incremental Gecko update packages (MAR)
+
.PHONY: gecko-update-full
-gecko-update-full:
+gecko-update-full: $(UPDATE_PACKAGE_TARGET)
+
+$(UPDATE_PACKAGE_TARGET): $(TARGET_OUT)/b2g
mkdir -p $(DIST_B2G_UPDATE_DIR)
- MAR=$(MAR) $(MAKE_FULL_UPDATE) $(UPDATE_PACKAGE_TARGET) $(TARGET_OUT)/b2g
+ $(BUILD_GECKO_MAR) --dir=$(TARGET_OUT)/b2g $(UPDATE_PACKAGE_TARGET)
shasum -a 512 $(UPDATE_PACKAGE_TARGET)
+.PHONY: gecko-update-incremental
+
+ifeq ($(GECKO_UPDATE_TO_MAR),)
+GECKO_UPDATE_TO_MAR := $(UPDATE_PACKAGE_TARGET)
+endif
+
+GECKO_UPDATE_WORK_DIR := \
+ $(call intermediates-dir-for,PACKAGING,gecko_update_incremental)
+GECKO_UPDATE_FROM_DIR := $(GECKO_UPDATE_WORK_DIR)/update_from
+GECKO_UPDATE_TO_DIR := $(GECKO_UPDATE_WORK_DIR)/update_to
+
+gecko-update-incremental: $(GECKO_UPDATE_TO_MAR)
+ifeq ($(GECKO_UPDATE_FROM_MAR),)
+ $(error GECKO_UPDATE_FROM_MAR not provided)
+endif
+ @echo "Building incremental gecko update"
+ @echo "From MAR: $(GECKO_UPDATE_FROM_MAR)"
+ @echo "To MAR: $(GECKO_UPDATE_TO_MAR)"
+ $(BUILD_GECKO_MAR) --from=$(GECKO_UPDATE_FROM_MAR) \
+ --to=$(GECKO_UPDATE_TO_MAR) $(UPDATE_INCREMENTAL_TARGET)
+ shasum -a 512 $(UPDATE_INCREMENTAL_TARGET)
+
GECKO_MAKE_FLAGS ?= -j16
GECKO_LIB_DEPS := \
libm.so \
Something went wrong with that request. Please try again.