Update the mic doc
[platform/upstream/mic.git] / doc / man.rst
1 =====
2  mic 
3 =====
4
5 SYNOPSIS
6 ========
7
8 | mic [GLOBAL-OPTS] create SUBCOMMAND <ksfile> [OPTION]
9 | mic [GLOBAL-OPTS] chroot [OPTION] <imgfile>
10
11 DESCRIPTION
12 ===========
13
14 The tools `mic` is used to create and manipulate images for Linux distributions.
15 It is composed of two subcommand: `create`, `chroot`.
16
17 USAGE
18 =====
19
20 create
21 ------
22 This command is used to create various images, including loop.
23
24 Usage:
25  | mic [GLOBAL-OPTS] create(cr) SUBCOMMAND <ksfile> [OPTION]
26
27 Subcommands:
28
29  | auto         auto detect image type from magic header
30  | fs           create fs image, which is also chroot directory
31  | loop         create loop image, including multi-partitions
32  | qcow         create qcow image
33
34 Options:
35
36   -h, --help  show the help message
37   --logfile=LOGFILE  specify the path of logfile, save the output to logfile LOGFILE
38   -c CONFIG, --config=CONFIG  specify configure file for mic, default is /etc/mic/mic.conf
39   -k CACHEDIR, --cachedir=CACHEDIR  cache directory used to store the downloaded files and packages
40   -o OUTDIR, --outdir=OUTDIR  directory used to locate the output image and files
41   -A ARCH, --arch=ARCH  specify repo architecture, genarally mic would detect the architecture, if existed more than one architecture, mic would give hint to you
42   --local-pkgs-path=LOCAL_PKGS_PATH  specify the path for local rpm packages, which would be stored your own rpm packages
43   --pkgmgr=PKGMGR  specify backend package mananger, currently yum and zypp available
44   --record-pkgs=RECORD_PKGS  record the info of installed packages, multiple values can be specified which joined by ",", valid values: "name", "content", "license"
45   --pack-to=PACK_TO   pack the images together into the specified achive, extension supported: .zip, .tar, .tar.gz, .tar.bz2, etc. by default, .tar will be used
46   --release=RID  generate a release of RID with all necessary files, when @BUILD_ID@ is contained in kickstart file, it will be replaced by RID. sample values: "latest", "tizen_20120101.1"
47   --copy-kernel  copy kernel files from image /boot directory to the image output directory
48   --runtime=RUNTIME  Specify  runtime mode, avaiable: bootstrap
49   --install-pkgs=INSTALL_PKGS  Specify what type of packages to be installed, valid: source, debuginfo, debugsource
50   --check-pkgs=CHECK_PKGS  Check if given packages would be installed, packages should be separated by comma
51   --tmpfs  Setup tmpdir as tmpfs to accelerate, experimental feature, use it if you have more than 4G memory
52   --strict-mode  Abort creation of image, if there are some errors during rpm installation
53
54 Options for fs image:
55   --include-src  generate a image with source rpms included; to enable it, user should specify the source repo in the ks file
56
57 Options for loop image:
58   --shrink       whether to shrink loop images to minimal size
59   --compress-image=COMPRESS_IMAGE  compress all loop images with 'gz' or 'bz2' or 'lzo'
60   --compress-disk-image=COMPRESS_DISK_IMAGE  same with --compress-image
61
62 Examples:
63
64  | mic create loop tizen.ks
65  | mic cr fs tizen.ks --local-pkgs-path=localrpm
66
67 chroot
68 ------
69 This command is used to chroot inside the image, it's a great enhancement of chroot command in linux system.
70
71 Usage:
72
73  | mic chroot(ch) <imgfile>
74
75 Options:
76
77   -h, --help  show the help message
78   -s SAVETO, --saveto=SAVETO  save the unpacked image to specified directory SAVETO
79
80 Examples:
81
82  | mic chroot loop.img
83
84 Advanced Usage
85 ==============
86 The advanced usage is just for bootstrap, please skip it if you don't care about it.
87
88 The major purpose to use bootstrap is that some important packages (like rpm) are customized
89 a lot in the repo which you want to create image, and mic must use the customized rpm to
90 create images, or the images can't be boot. So mic will create a bootstrap using the repo
91 in the ks file at first, then create the image via chrooting, which can make mic using the
92 chroot environment with the customized rpm.
93
94 Now mic will use bootstrap to create image by default, and to meet your requirement, you can
95 also change the setting for bootstrap (/etc/mic/bootstrap.conf):
96
97 | [main]
98 | # which distro will be used for creating bootstrap
99 | distro_name = tizen
100 | # which dir will be located when creating bootstrap
101 | rootdir = /var/tmp/mic-bootstrap
102 | # whether to enable the bootstrap mode
103 | enable = true
104
105 | [tizen] # the supported distro for creating bootstrap
106 | # which packages will be optional when creating bootstrap for this distro
107 | optional:
108 | # which packages will be required when creating bootstrap for this distro
109 | packages:
110
111 KNOWN ISSUES
112 ============
113 Bug of latest syslinux package
114 ------------------------------
115 In some new Linux distributions, the "syslinux" package in their official
116 software repositories is the version 4.04. It will cause segment fault for
117 a fatal bug, and mic will failed with syslinux installation errors.
118
119 The solution is to install the patched "syslinux" package in MeeGo or Tizen's
120 tools repos, until the official released one being fixed.
121
122 Failed to create btrfs image in openSUSE
123 ----------------------------------------
124 When creating btrfs image in openSUSE, it would hang up with showing image kernel
125 panic. This issue impact all openSUSE distributions: 12.1, 11.4, 11.3, etc
126
127 REPORTING BUGS
128 ==============
129 The source code is tracked in github.com:
130
131     https://github.com/01org/mic
132
133 The bug is registered in tizen.org:
134
135     https://bugs.tizen.org/jira
136
137 Please report issues for bugs or feature requests.