summaryrefslogtreecommitdiff
path: root/README.rst
blob: 2b2ebefe59740c0dd3d4c50d6218d29c33309c48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
=====
 mic
=====
-------------------------------------
image creator for Linux distributions
-------------------------------------
:Copyright: GPLv2
:Manual section: 1

Overview
========
The tool `mic` is used to create and manipulate images for Linux distributions.
It's composed of three subcommand: create, convert, chroot. Subcommand `create`
is used to create images with different types, including fs image, loop image,
live CD image, live USB image, raw image, etc. For each image type, there is a
corresponding subcommand. (Details in the following sections)

It supports native running in many mainstream Linux distributions, including:

* Fedora (13 and above)
* openSUSE (11.3 and above)
* Ubuntu (10.04 and above)
* Debian (5.0 and above)
* MeeGo

Installation
============

Repositories
------------
So far we support `mic` binary rpms/debs for many popular Linux distributions,
please see the following list. And you can get the corresponding repository on

 `<http://download.meego.com/live/devel:/tools:/building>`_

If there is no the distribution you want in the list, please install it from
source code.

* Debian 5.0
* Fedora 13
* Fedora 14
* Fedora 15
* openSUSE 11.3
* openSUSE 11.4
* Ubuntu 10.04
* Ubuntu 10.10

*Tips*: Debian 6.0 can use the repository of Debian 5.0.

Binary Installation
-------------------

Fedora Installation
~~~~~~~~~~~~~~~~~~~
1. Add devel:tools:building repo:
::

  $ sudo cat <<REPO > /etc/yum.repos.d/devel-tools-building.repo
  > [devel-tools-building]
  > name=Tools for Fedora
  > baseurl=http://download.meego.com/live/devel:/tools:/building/Fedora_<VERSION>
  > enabled=1
  > gpgcheck=0
  > REPO

Also you can take the repo file on devel:tools:building as example. For example,
Fedora 13 can use:
`<http://download.meego.com/live/devel:/tools:/building/Fedora_13/devel:tools:building.repo>`_.

2. Update repolist:
::

  $ sudo yum makecache

3. Install mic:
::

  $ sudo yum install mic

openSUSE Installation
~~~~~~~~~~~~~~~~~~~~~
1. Add devel:tools:building repo:
::

  $ sudo zypper addrepo http:/download.meego.com/live/devel:/tools:/building/openSUSE_<VERSION>/ devel-tools-building

2. Update repolist:
::

  $ sudo zypper refresh

3. Update libzypp:
::

  $ sudo zypper update libzypp

4. Install mic:
::

  $ sudo zypper install mic

Ubuntu/Debian Installation
~~~~~~~~~~~~~~~~~~~~~~~~~~
1. Append repo source:
::

  $ sudo cat <<REPO >> /etc/apt-sources.list
  > deb http://download.meego.com/live/devel:/tools:/building/<Ubuntu/Debian>_<VERSION>/ /
  > REPO

*Tips*: for Ubuntu 10.10, you should use xUbuntu_10.10 to replace <Ubuntu/Debian>_<VERSIN>.

2. Update repolist:
::

  $ sudo apt-get update

3. Install mic:
::

  $ sudo apt-get install mic

Source Installation
-------------------
First, get the source of mic (`<TBD>`_). Then unpack the tar ball, and use make
to process the installation.

1. Unpack:
::

  $ tar xzvf mic.tar.gz

2. Build:
::

  $ cd micng
  $ make clean
  $ make

3. Install:
::

  $ sudo make install

Configuration file
==================
The configure file for mic can be provided as `/etc/mic/mic.conf`, where you
can specify the global settings.
The blow is the content of one sample file: ::

  [common]
  ; general settings
  
  [create]
  ; settings for create subcommand
  tmpdir= /var/tmp/mic
  cachedir= /var/tmp/mic/cache
  outdir= .
  pkgmgr = zypp
  
  ; proxy = http://proxy.yourcompany.com:8080/
  ; no_proxy = localhost,127.0.0.0/8,.yourcompany.com
  ; ssl_verify = no

  [convert]
  ; settings for convert subcommand
  
  [chroot]
  ; settings for chroot subcommand

In this configuration file, there are four sections: [common] is for general
setting, and [create] [convert] [chroot] sections are for the options of
corresponding mic subcommands: create, convert, and chroot.

In the [create] section, the following values can be specified:

tmpdir
  Temporary directory used in the image creation

cachedir
  Directory to store cached repos and downloaded rpm files

outdir
  Output directory

pkgmgr
  Default backend package manager: yum or zypp

Usages
======
It's recommended to use `--help` or `help <subcmd>` to get the help message, for
the tool is more or less self-documented.

Running 'mic create'
--------------------
Subcommand *create* is used for creating images. To create an image, you should
give the sub-sub commands which presents the image type you want, and also you
should provide an argument which presents the kickstart file for using, such
as: ::

  $ sudo mic create fs test.ks

The supported image types can be listed using `mic create --help` ::

  fs             create fs image
  livecd         create livecd image
  liveusb        create liveusb image
  loop           create loop image
  raw            create raw image

For each image type, you can get their own options by `--help` option, like
`mic cr fs --help`. Meanwhile, there are some common options that can be used
by all image types, as the following ::

  -h, --help          show this help message and exit
  --logfile=LOGFILE   Path of logfile
  -c CONFIG, --config=CONFIG
                      Specify config file for mic
  -k CACHEDIR, --cachedir=CACHEDIR
                      Cache directory to store the downloaded
  -o OUTDIR, --outdir=OUTDIR
                      Output directory
  -A ARCH, --arch=ARCH
                      Specify repo architecture
  --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
  --record-pkgs=RECORD_PKGS
                      Record the info of installed packages, multiple values
                      can be specified which joined by ",", valid values:
                      "name", "content", "license"
  --pkgmgr=PKGMGR     Specify backend package manager
  --local-pkgs-path=LOCAL_PKGS_PATH
                      Path for local pkgs(rpms) to be installed

*Tips*: the common options can be normally put before sub-sub command, but also
can be after them, such as: ::

  $ sudo mic cr --outdir output fs test.ks

or ::

  $ sudo mic cr fs test.ks --outdir output

*Tips*: if you failed to create armv7* image, the reason may be qemu/qemu-arm on your host is lower than required, please update qemu/qemu-arm higher than 0.13.0.

Running 'mic chroot'
--------------------
Subcommand *chroot* is used to chroot an image file. Given an image file, you
can use `mic chroot` to chroot inside the image, and then you can do some
modification to the image. After you logout, the image file will keep your
changes. It's a convenient way to hack your image file.

Sample command: ::

  $ sudo mic chroot test.img

Running 'mic convert'
---------------------
Subcommand *convert* is used for converting an image to another one with
different image type. Using `convert`, you can get your needed image type
comfortably. So far converting livecd to liveusb and liveusb to livecd is
supported.

Sample command: ::

  $ sudo mic convert test.iso liveusb

Debug/Verbose Output
--------------------
When you encounter some errors, and you want to know more about it, please use
debug/verbose output to get more details in the process by adding `-d/-v`. And
it's recommended to add `-d/--debug` or `-v/--verbose` like: ::

  $ sudo mic -d cr fs test.ks