yunlian | 5acba6e | 2013-02-19 22:34:37 +0000 | [diff] [blame] | 1 | #!/usr/bin/python |
raymes | 5154d7f | 2013-02-15 04:35:37 +0000 | [diff] [blame] | 2 | # |
| 3 | # Copyright 2010 Google Inc. All Rights Reserved. |
raymes | 5154d7f | 2013-02-15 04:35:37 +0000 | [diff] [blame] | 4 | """Script to checkout the ChromeOS source. |
| 5 | |
| 6 | This script sets up the ChromeOS source in the given directory, matching a |
| 7 | particular release of ChromeOS. |
| 8 | """ |
| 9 | |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 10 | __author__ = ('asharif@google.com (Ahmad Sharif) ' |
| 11 | 'llozano@google.com (Luis Lozano) ' |
| 12 | 'raymes@google.com (Raymes Khoury) ' |
| 13 | 'shenhan@google.com (Han Shen)') |
raymes | 5154d7f | 2013-02-15 04:35:37 +0000 | [diff] [blame] | 14 | |
| 15 | import optparse |
| 16 | import os |
| 17 | import sys |
kbaclawski | 20082a0 | 2013-02-16 02:12:57 +0000 | [diff] [blame] | 18 | |
asharif | e3668f1 | 2013-02-15 04:46:29 +0000 | [diff] [blame] | 19 | import tc_enter_chroot |
raymes | 01959ae | 2013-02-15 04:50:07 +0000 | [diff] [blame] | 20 | from utils import command_executer |
| 21 | from utils import logger |
kbaclawski | 20082a0 | 2013-02-16 02:12:57 +0000 | [diff] [blame] | 22 | from utils import misc |
raymes | 5154d7f | 2013-02-15 04:35:37 +0000 | [diff] [blame] | 23 | |
asharif | e3668f1 | 2013-02-15 04:46:29 +0000 | [diff] [blame] | 24 | |
raymes | 5154d7f | 2013-02-15 04:35:37 +0000 | [diff] [blame] | 25 | def Usage(parser, message): |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 26 | print 'ERROR: ' + message |
raymes | 5154d7f | 2013-02-15 04:35:37 +0000 | [diff] [blame] | 27 | parser.print_help() |
| 28 | sys.exit(0) |
| 29 | |
asharif | e3668f1 | 2013-02-15 04:46:29 +0000 | [diff] [blame] | 30 | |
bjanakiraman | 6496e5f | 2013-02-15 04:50:58 +0000 | [diff] [blame] | 31 | def Main(argv): |
raymes | 5154d7f | 2013-02-15 04:35:37 +0000 | [diff] [blame] | 32 | """Build ChromeOS.""" |
| 33 | # Common initializations |
asharif | 5a9bb46 | 2013-02-15 04:50:57 +0000 | [diff] [blame] | 34 | cmd_executer = command_executer.GetCommandExecuter() |
raymes | 5154d7f | 2013-02-15 04:35:37 +0000 | [diff] [blame] | 35 | |
| 36 | parser = optparse.OptionParser() |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 37 | parser.add_option('--chromeos_root', |
| 38 | dest='chromeos_root', |
| 39 | help='Target directory for ChromeOS installation.') |
| 40 | parser.add_option('--clobber_chroot', |
| 41 | dest='clobber_chroot', |
| 42 | action='store_true', |
| 43 | help='Delete the chroot and start fresh', |
asharif | 80b47dc | 2013-02-15 06:31:19 +0000 | [diff] [blame] | 44 | default=False) |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 45 | parser.add_option('--clobber_board', |
| 46 | dest='clobber_board', |
| 47 | action='store_true', |
| 48 | help='Delete the board and start fresh', |
| 49 | default=False) |
| 50 | parser.add_option('--rebuild', |
| 51 | dest='rebuild', |
| 52 | action='store_true', |
| 53 | help='Rebuild all board packages except the toolchain.', |
| 54 | default=False) |
| 55 | parser.add_option('--cflags', |
| 56 | dest='cflags', |
| 57 | default='', |
| 58 | help='CFLAGS for the ChromeOS packages') |
| 59 | parser.add_option('--cxxflags', |
| 60 | dest='cxxflags', |
| 61 | default='', |
| 62 | help='CXXFLAGS for the ChromeOS packages') |
| 63 | parser.add_option('--ldflags', |
| 64 | dest='ldflags', |
| 65 | default='', |
| 66 | help='LDFLAGS for the ChromeOS packages') |
| 67 | parser.add_option('--board', |
| 68 | dest='board', |
| 69 | help='ChromeOS target board, e.g. x86-generic') |
| 70 | parser.add_option('--package', |
| 71 | dest='package', |
| 72 | help='The package needs to be built') |
| 73 | parser.add_option('--label', |
| 74 | dest='label', |
| 75 | help='Optional label symlink to point to build dir.') |
| 76 | parser.add_option('--dev', |
| 77 | dest='dev', |
| 78 | default=False, |
| 79 | action='store_true', |
| 80 | help=('Make the final image in dev mode (eg writable, ' |
| 81 | 'more space on image). Defaults to False.')) |
| 82 | parser.add_option('--debug', |
| 83 | dest='debug', |
| 84 | default=False, |
| 85 | action='store_true', |
shenhan | 4873858 | 2013-02-19 22:45:41 +0000 | [diff] [blame] | 86 | help=("Optional. Build chrome browser with \"-g -O0\". " |
| 87 | "Notice, this also turns on \'--dev\'. " |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 88 | 'Defaults to False.')) |
| 89 | parser.add_option('--env', |
| 90 | dest='env', |
| 91 | default='', |
| 92 | help='Env to pass to build_packages.') |
| 93 | parser.add_option('--vanilla', |
| 94 | dest='vanilla', |
asharif | b1752c8 | 2013-02-15 04:56:37 +0000 | [diff] [blame] | 95 | default=False, |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 96 | action='store_true', |
| 97 | help='Use default ChromeOS toolchain.') |
| 98 | parser.add_option('--vanilla_image', |
| 99 | dest='vanilla_image', |
Yunlian Jiang | d145a58 | 2013-08-19 13:59:34 -0700 | [diff] [blame] | 100 | default=False, |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 101 | action='store_true', |
| 102 | help=('Use prebuild packages for building the image. ' |
| 103 | 'It also implies the --vanilla option is set.')) |
raymes | 5154d7f | 2013-02-15 04:35:37 +0000 | [diff] [blame] | 104 | |
bjanakiraman | 6496e5f | 2013-02-15 04:50:58 +0000 | [diff] [blame] | 105 | options = parser.parse_args(argv[1:])[0] |
raymes | 5154d7f | 2013-02-15 04:35:37 +0000 | [diff] [blame] | 106 | |
| 107 | if options.chromeos_root is None: |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 108 | Usage(parser, '--chromeos_root must be set') |
Luis Lozano | 09b027f | 2015-03-30 13:29:49 -0700 | [diff] [blame] | 109 | options.chromeos_root = os.path.expanduser(options.chromeos_root) |
| 110 | scripts_dir = os.path.join(options.chromeos_root, 'src', 'scripts') |
| 111 | if not os.path.isdir(scripts_dir): |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 112 | Usage(parser, '--chromeos_root must be set up first. Use setup_chromeos.py') |
raymes | 5154d7f | 2013-02-15 04:35:37 +0000 | [diff] [blame] | 113 | |
raymes | 5154d7f | 2013-02-15 04:35:37 +0000 | [diff] [blame] | 114 | if options.board is None: |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 115 | Usage(parser, '--board must be set') |
raymes | 5154d7f | 2013-02-15 04:35:37 +0000 | [diff] [blame] | 116 | |
shenhan | 4873858 | 2013-02-19 22:45:41 +0000 | [diff] [blame] | 117 | if options.debug: |
| 118 | options.dev = True |
| 119 | |
asharif | 4447378 | 2013-02-19 19:58:15 +0000 | [diff] [blame] | 120 | build_packages_env = options.env |
shenhan | 4873858 | 2013-02-19 22:45:41 +0000 | [diff] [blame] | 121 | if build_packages_env.find('EXTRA_BOARD_FLAGS=') != -1: |
| 122 | logger.GetLogger().LogFatal( |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 123 | ('Passing "EXTRA_BOARD_FLAGS" in "--env" is not supported. ' |
| 124 | 'This flags is used internally by this script. ' |
| 125 | 'Contact the author for more detail.')) |
shenhan | 4873858 | 2013-02-19 22:45:41 +0000 | [diff] [blame] | 126 | |
asharif | 80b47dc | 2013-02-15 06:31:19 +0000 | [diff] [blame] | 127 | if options.rebuild == True: |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 128 | build_packages_env += ' EXTRA_BOARD_FLAGS=-e' |
llozano | 3a42892 | 2013-02-19 21:36:47 +0000 | [diff] [blame] | 129 | # EXTRA_BOARD_FLAGS=-e should clean up the object files for the chrome |
| 130 | # browser but it doesn't. So do it here. |
| 131 | misc.RemoveChromeBrowserObjectFiles(options.chromeos_root, options.board) |
asharif | 80b47dc | 2013-02-15 06:31:19 +0000 | [diff] [blame] | 132 | |
Luis Lozano | 09b027f | 2015-03-30 13:29:49 -0700 | [diff] [blame] | 133 | # Build with afdo_use by default. |
| 134 | # To change the default use --env="USE=-afdo_use". |
| 135 | build_packages_env = misc.MergeEnvStringWithDict( |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 136 | build_packages_env, {'USE': 'chrome_internal afdo_use'}) |
asharif | 01e29a5 | 2013-02-15 04:56:41 +0000 | [diff] [blame] | 137 | |
shenhan | 4873858 | 2013-02-19 22:45:41 +0000 | [diff] [blame] | 138 | build_packages_command = misc.GetBuildPackagesCommand( |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 139 | board=options.board, |
| 140 | usepkg=options.vanilla_image, |
| 141 | debug=options.debug) |
yunlian | 5acba6e | 2013-02-19 22:34:37 +0000 | [diff] [blame] | 142 | |
| 143 | if options.package: |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 144 | build_packages_command += ' {0}'.format(options.package) |
yunlian | 5acba6e | 2013-02-19 22:34:37 +0000 | [diff] [blame] | 145 | |
shenhan | 4873858 | 2013-02-19 22:45:41 +0000 | [diff] [blame] | 146 | build_image_command = misc.GetBuildImageCommand(options.board, options.dev) |
asharif | ca8c5ef | 2013-02-15 04:57:02 +0000 | [diff] [blame] | 147 | |
Yunlian Jiang | d145a58 | 2013-08-19 13:59:34 -0700 | [diff] [blame] | 148 | if options.vanilla or options.vanilla_image: |
kbaclawski | 20082a0 | 2013-02-16 02:12:57 +0000 | [diff] [blame] | 149 | command = misc.GetSetupBoardCommand(options.board, |
Yunlian Jiang | d145a58 | 2013-08-19 13:59:34 -0700 | [diff] [blame] | 150 | usepkg=options.vanilla_image, |
llozano | 3a42892 | 2013-02-19 21:36:47 +0000 | [diff] [blame] | 151 | force=options.clobber_board) |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 152 | command += '; ' + build_packages_env + ' ' + build_packages_command |
| 153 | command += '&& ' + build_packages_env + ' ' + build_image_command |
asharif | ca3c6c1 | 2013-02-15 23:17:54 +0000 | [diff] [blame] | 154 | ret = cmd_executer.ChrootRunCommand(options.chromeos_root, command) |
asharif | b1752c8 | 2013-02-15 04:56:37 +0000 | [diff] [blame] | 155 | return ret |
| 156 | |
raymes | 5154d7f | 2013-02-15 04:35:37 +0000 | [diff] [blame] | 157 | # Setup board |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 158 | if not os.path.isdir(options.chromeos_root + '/chroot/build/' + |
| 159 | options.board) or options.clobber_board: |
raymes | 04164a1 | 2013-02-15 04:36:03 +0000 | [diff] [blame] | 160 | # Run build_tc.py from binary package |
kbaclawski | 20082a0 | 2013-02-16 02:12:57 +0000 | [diff] [blame] | 161 | rootdir = misc.GetRoot(argv[0])[0] |
| 162 | version_number = misc.GetRoot(rootdir)[1] |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 163 | ret = cmd_executer.ChrootRunCommand(options.chromeos_root, |
| 164 | misc.GetSetupBoardCommand( |
| 165 | options.board, |
| 166 | force=options.clobber_board)) |
| 167 | logger.GetLogger().LogFatalIf(ret, 'setup_board failed') |
raymes | 5f35b92 | 2013-02-15 04:35:57 +0000 | [diff] [blame] | 168 | else: |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 169 | logger.GetLogger().LogOutput('Did not setup_board ' |
| 170 | 'because it already exists') |
raymes | bfb5799 | 2013-02-15 04:35:45 +0000 | [diff] [blame] | 171 | |
shenhan | 4873858 | 2013-02-19 22:45:41 +0000 | [diff] [blame] | 172 | if options.debug: |
| 173 | # Perform 2-step build_packages to build a debug chrome browser. |
| 174 | |
| 175 | # Firstly, build everything that chromeos-chrome depends on normally. |
| 176 | if options.rebuild == True: |
| 177 | # Give warning about "--rebuild" and "--debug". Under this combination, |
| 178 | # only dependencies of "chromeos-chrome" get rebuilt. |
| 179 | logger.GetLogger().LogWarning( |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 180 | "\"--rebuild\" does not correctly re-build every package when " |
| 181 | "\"--debug\" is enabled. ") |
shenhan | 4873858 | 2013-02-19 22:45:41 +0000 | [diff] [blame] | 182 | |
| 183 | # Replace EXTRA_BOARD_FLAGS=-e with "-e --onlydeps" |
| 184 | build_packages_env = build_packages_env.replace( |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 185 | 'EXTRA_BOARD_FLAGS=-e', 'EXTRA_BOARD_FLAGS=\"-e --onlydeps\"') |
shenhan | 4873858 | 2013-02-19 22:45:41 +0000 | [diff] [blame] | 186 | else: |
| 187 | build_packages_env += ' EXTRA_BOARD_FLAGS=--onlydeps' |
| 188 | |
| 189 | ret = cmd_executer.ChrootRunCommand( |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 190 | options.chromeos_root, "CFLAGS=\"$(portageq-%s envvar CFLAGS) %s\" " |
| 191 | "CXXFLAGS=\"$(portageq-%s envvar CXXFLAGS) %s\" " |
| 192 | "LDFLAGS=\"$(portageq-%s envvar LDFLAGS) %s\" " |
| 193 | 'CHROME_ORIGIN=SERVER_SOURCE ' |
| 194 | '%s ' |
| 195 | '%s --skip_chroot_upgrade' |
| 196 | 'chromeos-chrome' % (options.board, options.cflags, options.board, |
| 197 | options.cxxflags, options.board, options.ldflags, |
| 198 | build_packages_env, build_packages_command)) |
shenhan | 4873858 | 2013-02-19 22:45:41 +0000 | [diff] [blame] | 199 | |
| 200 | logger.GetLogger().LogFatalIf(\ |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 201 | ret, 'build_packages failed while trying to build chromeos-chrome deps.') |
shenhan | 4873858 | 2013-02-19 22:45:41 +0000 | [diff] [blame] | 202 | |
| 203 | # Secondly, build chromeos-chrome using debug mode. |
| 204 | # Replace '--onlydeps' with '--nodeps'. |
| 205 | if options.rebuild == True: |
| 206 | build_packages_env = build_packages_env.replace( |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 207 | 'EXTRA_BOARD_FLAGS=\"-e --onlydeps\"', 'EXTRA_BOARD_FLAGS=--nodeps') |
shenhan | 4873858 | 2013-02-19 22:45:41 +0000 | [diff] [blame] | 208 | else: |
| 209 | build_packages_env = build_packages_env.replace( |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 210 | 'EXTRA_BOARD_FLAGS=--onlydeps', 'EXTRA_BOARD_FLAGS=--nodeps') |
shenhan | 4873858 | 2013-02-19 22:45:41 +0000 | [diff] [blame] | 211 | ret = cmd_executer.ChrootRunCommand( |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 212 | options.chromeos_root, "CFLAGS=\"$(portageq-%s envvar CFLAGS) %s\" " |
| 213 | "CXXFLAGS=\"$(portageq-%s envvar CXXFLAGS) %s\" " |
| 214 | "LDFLAGS=\"$(portageq-%s envvar LDFLAGS) %s\" " |
| 215 | 'CHROME_ORIGIN=SERVER_SOURCE BUILDTYPE=Debug ' |
| 216 | '%s ' |
| 217 | '%s --skip_chroot_upgrade' |
| 218 | 'chromeos-chrome' % (options.board, options.cflags, options.board, |
| 219 | options.cxxflags, options.board, options.ldflags, |
| 220 | build_packages_env, build_packages_command)) |
shenhan | 4873858 | 2013-02-19 22:45:41 +0000 | [diff] [blame] | 221 | logger.GetLogger().LogFatalIf( |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 222 | ret, |
| 223 | 'build_packages failed while trying to build debug chromeos-chrome.') |
shenhan | 4873858 | 2013-02-19 22:45:41 +0000 | [diff] [blame] | 224 | |
| 225 | # Now, we have built chromeos-chrome and all dependencies. |
| 226 | # Finally, remove '-e' from EXTRA_BOARD_FLAGS, |
| 227 | # otherwise, chromeos-chrome gets rebuilt. |
| 228 | build_packages_env = build_packages_env.replace(\ |
| 229 | 'EXTRA_BOARD_FLAGS=--nodeps', '') |
| 230 | |
| 231 | # Up to now, we have a debug built chromos-chrome browser. |
| 232 | # Fall through to build the rest of the world. |
| 233 | |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 234 | # Build packages |
asharif | ca3c6c1 | 2013-02-15 23:17:54 +0000 | [diff] [blame] | 235 | ret = cmd_executer.ChrootRunCommand( |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 236 | options.chromeos_root, "CFLAGS=\"$(portageq-%s envvar CFLAGS) %s\" " |
asharif | ca3c6c1 | 2013-02-15 23:17:54 +0000 | [diff] [blame] | 237 | "CXXFLAGS=\"$(portageq-%s envvar CXXFLAGS) %s\" " |
llozano | 109ac9f | 2013-02-19 19:58:27 +0000 | [diff] [blame] | 238 | "LDFLAGS=\"$(portageq-%s envvar LDFLAGS) %s\" " |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 239 | 'CHROME_ORIGIN=SERVER_SOURCE ' |
| 240 | '%s ' |
| 241 | '%s --skip_chroot_upgrade' % (options.board, options.cflags, |
| 242 | options.board, options.cxxflags, |
| 243 | options.board, options.ldflags, |
| 244 | build_packages_env, build_packages_command)) |
raymes | bfb5799 | 2013-02-15 04:35:45 +0000 | [diff] [blame] | 245 | |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 246 | logger.GetLogger().LogFatalIf(ret, 'build_packages failed') |
yunlian | 5acba6e | 2013-02-19 22:34:37 +0000 | [diff] [blame] | 247 | if options.package: |
| 248 | return 0 |
raymes | 5154d7f | 2013-02-15 04:35:37 +0000 | [diff] [blame] | 249 | # Build image |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 250 | ret = cmd_executer.ChrootRunCommand( |
| 251 | options.chromeos_root, build_packages_env + ' ' + build_image_command) |
raymes | bfb5799 | 2013-02-15 04:35:45 +0000 | [diff] [blame] | 252 | |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 253 | logger.GetLogger().LogFatalIf(ret, 'build_image failed') |
raymes | 5154d7f | 2013-02-15 04:35:37 +0000 | [diff] [blame] | 254 | |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 255 | flags_file_name = 'flags.txt' |
| 256 | flags_file_path = ('%s/src/build/images/%s/latest/%s' % |
| 257 | (options.chromeos_root, options.board, flags_file_name)) |
| 258 | flags_file = open(flags_file_path, 'wb') |
| 259 | flags_file.write('CFLAGS=%s\n' % options.cflags) |
| 260 | flags_file.write('CXXFLAGS=%s\n' % options.cxxflags) |
| 261 | flags_file.write('LDFLAGS=%s\n' % options.ldflags) |
asharif | 8697d4e | 2013-02-15 09:18:09 +0000 | [diff] [blame] | 262 | flags_file.close() |
| 263 | |
| 264 | if options.label: |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 265 | image_dir_path = ('%s/src/build/images/%s/latest' % (options.chromeos_root, |
| 266 | options.board)) |
asharif | 8697d4e | 2013-02-15 09:18:09 +0000 | [diff] [blame] | 267 | real_image_dir_path = os.path.realpath(image_dir_path) |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 268 | command = ('ln -sf -T %s %s/%s' % |
asharif | 8697d4e | 2013-02-15 09:18:09 +0000 | [diff] [blame] | 269 | (os.path.basename(real_image_dir_path), |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 270 | os.path.dirname(real_image_dir_path), options.label)) |
asharif | 8697d4e | 2013-02-15 09:18:09 +0000 | [diff] [blame] | 271 | |
| 272 | ret = cmd_executer.RunCommand(command) |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 273 | logger.GetLogger().LogFatalIf(ret, 'Failed to apply symlink label %s' % |
kbaclawski | 6999ada | 2013-02-15 19:57:09 +0000 | [diff] [blame] | 274 | options.label) |
asharif | 8697d4e | 2013-02-15 09:18:09 +0000 | [diff] [blame] | 275 | |
| 276 | return ret |
raymes | 5154d7f | 2013-02-15 04:35:37 +0000 | [diff] [blame] | 277 | |
Luis Lozano | f2a3ef4 | 2015-12-15 13:49:30 -0800 | [diff] [blame^] | 278 | |
| 279 | if __name__ == '__main__': |
asharif | 2198c51 | 2013-02-15 09:21:35 +0000 | [diff] [blame] | 280 | retval = Main(sys.argv) |
| 281 | sys.exit(retval) |