blob: 14119da5be6fdb4a8708dbf2e4f6aacde69b38e2 [file] [log] [blame]
Tudor Brindus0086f7a2018-07-23 16:33:13 -07001# Copyright 2018 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"""This module is responsible for generating a stateful update payload."""
6
Tudor Brindus0086f7a2018-07-23 16:33:13 -07007from chromite.lib import commandline
Amin Hassania2a83382019-01-09 12:36:54 -08008from chromite.lib.paygen import paygen_stateful_payload_lib
Tudor Brindus0086f7a2018-07-23 16:33:13 -07009
10
11def ParseArguments(argv):
12 """Returns a namespace for the CLI arguments."""
13 parser = commandline.ArgumentParser(description=__doc__)
14 parser.add_argument('-i', '--image_path', type='path', required=True,
15 help='The image to generate the stateful update for.')
16 parser.add_argument('-o', '--output_dir', type='path', required=True,
17 help='The path to the directory to output the stateful'
18 'update file.')
19 opts = parser.parse_args(argv)
20 opts.Freeze()
21
22 return opts
23
24
25def main(argv):
26 opts = ParseArguments(argv)
27
Amin Hassania2a83382019-01-09 12:36:54 -080028 paygen_stateful_payload_lib.GenerateStatefulPayload(opts.image_path,
29 opts.output_dir)