blob: db26fa4e6f30a76addc24861897e3ae12cabdb5e [file] [log] [blame]
Cindy Linc06b4ea2022-01-27 18:13:04 +00001# Copyright 2022 The Chromium OS Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5"""build_packages updates the set of binary packages needed by Chrome OS.
6
7The build_packages process cross compiles all packages that have been
8updated into the given sysroot and builds binary packages as a side-effect.
9The output packages will be used by the build_image script to create a
10bootable Chrome OS image.
11"""
12
13import os
14
Alex Kleina39dc982022-02-03 12:13:14 -070015from chromite.lib import commandline
Cindy Linc06b4ea2022-01-27 18:13:04 +000016from chromite.lib import constants
17from chromite.lib import cros_build_lib
18
19
20def main(argv):
Alex Kleina39dc982022-02-03 12:13:14 -070021 commandline.RunInsideChroot()
22
Cindy Linc06b4ea2022-01-27 18:13:04 +000023 cmd = [
24 'bash',
25 os.path.join(constants.CROSUTILS_DIR, 'build_packages.sh'),
26 '--script-is-run-only-by-chromite-and-not-users'
27 ]
28 cmd.extend(argv)
29 try:
30 cros_build_lib.run(cmd)
31 except cros_build_lib.RunCommandError as e:
32 cros_build_lib.Die(e)