Update the mic doc
authorjianzhong.fang <jz.fang@samsung.com>
Wed, 4 Nov 2015 06:01:03 +0000 (14:01 +0800)
committeryyh <yyh@123.com>
Thu, 4 Feb 2016 06:47:06 +0000 (14:47 +0800)
Change-Id: Id17882b91640f5390198c17bbf3bc2fdb8699668

doc/man.rst
doc/usage.rst
tools/mic

index 290af95..c58e2f6 100644 (file)
@@ -5,15 +5,14 @@
 SYNOPSIS
 ========
 
-| mic create SUBCOMMAND <ksfile> [OPTION]
-| mic chroot [OPTION] <imgfile>
-| mic convert [OPTION] <imgfile> <format>
+| mic [GLOBAL-OPTS] create SUBCOMMAND <ksfile> [OPTION]
+| mic [GLOBAL-OPTS] chroot [OPTION] <imgfile>
 
 DESCRIPTION
 ===========
 
 The tools `mic` is used to create and manipulate images for Linux distributions.
-It is composed of three subcommand: `create`, `convert`, `chroot`.
+It is composed of two subcommand: `create`, `chroot`.
 
 USAGE
 =====
@@ -23,14 +22,14 @@ create
 This command is used to create various images, including loop.
 
 Usage:
-
- | mic create(cr) SUBCOMMAND <ksfile> [OPTION]
+ | mic [GLOBAL-OPTS] create(cr) SUBCOMMAND <ksfile> [OPTION]
 
 Subcommands:
 
- | help(?)      give detailed help on a specific sub-command
+ | auto         auto detect image type from magic header
  | fs           create fs image, which is also chroot directory
  | loop         create loop image, including multi-partitions
+ | qcow         create qcow image
 
 Options:
 
@@ -81,25 +80,6 @@ Options:
 Examples:
 
  | mic chroot loop.img
- | mic chroot tizen.iso
- | mic ch -s tizenfs tizen.usbimg
-
-convert
--------
-This command is used for converting an image to another format.
-
-Usage:
-
- | mic convert(cv) <imagefile> <destformat>
-
-Options:
-
-   -h, --help  show the help message
-   -S, --shell  launch interactive shell before packing the new image in the converting
-
-Examples:
-
-
 
 Advanced Usage
 ==============
index d8a10c6..aed950b 100644 (file)
@@ -8,7 +8,6 @@ Overview
 MIC offers three major functions:
 
 - creating an image with different format
-- converting an image to another format
 - chrooting into an image
 
 Getting help
@@ -25,9 +24,7 @@ How to get help:
 
   * mic --help
   * mic create --help
-  * mic help create
   * mic create loop --help
-  * mic create help loop
 
 Image formulation support
 -------------------------
@@ -38,21 +35,13 @@ Image formulation support
   * For a configuration with multiple partitions, which is specified in the kickstartfile, mic will generate multiple loop images
   * And multiple loop images can be packed into a single archive file
 
-- Raw
-
-  * “raw” format means something like hard disk dumping
-  * Including partition table and all the partitions
-  * The image is bootable directly
-
-- Livecd
-
-  * Mainly used for an ia32 build, it can be burned to CD or usbstick, which can be booted into a live system or installation UI
-
 - fs
 
   * “fs” means file-system
   * mic can install all the Tizen files to the specified directory, which can be used directly as chroot env
 
+- qcow
+
 
 Create
 ------
@@ -60,16 +49,17 @@ Create
 
 ::
 
-  mic create(cr) SUBCOMMAND <ksfile> [OPTION]
+  mic [GLOBAL-OPTS] create(cr) SUBCOMMAND <ksfile> [OPTION]
 
 
 - Sub-commands, to specify image format, include:
 
 ::
 
-  help(?)            give detailed help on a specific sub-command
+  auto               auto detect image type from magic header
   fs                 create fs image, which is also a chroot directory
   loop               create loop image, including multi-partitions
+  qcow               create qcow image
 
 - <ksfile>:
 
@@ -104,27 +94,35 @@ In Tizen, the released image will have a ks file along with image. For example,
    --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
+   --runtime=RUNTIME_MODE
+                       Sets runtime mode, the default is bootstrap mode, valid
+                       values: "bootstrap". "bootstrap"  means mic uses one
+                       tizen chroot environment to create image.
    --copy-kernel       Copy kernel files from image /boot directory to the
                        image output directory.
-
+   --install-pkgs      INSTALL_PKGS  Specify what type of packages to be 
+                       installed, valid: source, debuginfo, debugsource
+   --check-pkgs=CHECK_PKGS  
+                       Check if given packages would be installed,
+                       packages should be separated by comma
+   --tmpfs             Setup tmpdir as tmpfs to accelerate, experimental feature,
+                       use it if you have more than 4G memory
+   --strict-mode       Abort creation of image, if there are some errors 
+                       during rpm installation
+  
 - Other options:
 
 ::
 
-   --runtime=RUNTIME_MODE
-                       Sets runtime mode, the default is bootstrap mode, valid
-                       values: "bootstrap". "bootstrap"  means mic uses one
-                       tizen chroot environment to create image.
-    --compress-image=COMPRESS_IMAGE (for loop & raw)
+   --compress-image=COMPRESS_IMAGE (for loop)
                        Sets the disk image compression. Note: The available
                        values might depend on the used filesystem type.
    --compress-disk-image=COMPRESS_IMAGE
                        Same with --compress-image
    --shrink (for loop)
                        Whether to shrink loop images to minimal size
-   --generate-bmap (for raw)
-                       Generate the block map file
-
+   --include-src (for fs)
+                       Generate a image with source rpms included
 - Examples:
 
 ::
@@ -154,32 +152,6 @@ This command is used to chroot inside the image. It's a great enhancement of the
 ::
 
    mic ch loop.img
-   mic ch tizen.iso
-   mic ch -s tizenfs tizen.usbimg
-
-Convert 
--------
-This command is used for converting an image to another format.
-
-
-- Usage:
-
-::
-
-   mic convert(cv) <imagefile> <destformat>
-
-- Options:
-
-::
-
-   -h, --help   Show this help message and exit
-   -S, --shell  Launch shell before packaging the converted image
-
-- Examples:
-
-::
-
-   mic cv tizen.usbimg livecd
 
 Getting Start
 -------------
index 7785bec..3b5b741 100755 (executable)
--- a/tools/mic
+++ b/tools/mic
@@ -126,12 +126,13 @@ def create_parser(parser):
     parser.set_defaults(alias="cr")
 
     subparsers  = parser.add_subparsers(title='Subcommands', dest='subcommand')
+    auto_parser = subparsers.add_parser('auto', parents=[parent_parser], help='auto detect image type from magic header')
+    
     fs_parser   = subparsers.add_parser('fs', parents=[parent_parser], 
-                                        help='auto detect image type from magic header')
+                                        help='create fs image')
     fs_parser.add_argument("--include-src", dest = "include_src",action = "store_true",
                            default = False, help = "Generate a image with source rpms included")
                   
-    auto_parser = subparsers.add_parser('auto', parents=[parent_parser], help='create fs image')
     loop_parser = subparsers.add_parser('loop', parents=[parent_parser], help='create loop image')
 
     loop_parser.add_argument("--compress-disk-image", dest="compress_image",