update documentation
[tools/mic.git] / doc / man.rst
1 =====
2  mic 
3 =====
4
5 SYNOPSIS
6 ========
7
8 | mic create SUBCOMMAND <ksfile> [OPTION]
9 | mic chroot [OPTION] <imgfile>
10 | mic convert [OPTION] <imgfile> <format>
11
12 DESCRIPTION
13 ===========
14
15 The tools `mic` is used to create and manipulate images for Linux distributions.
16 It is composed of three subcommand: `create`, `convert`, `chroot`. 
17
18 USAGE
19 =====
20
21 create
22 ------
23 This command is used to create various images, including live CD, live USB, 
24 loop, raw.
25
26 Usage:
27
28  | mic create(cr) SUBCOMMAND <ksfile> [OPTION]
29
30 Subcommands:
31
32  | help(?)      give detailed help on a specific sub-command
33  | fs           create fs image, which is also chroot directory
34  | livecd       create live CD image, used for CD booting
35  | liveusb      create live USB image, used for USB booting
36  | loop         create loop image, including multi-partitions
37  | raw          create raw image, containing multi-partitions
38
39 Options:
40
41   -h, --help  show the help message
42   --logfile=LOGFILE  specify the path of logfile, save the output to logfile LOGFILE
43   -c CONFIG, --config=CONFIG  specify configure file for mic, default is /etc/mic/mic.conf
44   -k CACHEDIR, --cachedir=CACHEDIR  cache directory used to store the downloaded files and packages
45   -o OUTDIR, --outdir=OUTDIR  directory used to locate the output image and files
46   -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
47   --local-pkgs-path=LOCAL_PKGS_PATH  specify the path for local rpm packages, which would be stored your own rpm packages
48   --pkgmgr=PKGMGR  specify backend package mananger, currently yum and zypp available
49   --record-pkgs=RECORD_PKGS  record the info of installed packages, multiple values can be specified which joined by ",", valid values: "name", "content", "license"
50   --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
51   --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"
52   --copy-kernel  copy kernel files from image /boot directory to the image output directory
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'
60   --compress-disk-image=COMPRESS_DISK_IMAGE  same with --compress-image
61
62 Options for raw image:
63   --compress-image=COMPRESS_IMAGE  compress all raw images with 'gz' or 'bz2'
64   --compress-disk-image=COMPRESS_DISK_IMAGE  same with --compress-image
65
66 Examples:
67
68  | mic create loop tizen.ks
69  | mic create livecd tizen.ks --release=latest
70  | mic cr fs tizen.ks --local-pkgs-path=localrpm
71
72 chroot
73 ------
74 This command is used to chroot inside the image, it's a great enhancement of chroot command in linux system.
75
76 Usage:
77
78  | mic chroot(ch) <imgfile>
79
80 Options:
81
82   -h, --help  show the help message
83   -s SAVETO, --saveto=SAVETO  save the unpacked image to specified directory SAVETO
84
85 Examples:
86
87  | mic chroot loop.img
88  | mic chroot tizen.iso
89  | mic ch -s tizenfs tizen.usbimg
90
91 convert
92 -------
93 This command is used for converting an image to another format.
94
95 Usage:
96
97  | mic convert(cv) <imagefile> <destformat>
98
99 Options:
100
101    -h, --help  show the help message
102    -S, --shell  launch interactive shell before packing the new image in the converting
103
104 Examples:
105
106  | mic convert tizen.iso liveusb
107  | mic convert tizen.usbimg livecd
108  | mic cv --shell tizen.iso liveusb
109
110 Advanced Usage
111 ==============
112 The advanced usage is just for bootstrap, please skip it if you don't care about it.
113
114 The major purpose to use bootstrap is that some important packages (like rpm) are customized
115 a lot in the repo which you want to create image, and mic must use the customized rpm to 
116 create images, or the images can't be boot. So mic will create a bootstrap using the repo
117 in the ks file at first, then create the image via chrooting, which can make mic using the
118 chroot environment with the customized rpm.
119
120 Now mic will use bootstrap to create image by default, and to meet your requirement, you can
121 also change the setting for bootstrap (/etc/mic/bootstrap.conf):
122
123 | [main]
124 | # which distro will be used for creating bootstrap
125 | distro_name = tizen
126 | # which dir will be located when creating bootstrap
127 | rootdir = /var/tmp/mic-bootstrap
128 | # whether to enable the bootstrap mode
129 | enable = true
130
131 | [tizen] # the supported distro for creating bootstrap
132 | # which packages will be optional when creating bootstrap for this distro
133 | optional:
134 | # which packages will be required when creating bootstrap for this distro
135 | packages:
136
137 KNOWN ISSUES
138 ============
139 Bug of latest syslinux package
140 ------------------------------
141 In some new Linux distributions, the "syslinux" package in their official
142 software repositories is the version 4.04. It will cause segment fault for
143 a fatal bug, and mic will failed with syslinux installation errors.
144
145 The solution is to install the patched "syslinux" package in MeeGo or Tizen's
146 tools repos, until the official released one being fixed.
147
148 Failed to create btrfs image in openSUSE
149 ----------------------------------------
150 When creating btrfs image in openSUSE, it would hang up with showing image kernel 
151 panic. This issue impact all openSUSE distributions: 12.1, 11.4, 11.3, etc 
152
153 REPORTING BUGS
154 ==============
155 The source code is tracked in github.com:
156
157     https://github.com/jfding/mic
158
159 Please report issues for bugs or feature requests.