| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 # Script to install ARM root image for cross building of ARM chrome on linux. | 6 """Script to install ARM root image for cross building of ARM chrome on linux. |
| 7 # This script can be run manually but is more often run as part of gclient | 7 This script can be run manually but is more often run as part of gclient |
| 8 # hooks. When run from hooks this script should be a no-op on non-linux | 8 hooks. When run from hooks this script should be a no-op on non-linux |
| 9 # platforms. | 9 platforms. |
| 10 | 10 |
| 11 # The sysroot image could be constructed from scratch based on the current | 11 The sysroot image could be constructed from scratch based on the current |
| 12 # state or precise/arm but for consistency we currently use a pre-built root | 12 state or precise/arm but for consistency we currently use a pre-built root |
| 13 # image which was originally designed for building trusted NaCl code. The image | 13 image which was originally designed for building trusted NaCl code. The image |
| 14 # will normally need to be rebuilt every time chrome's build dependancies are | 14 will normally need to be rebuilt every time chrome's build dependancies are |
| 15 # changed. | 15 changed. |
| 16 |
| 17 Steps to rebuild the arm sysroot image: |
| 18 |
| 19 - cd $SRC/native_client |
| 20 - ./tools/trusted_cross_toolchains/trusted-toolchain-creator.armel.precise.sh U
pdatePackageLists |
| 21 - ./tools/trusted_cross_toolchains/trusted-toolchain-creator.armel.precise.sh B
uildJail $SRC/out/arm-sysroot.tar.gz |
| 22 - gsutil cp -a public-read $SRC/out/arm-sysroot.tar.gz nativeclient-archive2/too
lchain/$NACL_REV/naclsdk_linux_arm-trusted.tgz |
| 23 """ |
| 16 | 24 |
| 17 import os | 25 import os |
| 18 import shutil | 26 import shutil |
| 19 import subprocess | 27 import subprocess |
| 20 import sys | 28 import sys |
| 21 | 29 |
| 22 | 30 |
| 23 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) | 31 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) |
| 24 URL_PREFIX = 'https://commondatastorage.googleapis.com' | 32 URL_PREFIX = 'https://commondatastorage.googleapis.com' |
| 25 URL_PATH = 'nativeclient-archive2/toolchain' | 33 URL_PATH = 'nativeclient-archive2/toolchain' |
| 26 REVISION = 10991 | 34 REVISION = 12203 |
| 27 TARBALL = 'naclsdk_linux_arm-trusted.tgz' | 35 TARBALL = 'naclsdk_linux_arm-trusted.tgz' |
| 28 | 36 |
| 29 | 37 |
| 30 def main(args): | 38 def main(args): |
| 31 if '--linux-only' in args: | 39 if '--linux-only' in args: |
| 32 # This argument is passed when run from the gclient hooks. | 40 # This argument is passed when run from the gclient hooks. |
| 33 # In this case we return early on non-linux platforms | 41 # In this case we return early on non-linux platforms |
| 34 # or if GYP_DEFINES doesn't include target_arch=arm | 42 # or if GYP_DEFINES doesn't include target_arch=arm |
| 35 if not sys.platform.startswith('linux'): | 43 if not sys.platform.startswith('linux'): |
| 36 return 0 | 44 return 0 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 58 subprocess.check_call(['tar', 'xf', tarball, '-C', sysroot]) | 66 subprocess.check_call(['tar', 'xf', tarball, '-C', sysroot]) |
| 59 os.remove(tarball) | 67 os.remove(tarball) |
| 60 | 68 |
| 61 with open(stamp, 'w') as s: | 69 with open(stamp, 'w') as s: |
| 62 s.write(url) | 70 s.write(url) |
| 63 return 0 | 71 return 0 |
| 64 | 72 |
| 65 | 73 |
| 66 if __name__ == '__main__': | 74 if __name__ == '__main__': |
| 67 sys.exit(main(sys.argv[1:])) | 75 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |