Mic Redesign Framework
- 1 Introduction
- 2 System Composition
- 3 Work Flow
- 4 File Directory Structure
This document provides information about mic redesign framework, including the following aspects.
- System composition
- Work flow
- File directory structure
This section provides information about system composition of mic.
What is mic?
MIC is an image creator. It's used to create images for Tizen.
How many types of images are supported by mic?
There are 5 types of images supported by mic, including live CD images, live USB images, raw images for KVM, loop images for IVI platforms, and fs images for chrooting.
What functions are provided by mic?
With the MIC tool, users can create images of different types for different verticals. Also users can chroot into an image using MIC's enhanced chroot command. Besides, MIC enables converting an image to another image format, a very useful function for those sensitive to image format.
- The main program for mic is formed by three subcommands: create, convert, chroot.
- They are user interfaces.
- store the configure information from mic config-file.
- keep the value of the options.
- take as data center for other components
- find all types of plugins from the plugin directory
- store all found plugins in categories
- provide interface to create, convert, and chroot
- consist of three types: imager, backend, hook
- imager - implement the special interface for create, convert, and chroot:
do_create, do_pack, do_unpack
- backend - provide interface to use package manager
- hook - deal the hook function
- considered as mid-ware between main program and imager class
- Implement the necessary interfaces of the image creating and converting process
- such as mount, install, configure, umount
Mic System Composition Diagram
The mic flowchart include three parts: main option parse, sub option parse,and result output.
The first part parse "sudo mic create/convert/chroot/help" do_option mathod object. Parsing sub option is the second part by using first part return do_option object ,includeing file arg, setting mic format image arg and so on. Last part output files and information about mic.
File Directory Structure
This section provides information about mic file directory structure.
The directory structure
A simple description about the file directory structure omitted some of the compiler configuration files and some documentation.
Mic | ----- Makefile | ----- mic | -----| ----- archive.py | | ----- bootstrap.py | | ----- chroot.py | | ----- conf.py | | ----- creator.py | | ----- imager | | | ----- baseimager.py | | | ----- fs.py | | | ----- livecd.py | | | ----- liveusb.py | | | ----- loop.py | | | ----- raw.py | | ----- msger.py | | ----- pluginbase.py | | ----- plugin.py | | ----- utils | ----- plugins | | ----- backend | | | ----- yumpkgmgr.py | | | ----- zypppkgmgr.py | | ----- hook | | | ----- empty_hook.py | | ----- imager | | | ----- fs_plugin.py | | | ----- livecd_plugin.py | | | ----- liveusb_plugin.py | | | ----- loop_plugin.py | | | ----- raw_plugin.py | ----- tests | ----- tools | | ----- mic
Directory Use Instructions
- Mic package is formed with three sub-packages: mic main sub-package,mic plugins sub-package,and mic tools sub-package.
- The directory `mic/` presents mic main sub-package, `plugins` presents mic plugins sub-package, and `tools/` presents mic tools sub-package.
- The code will be placed in categories in `mic/`. Main program class will be placed in `mic/` , imager class will be placed in `mic/ imager/`,some common code and utility code could be placed in `mic/utils/`.
- Some plugin creator could be placed in `plugins/` .
- Code for unit test would be placed in tests/.