7 MIC means Image Creator and it's used to create images for Tizen. The tool offers three major functions:
11 - chrooting into an image
13 The tool is derived mainly from MIC2, which is used to create MeeGo images. With great improvements on many features, it has become clear, friendly, and flexible. It provides a python plugin mechanism for developers, to expand image type or image options, and even to hook.
15 With the MIC tool, users can create different types of images for different verticals, including live CD images, live USB images, raw images for KVM, loop images for IVI platforms, and fs images for chrooting. Also, users can work in a chroot environment, based on an existing live image using MIC's enhanced chrooting. Besides, MIC enables transforming an image to another image format, a very useful function for those sensitive to image format.
19 MIC runs natively in many mainstream Linux distributions, including:
21 - Ubuntu (LTS and one latest non-LTS version --- 12.04 and 11.10)
22 - openSUSE (the latest version --- 12.1)
23 - Fedora (the latest version --- 17)
28 To install the MIC package, get the corresponding repository at:
29 http://download.tizen.org/tools/
31 If none of the distributions available in the list are the one you want, install MIC from source code.
34 ~~~~~~~~~~~~~~~~~~~~~~~~~~
35 1. Append repository source:
38 $ sudo vi /etc/apt/sources.list
40 Append the following line:
45 deb http://download.tizen.org/tools/xUbuntu_12.04/
50 deb http://download.tizen.org/tools/xUbuntu_11.10/
52 2. Update repository list:
60 $ sudo apt-get install mic
64 1. Add Tools Building repository:
67 $ sudo zypper addrepo http://download.tizen.org/tools/openSUSE12.1/ tools-building
70 2. Update repository list:
78 $ sudo zypper install mic
82 1. Add The Tools Building repository:
85 $ sudo cat /etc/yum.repos.d/tools-building.repo
87 > name=Tools project for mic, gbs, etc. (Fedora_17)
88 > baseurl=http://download.tizen.org/tools/Fedora_17/
92 2. Update repository cache:
100 $ sudo yum install mic --nogpgcheck
104 Before you install MIC from the source, make sure you installed all the MIC's dependencies manually.
106 Enable Bootstrap Environment
107 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
108 If your mic is higher than 0.15, it means mic would use bootstrap as default. This is the recommended way to install MIC source. The dependencies are:
117 Take Ubuntu 12.04 as an example, you should install the dependencies with apt-get:
120 $ sudo apt-get install rpm python-rpm python-urlgrabber
122 For OpenSUSE, you can install the dependencies with zypper:
125 $ sudo zypper install rpm-python python-xml python-urlgrabber
127 Using Native Envionment
128 ~~~~~~~~~~~~~~~~~~~~~~~
129 If you want MIC to run natively in your host, you should install more dependencies to make it work. For Ubuntu 12.04, you should install these packages with apt-get:
132 $ sudo apt-get install python-rpm bzip2 dmsetup dosfstools e2fsprogs isomd5sum genisoimage \
133 > kpartx parted psmisc sqashfs-tools qemu-user-static extlinux syslinux yum python-m2crypto
135 To get the MIC source, go `here
136 <https://github.com/otcshare/mic/downloads>`_ or git clone from github
140 $ git clone https://github.com/01org/mic
142 Then go to the MIC source directory, and run 'make install' to install MIC from source:
153 How to create an image
154 -----------------------
156 **Prepare kickstart file**
158 To create an image, you need a proper ks file.
159 Here's a simple example:
162 # filename: tizen-min.ks
165 timezone --utc America/Los_Angeles
167 part / --size 1824 --ondisk sda --fstype=ext3
170 bootloader --timeout=0 --append="rootdelay=5"
172 desktop --autologinuser=tizen
173 user --name tizen --groups audio,video --password 'tizen'
175 repo --name=Tizen-base --baseurl=http://download.tizen.org/snapshots/trunk/latest/repos/base/ia32/packages/
176 repo --name=Tizen-main --baseurl=http://download.tizen.org/snapshots/trunk/latest/repos/main/ia32/packages/
178 %packages --ignoremissing
183 rm -rf /var/lib/rpm/__db*
190 The ks file above can be used to create a minimum Tizen image. For other repositories, you can replace with the appropriate repository url. For example:
193 repo --name=REPO-NAME --baseurl=https://username:passwd@yourrepo.com/ia32/packages/ --save --ssl_verify=no
195 **Create an loop image**
197 To create an image, run MIC in the terminal:
200 $ sudo mic create loop tizen-min.ks
202 How to add/remove packages
203 --------------------------
205 You can specific the packages you plan to install in the '%packages' section in ks file. Packages can be specified by group/pattern or by individual package name. The definition of the groups/pattern can be referred to in the repodata/\*comps.xml or repodata/pattern.xml file at the download server. For example: http://download.tizen.org/snapshots/latest/repos/base/ia32/packages/repodata/_.
207 The %packages section is required to end with '%end'. Also, multiple '%packages' sections are allowed. Additionally, individual packages may be specified using globs. For example:
212 @Tizen Core # add a group named Tizen Core, and all the packages in this group would be added
213 e17-* # add all the packages with name starting with "e17-"
214 kernel # add kernel package
215 nss-server.armv7hl # add nss-server with arch armv7hl
216 -passwd # remove the package passwd
220 Use local rpm package
221 ---------------------
223 "How can I install my own rpm into the image, so I can test my package with the image?"
224 In such a case, using local package path would be very helpful. For example, if your rpm 'hello.rpm' is under directory 'localpath', run MIC like below:
228 $ sudo mic create loop test.ks --local-pkgs-path=localpath
230 From the output, MIC will tell you "Marked 'hellop.rpm' as installed", and it will install hello.rpm in the image. Be sure your rpm is not in the repo of ks file and that your rpm's version is newer or equal to the repo rpm version.
235 **Proxy variable in bash**
237 It's common to use the proxy variable in bash. In general, you can set the following environment variables to enable proxy support:
241 export http_proxy=http://proxy.com:port
242 export https_proxy=http://proxy.com:port
243 export ftp_proxy=http://proxy.com:port
244 export no_proxy=localhost,127.0.0.0/8,.company.com
246 You don't need all the variables. Check what you do need. When your repo url in your ks file starts with 'https', MIC will use https_proxy. Be especially aware of when you set no_proxy (it indicates which domain should be accessed directly). Don't leave blank space in the string.
248 Because MIC needs sudo privilege, set /etc/sudoers, to keep the proxy environment, and add those proxy variables to "env_keep":
252 Defaults env_keep += "http_proxy https_proxy ftp_proxy no_proxy"
254 Note: Use "visudo" to modify /etc/sudoers
256 However, if you don't want to change your /etc/sudoers, there is an alternative for you to set the proxy in mic.conf. See the next section.
258 **Proxy setting in mic.conf**
260 The proxy environment variables may disturb other program, so if you would like to enable proxy support only for MIC, set the proxy in /etc/mic/mic.conf like this:
265 ; settings for create subcommand
267 cachedir= /var/tmp/mic/cache
270 proxy = http://proxy.yourcompany.com:8080/
271 no_proxy = localhost,127.0.0.0/8,.yourcompany.com
273 **Proxy setting in ks file**
275 It's likely that you will need to enable proxy support only for a special repo url, and other things would remain at their existing proxy setting.
276 Here's how to handle that case:
280 repo --name=oss --baseurl=http://www.example.com/repos/oss/packages --proxy=http://host:port
285 When you want to run commands inside an image, just chroot it first. Be sure your image has bash installed inside:
289 $ sudo mic chroot tizen-min.img
291 Convert an image to another format
292 ----------------------------------
294 **Convert livecd to liveusb**
296 To convert a livecd image to liveusb:
300 $ sudo mic convert test.iso liveusb
302 **Convert liveusb to livecd**
304 To convert a liveusb to livecd:
308 $ sudo mic convert test.usbimg livecd
312 MIC is used to create and manipulate images for Linux distributions. It is composed of three subcommands: create, convert, and chroot.
317 This command is used to create various images, including live CD, live USB, loop, and raw.
323 mic create(cr) SUBCOMMAND <ksfile> [OPTION]
329 help(?) give detailed help on a specific sub-command
330 fs create fs image, which is also chroot directory
331 livecd create live CD image, used for CD booting
332 liveusb create live USB image, used for USB booting
333 loop create loop image, including multi-partitions
334 raw create raw image, containing multi-partitions
340 -h, --help Show this help message and exit
341 --logfile=LOGFILE Path of logfile
342 -c CONFIG, --config=CONFIG
343 Specify config file for MIC
344 -k CACHEDIR, --cachedir=CACHEDIR
345 Cache directory to store downloaded files
346 -o OUTDIR, --outdir=OUTDIR
349 Specify repo architecture
350 --release=RID Generate a release of RID with all necessary files.
351 When @BUILD_ID@ is contained in kickstart file, it
352 will be replaced by RID.
353 --record-pkgs=RECORD_PKGS
354 Record the info of installed packages. Multiple values
355 can be specified which joined by ",", valid values:
356 "name", "content", "license".
357 --pkgmgr=PKGMGR Specify backend package manager
358 --local-pkgs-path=LOCAL_PKGS_PATH
359 Path for local pkgs(rpms) to be installed
360 --compress-disk-image=COMPRESS_DISK_IMAGE
361 Sets the disk image compression. Note: The available
362 values might depend on the used filesystem type.
363 --copy-kernel Copy kernel files from image /boot directory to the
364 image output directory.
371 mic cr livecd tizen.ks --release=latest
372 mic cr fs tizen.ks --local-pkgs-path=localrpm
378 This command is used to chroot inside the image. It's a great enhancement of the chroot command in the Linux system.
384 mic chroot(ch) <imgfile>
390 -h, --help show this help message and exit
391 -s SAVETO, --saveto=SAVETO
392 Save the unpacked image to specified dir
400 mic ch -s tizenfs tizen.usbimg
405 This command is used for converting an image to another format.
411 mic convert(cv) <imagefile> <destformat>
417 -h, --help Show this help message and exit
418 -S, --shell Launch shell before packaging the converted image
424 mic cv tizen.iso liveusb
425 mic cv tizen.usbimg livecd
426 mic cv --shell tizen.iso liveusb
430 When some important packages (like rpm) of the distribution (Tizen) is much different with native environment, the image created by native environment may be not bootable. Then a bootstrap environment will be required to create the image.
432 To create an image of one distribution (Tizen), MIC will create a bootstrap for this distribution (Tizen) at first, and then create the image by chrooting this bootstrap. This way is called "Bootstrap Mode" for MIC. And from 0.15 on, MIC will use this mode by default.
436 The advanced usage is exclusively for bootstrap. Please skip it if you don't care about it.
438 The major reason for using bootstrap is if some important packages (like rpm) are customized a lot in the repo in which you want to create image, and mic must use the customized rpm to create images, or the images can't be booted. So MIC will create a bootstrap using the repo in the ks file at first, then create the image through chrooting, which can make MIC use the chroot environment with the customized rpm.
440 Now MIC will use bootstrap mode to create an image by default. To meet your requirement, you can also change the bootstrap settings (/etc/mic/bootstrap.conf):
445 distro_name = tizen # which distro will be used for creating bootstrap
446 rootdir = /var/tmp/mic-bootstrap # which dir will be located when creating bootstrap
447 enable = true # whether to enable the bootstrap mode
448 [tizen] # the supported distro for creating bootstrap
449 optional: # which packages will be optional when creating bootstrap for this distro
450 packages: # which packages will be required when creating bootstrap for this distro
456 Q: When creating an image, MIC shows "Error <creator>: URLGrabber error: http://www.example.com/latest/repos/oss/ia32/packages/repodata/repomd.xml"
458 A: Perhaps your network has some issues, or your proxy doesn't work. Try another proxy or find out the network issue.
460 Q: MIC complains "Error <repo>: found 1 resolver problem, abort!"
462 A: This is not an issue with MIC, but with the repo you used. Make sure the packages in the repo you used have proper dependencies.
464 Q: I used '-A i586' to create an i586 image, but it showed "nothing provided ....". What's wrong with it?
466 A: Use '-A i686'. i586 is lower than i686, so many packages will be missing from the installation.
468 Q: MIC shows in the log: "file /usr/share/whatever conflicts between attempted installs of somepackageA and somepackageB"
470 A: There are conflicts between some packages in the repo you used, but this is not an issue with MIC. Please make sure you are using a proper repo.
472 Q: Error shows: Command 'modprobe' is not available in Fedora 17.
474 A: In Fedora 17, when you use sudo, the PATH variable will be changed and you will lose some important paths. Run 'export PATH=/sbin:$PATH' before running MIC.
479 Nonsupport zypp backend in Fedora 17
480 ------------------------------------
481 As libsat-solver changed to libsolv in Fedora 17, zypp backend can't work well for some dependency issues. Use yum as the backend in Fedora 17 distribution.
483 Unable to install syslinux bootloader
484 --------------------------------------
486 In some new Linux distributions, the "syslinux" package in their official software repositories is version 4.04. It causes a segfault, which is a fatal bug, and MIC will fail with syslinux installation errors.
488 The solution is to install the patched "syslinux" package in MeeGo or Tizen's tools repos, until the official released one has been fixed
490 Failed to create btrfs image in OpenSUSE
491 ----------------------------------------
493 When creating a btrfs image in OpenSUSE, it hangs, showing image kernel panic. This issue impacts OpenSUSE distributions: 12.1, etc.
495 Failed to create an image (and the password in the repo URL contains "@")
496 --------------------------------------------------------------------------
498 MIC cannot support passwords that contain the char "@", but this will be fixed soon. Example:
502 repo --name=Tizen-base --baseurl=https://username:passwd@example.com/arch/packages/ --save --ssl_verify=no
505 Bug report and Contacts
506 =========================
507 The source code is tracked at github.com: https://github.com/01org/mic
509 Report issues for bugs or feature requests at JIRA: https://bugs.tizen.org, or at the github page directly.