blob: 2b921bfb7adf6942176696b5d22348121e263e6c [file] [log] [blame]
Tudor Brindus0086f7a2018-07-23 16:33:13 -07001# -*- coding: utf-8 -*-
2# Copyright 2018 The Chromium OS Authors. All rights reserved.
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6"""This module is responsible for generating a stateful update payload."""
7
8from __future__ import print_function
9
Tudor Brindus0086f7a2018-07-23 16:33:13 -070010from chromite.lib import commandline
Tudor Brindus0086f7a2018-07-23 16:33:13 -070011
Amin Hassania2a83382019-01-09 12:36:54 -080012from chromite.lib.paygen import paygen_stateful_payload_lib
Tudor Brindus0086f7a2018-07-23 16:33:13 -070013
14
15def ParseArguments(argv):
16 """Returns a namespace for the CLI arguments."""
17 parser = commandline.ArgumentParser(description=__doc__)
18 parser.add_argument('-i', '--image_path', type='path', required=True,
19 help='The image to generate the stateful update for.')
20 parser.add_argument('-o', '--output_dir', type='path', required=True,
21 help='The path to the directory to output the stateful'
22 'update file.')
23 opts = parser.parse_args(argv)
24 opts.Freeze()
25
26 return opts
27
28
29def main(argv):
30 opts = ParseArguments(argv)
31
Amin Hassania2a83382019-01-09 12:36:54 -080032 paygen_stateful_payload_lib.GenerateStatefulPayload(opts.image_path,
33 opts.output_dir)