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