initial import code into git
[platform/upstream/mic.git] / micng / pluginbase / imager_plugin.py
1 #!/usr/bin/python
2 from micng.pluginbase.base_plugin import PluginBase
3 import micng.configmgr as configmgr
4
5 class ImagerPlugin(PluginBase):
6     plugin_type = "imager"
7     def __init__(self, configinfo=None):
8         if not configinfo:
9             self.configinfo = configmgr.getConfigInfo()
10             return 
11         self.configinfo = configinfo
12
13     def do_mount_instroot(self):
14         """Mount or prepare the install root directory.
15
16         This is the interface where plugin may prepare the install root by e.g.
17         mounting creating and loopback mounting a filesystem image to
18         _instroot.
19         """
20         pass
21
22     def do_umount_instroot(self):
23         """Undo anything performed in do_mount_instroot().
24
25         This is the interface where plugin must undo anything which was done
26         in do_mount_instroot(). For example, if a filesystem image was mounted
27         onto _instroot, it should be unmounted here.
28         """
29         pass
30
31     def do_mount(self):
32         """Setup the target filesystem in preparation for an install.
33
34         This interface should setup the filesystem which other functions will
35         install into and configure.
36         """
37         pass
38
39     def do_umount(self):
40         """Unmounts the target filesystem.
41
42         It should detache the system from the install root.
43         """
44         pass
45
46     def do_cleanup(self):
47         """Unmounts the target filesystem and deletes temporary files.
48
49         This interface deletes any temporary files and directories that were created
50         on the host system while building the image.
51         """
52         pass
53
54     def do_install(self):
55         """Install packages into the install root.
56
57         This interface installs the packages listed in the supplied kickstart
58         into the install root. By default, the packages are installed from the
59         repository URLs specified in the kickstart.
60         """
61         pass
62
63     def do_configure(self):
64         """Configure the system image according to the kickstart.
65
66         This interface applies the (e.g. keyboard or network) configuration
67         specified in the kickstart and executes the kickstart %post scripts.
68
69         If neccessary, it also prepares the image to be bootable by e.g.
70         creating an initrd and bootloader configuration.
71         """
72         pass
73
74     def do_package(self, destdir):
75         """Prepares the created image for final delivery.
76
77         This interface merely copies the install root to the supplied destination
78         directory,
79         """
80         pass
81
82     def do_create(self, args):
83         """ Temporary solution to create image in one single interface """
84         pass
85
86     def pack(self):
87         pass
88
89     def unpack(self):
90         pass