mic-create

名称

mic create (cr) - 针对Linux发行版,创建和操作镜像文件。

简介

  • 子命令

    mic create(cr) <Second_Level_Subcommand> <ksfile>
                                          [-h, --help] [--logfile=LOGFILE]
                                          [-c CONFIG, --config=CONFIG]
                                          [-k CACHEDIR, --cachedir=CACHEDIR]
                                          [-o OUTDIR, --outdir=OUTDIR]
                                          [-A ARCH, --arch=ARCH]
                                          [--release=RID]
                                          [--record-pkgs=RECORD_PKGS]
                                          [--pkgmgr=PKGMGR]
                                          [--local-pkgs-path=LOCAL_PKGS_PATH]
                                          [--runtime=RUNTIME]
                                          [--pack-to=PACK_TO] [--copy-kernel]
                                          [--install-pkgs=INSTALL_PKGS]
                                          [--check-pkgs=CHECK_PKGS] [--tmpfs]
    
  • 二级子命令

    mic create(cr) help <Second_Level_Subcommand>
    mic create(cr) auto <ksfile> [-h, --help]
    mic create(cr) fs <ksfile> [-h, --help] [--include-src]
    mic create(cr) livecd <ksfile> [-h, --help]
    mic create(cr) liveusb <ksfile> [-h, --help]
    mic create(cr) loop <ksfile> [-h, --help][--shrink]
                                 [--compress-image=COMPRESS_IMAGE]
                                 [--compress-disk-image=COMPRESS_IMAGE]
    mic create(cr) raw  <ksfile> [-h, --help]
                                 [--fstab-entry=FSTAB_ENTRY]
                                 [--generate-bmap]
                                 [--compress-image=COMPRESS_IMAGE]
                                 [--compress-disk-image=COMPRESS_IMAGE]
    

描述

此命令针对Linux发行版创建和操作镜像文件。 mic工具支持多种镜像文件格式,参考如下:

  • mic create auto

    从ks文件中的魔幻行(封装在"-*-mic2-options-*-"中)自动探测镜像格式,并创建相应格式的镜像。

    假设ks文件中的魔幻行如下:

    # -*-mic2-options-*- -f loop --pack-to=@NAME@-rs.zip -*-mic2-options-*-
    

    那么运行mic cr auto *.ks的结果等价于mic cr loop *.ks --pack-to=@NAME@-rs.zip

  • mic create fs

    创建文件系统镜像。

    在这种情况下,MIC工具将安装所有Tizen文件到指定的目录,此目录可直​​接用作chroot目录。

  • mic create help <Second_Level_Subcommand>

    显示指定二级子命令的帮助信息。

  • mic create livecd

    创建一个可以烧录到光盘的镜像,这个镜像是基于一个实时系统或者可以被启动的安装界面。

  • mic create liveusb

    创建一个可以烧录到U盘的镜像,这个镜像是基于一个实时系统或者可以被启动的安装界面。

  • mic create loop

    为移动设备创建一个loop镜像文件。

    意:每一个loop对应着一个特定的分区,多个loop镜像文件可以打包成一个archive文件。

    这种情况下,MIC更车ks文件中指定多个分区,生成多个loop镜像文件。

  • mic create raw

    针对IVI设备创建raw镜像文件。

    这种情况下,MIC工具将创建一个类似硬盘数据raw格式的可引导镜像文件。

参数

强制参数

<ksfile>            Specifies the ksfile that describes how to create
                    an image.

了解更多信息,请参阅Fedora ksfile。

针对子命令的可选参数

-h, --help          Shows this help message and exit.
--logfile=LOGFILE   Specifies the path of logfile.
-c CONFIG, --config=CONFIG
                    Specifies config file for MIC.
-k CACHEDIR, --cachedir=CACHEDIR
                    Specifies cache directory to store downloaded files.
-o OUTDIR, --outdir=OUTDIR
                    Specifies the output directory.
-A ARCH, --arch=ARCH
                    Specifies repo architecture.
--release=RID       Specifies the repo with specific Release ID (RID) and
                    adds the RID to the name of generated files.
                    When @BUILD_ID@ is contained in kickstart file, it
                    will be replaced by RID.
--record-pkgs=RECORD_PKGS
                    Records the info of installed packages. Multiple values
                    must be separated by comma. Valid values: name,
                    content, license, vcs.
--pkgmgr=PKGMGR     Specifies backend package manager. Valid values:
                    yum, zypp.
--local-pkgs-path=LOCAL_PKGS_PATH
                    Specifies the installation path of local RPM packages.
--runtime=RUNTIME_MODE
                    Sets runtime mode, the default value is bootstrap mode.
                    Valid values: native, bootstrap. "native" indicates
                    MIC uses localhost environment to create image, whereas
                    "bootstrap" indicates MIC uses one tizen chroot
                    environment to create image.
--pack-to=PACK_TO   Packs the images together into the specified achive,
                    extension supported: .zip, .tar, .tar.gz, .tar.bz2,
                    etc. The default value is .tar.
--copy-kernel       Copies kernel files from image /boot directory to the
                    image output directory.
--install-pkgs=INSTALL_PKGS
                    Specifies the type of packages to be installed. Valid
                    values: source, debuginfo, debugsource.
--check-pkgs=CHECK_PKGS
                    Checks whether the given packages will be installed,
                    packages must be separated by comma.
--tmpfs             Sets up tmpdir as tmpfs to accelerate. This is
                    experimental feature recommended to use when the memory
                    of the host machine is more than 4G.

针对二级子命令的可选参数

  • mic create fs使用的参数

    --include-src       Generates an image with source RPMs included.
    
  • mic create loop使用的参数

    --shrink
                        Specifies whether to shrink loop images to minimal size.
    --compress-image=COMPRESS_IMAGE
                        Sets the disk image compression. Note: The available
                        values may depend on the file system type.
    --compress-disk-image=COMPRESS_IMAGE
                        Same with --compress-image.
    
  • mic create raw使用的参数

    --fstab-entry=FSTAB_ENTRY
                        Sets fstab entry. Valid values: name, uuid. "name"
                        indicates MIC uses device names, "uuid" indicates MIC
                        uses file system uuid.
    --generate-bmap
                        Generates the block map file.
    --compress-image=COMPRESS_IMAGE
                        Sets the disk image compression. Note: The available
                        values may depend on the filesystem type.
    --compress-disk-image=COMPRESS_IMAGE
                        Same with --compress-image.