OLD | NEW |
1 #!/usr/bin/python2.6 | 1 #!/usr/bin/python2.6 |
2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 2 # Copyright (c) 2010 The Chromium OS 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 """Program to run emerge in parallel, for significant speedup. | 6 """Program to run emerge in parallel, for significant speedup. |
7 | 7 |
8 Usage: | 8 Usage: |
9 ./parallel_emerge [--board=BOARD] [--workon=PKGS] [--no-workon-deps] | 9 ./parallel_emerge [--board=BOARD] [--workon=PKGS] [--no-workon-deps] |
10 [--force-remote-binary=PKGS] [emerge args] package | 10 [--force-remote-binary=PKGS] [emerge args] package |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 # Setup various environment variables based on our current board. These | 290 # Setup various environment variables based on our current board. These |
291 # variables are normally setup inside emerge-${BOARD}, but since we don't | 291 # variables are normally setup inside emerge-${BOARD}, but since we don't |
292 # call that script, we have to set it up here. These variables serve to | 292 # call that script, we have to set it up here. These variables serve to |
293 # point our tools at /build/BOARD and to setup cross compiles to the | 293 # point our tools at /build/BOARD and to setup cross compiles to the |
294 # appropriate board as configured in toolchain.conf. | 294 # appropriate board as configured in toolchain.conf. |
295 if self.board: | 295 if self.board: |
296 os.environ["PORTAGE_CONFIGROOT"] = "/build/" + self.board | 296 os.environ["PORTAGE_CONFIGROOT"] = "/build/" + self.board |
297 os.environ["PORTAGE_SYSROOT"] = "/build/" + self.board | 297 os.environ["PORTAGE_SYSROOT"] = "/build/" + self.board |
298 os.environ["SYSROOT"] = "/build/" + self.board | 298 os.environ["SYSROOT"] = "/build/" + self.board |
299 scripts_dir = os.path.dirname(os.path.realpath(__file__)) | 299 scripts_dir = os.path.dirname(os.path.realpath(__file__)) |
300 toolchain_path = "%s/../overlays/overlay-%s/toolchain.conf" | |
301 # Strip the variant out of the board name to look for the toolchain. This | 300 # Strip the variant out of the board name to look for the toolchain. This |
302 # is similar to what setup_board does. | 301 # is similar to what setup_board does. |
303 board_no_variant = self.board.split('_')[0] | 302 board_no_variant = self.board.split('_')[0] |
304 f = open(toolchain_path % (scripts_dir, board_no_variant)) | 303 public_toolchain_path = ("%s/../overlays/overlay-%s/toolchain.conf" % |
| 304 (scripts_dir, board_no_variant)) |
| 305 private_toolchain_path = ( |
| 306 "%s/../private-overlays/overlay-%s-private/toolchain.conf" % |
| 307 (scripts_dir, board_no_variant)) |
| 308 if os.path.isfile(public_toolchain_path): |
| 309 toolchain_path = public_toolchain_path |
| 310 elif os.path.isfile(private_toolchain_path): |
| 311 toolchain_path = private_toolchain_path |
| 312 else: |
| 313 print "Not able to locate toolchain.conf in board overlays" |
| 314 sys.exit(1) |
| 315 |
| 316 f = open(toolchain_path) |
305 os.environ["CHOST"] = f.readline().strip() | 317 os.environ["CHOST"] = f.readline().strip() |
306 f.close() | 318 f.close() |
307 | 319 |
308 # Although CHROMEOS_ROOT isn't specific to boards, it's normally setup | 320 # Although CHROMEOS_ROOT isn't specific to boards, it's normally setup |
309 # inside emerge-${BOARD}, so we set it up here for compatibility. It | 321 # inside emerge-${BOARD}, so we set it up here for compatibility. It |
310 # will be going away soon as we migrate to CROS_WORKON_SRCROOT. | 322 # will be going away soon as we migrate to CROS_WORKON_SRCROOT. |
311 os.environ.setdefault("CHROMEOS_ROOT", os.environ["HOME"] + "/trunk") | 323 os.environ.setdefault("CHROMEOS_ROOT", os.environ["HOME"] + "/trunk") |
312 | 324 |
313 # Turn off interactive delays | 325 # Turn off interactive delays |
314 os.environ["EBEEP_IGNORE"] = "1" | 326 os.environ["EBEEP_IGNORE"] = "1" |
(...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1835 # need to upgrade the rest of the packages. So we'll go ahead and do that. | 1847 # need to upgrade the rest of the packages. So we'll go ahead and do that. |
1836 if portage_upgrade: | 1848 if portage_upgrade: |
1837 args = sys.argv[1:] + ["--nomerge=sys-apps/portage"] | 1849 args = sys.argv[1:] + ["--nomerge=sys-apps/portage"] |
1838 os.execvp(os.path.realpath(sys.argv[0]), args) | 1850 os.execvp(os.path.realpath(sys.argv[0]), args) |
1839 | 1851 |
1840 print "Done" | 1852 print "Done" |
1841 sys.exit(0) | 1853 sys.exit(0) |
1842 | 1854 |
1843 if __name__ == "__main__": | 1855 if __name__ == "__main__": |
1844 main() | 1856 main() |
OLD | NEW |