13a6e31086d88615d570d3f0525bde54eb2a28ce
[archive/20170607/tools/tic-core.git] / tic / pymic.py
1 #!/usr/bin/python
2 # Copyright (c) 2000 - 2016 Samsung Electronics Co., Ltd. All rights reserved.
3 #
4 # Contact: 
5 # @author Chulwoo Shin <cw1.shin@samsung.com>
6
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10 #
11 # http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 #
19 # Contributors:
20 # - S-Core Co., Ltd
21
22 import mic.cmd_create
23
24 class MICOptions:
25     def __init__(self, subcmd, arch, output, ksfile):
26         # Subcommand
27         self.subcommand = subcmd
28         self.interactive = True
29         self.verbose = None
30         # Common options
31         self.ksfile = ksfile
32         self.logfile = None
33         self.config = None
34         self.cachedir = None
35         self.outdir = output
36         self.arch = arch
37         self.release = None
38         self.record_pkgs = None
39         self.pkgmgr = None
40         self.local_pkgs_path = None
41         self.runtime = None
42         self.pack_to = None
43         self.copy_kernel = None
44         self.install_pkgs = None
45         self.check_pkgs = []
46         self.enabletmpfs = None
47         self.repourl = []
48         self.repo = []
49         self.ignore_ksrepo = None
50         self.strict_mode = None
51         # sub-command : fs options  
52         self.include_src = False
53         # sub-command: loop options
54         self.compress_image = None
55         self.include_src = None
56         self.shrink = False
57         # sub-command: raw options
58         self.compress_image = None
59         self.generate_bmap = None
60         self.fstab_entry = 'uuid'
61         
62 def create(options):
63     mic.cmd_create.main(None, options, None)
64     
65 if __name__ == "__main__":
66     subcommnad = 'loop'
67     archrecture = 'armv7l'
68     ksfile = '/home/shinchulwoo/project/image/mobile-wayland-armv7l-tm1.ks'
69     output = '/home/shinchulwoo/project/image'
70     options = MICOptions(subcommnad, archrecture, output, ksfile)
71     create(options)