installer: put toolkit version into toolkit installer lsm file
This change make users able to get the content of TOOLKIT_VERSION by
running `./install_factory_toolkit.run --lsm`, which is much faster and
easier than decompressing the whole archive.
BUG=chromium:711615
TEST=1. make toolkit BOARD=xxx
2. cd /path/to/factory/build/
3. ./install_factory_toolkit.run --lsm
4. ./install_factory_toolkit.run --noexec --target z
5. ./install_factory_toolkit.run -- --repack z \
--pack-into a.run
6. ./a.run --lsm
Change-Id: I293f2ce470d6d8b2bc923bfcb5e8dd32dce320db
Reviewed-on: https://chromium-review.googlesource.com/501667
Commit-Ready: Youcheng Syu <youcheng@google.com>
Tested-by: Youcheng Syu <youcheng@google.com>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Pi-Hsun Shih <pihsun@chromium.org>
diff --git a/py/toolkit/installer.py b/py/toolkit/installer.py
index 01ee4e3..1fbfa36 100755
--- a/py/toolkit/installer.py
+++ b/py/toolkit/installer.py
@@ -368,7 +368,8 @@
version_path = os.path.join(tmp_dir, VERSION_PATH)
os.makedirs(os.path.dirname(version_path))
file_utils.WriteFile(version_path, complete_version)
- Spawn([cmd[0], '--append', tmp_dir, output_path], check_call=True, log=True)
+ Spawn([cmd[0], '--lsm', version_path, '--append', tmp_dir, output_path],
+ check_call=True, log=True)
print ('\n'
' Factory toolkit generated at %s.\n'
'\n'