Fix Image size for Razor and RazorG by reduce Jounal size to zero

Bug: 21016403
Change-Id: Iaadd805dd5326b810e6dd83c1e509cab48995d9d
diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk
index 5f994cc..bfd9de3 100755
--- a/BoardConfigCommon.mk
+++ b/BoardConfigCommon.mk
@@ -82,6 +82,9 @@
 BOARD_RECOVERYIMAGE_PARTITION_SIZE := 23068672 # 22M
 BOARD_SYSTEMIMAGE_PARTITION_SIZE := 880803840 # 840M
 
+#Reduce space taken by the journal
+BOARD_SYSTEMIMAGE_JOURNAL_SIZE := 0
+
 BOARD_USERDATAIMAGE_PARTITION_SIZE := 12348030976 # 11.5G
 BOARD_FLASH_BLOCK_SIZE := 131072 # (BOARD_KERNEL_PAGESIZE * 64)
 
diff --git a/releasetools.py b/releasetools.py
index 6f485c1..b3e6471 100644
--- a/releasetools.py
+++ b/releasetools.py
@@ -42,6 +42,13 @@
         len(target_radio_img), common.sha1(target_radio_img).hexdigest()))
 
 
+def IncrementalOTA_InstallBegin(info):
+  # Reduce the space taken by the journal.
+  info.script.Unmount("/system")
+  info.script.TunePartition("/system", "-O", "^has_journal")
+  info.script.Mount("/system")
+
+
 def IncrementalOTA_InstallEnd(info):
   try:
     target_bootloader_img = info.target_zip.read("RADIO/bootloader.img")