3 # Copyright (c) 2013 Intel, Inc.
5 # This program is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by the Free
7 # Software Foundation; version 2 of the License
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 # You should have received a copy of the GNU General Public License along
15 # with this program; if not, write to the Free Software Foundation, Inc., 59
16 # Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 local context state line curcontext="$curcontext"
25 {-h,--help}'[show this help message and exit]' \
26 "--version[show program\'s version number and exit]" \
27 {-d,--debug}'[print debug message]' \
28 {-v,--verbose}'[verbose information]' \
36 curcontext="${curcontext%:*:*}:mic-cmd-$words[1]:"
40 {-h,--help}'[show this help message and exit]' \
41 {-s,--saveto=}'[Save the unpacked image to specified dir]: :_files -/' \
47 {-h,--help}'[show this help message and exit]' \
48 {-S,--shell}'[Launch shell before packaging the converted image]' \
53 {-h,--help}'[show this help message and exit]' \
54 '--logfile=[Path of logfile]:path' \
55 '-c[Specify config file for mic]:file' \
56 '-k[Cache directory to store the downloaded]: :_files -/' \
57 '-o[Output directory]: :_files -/' \
58 '-A[Specify repo architecture]:parameter' \
59 '--release=[Generate a release of RID with all necessary files, when @BUILD_ID@ is contained in kickstart file, it will be replaced by RID]:parameter' \
60 '--record-pkgs=[Record the info of installed packages, multiple values can be specified which joined by \",\", valid values: \"name\", \"content\", \"license\", \"vcs\"]: :_mic_create_filters -s ,' \
61 '--pkgmgr=[Specify backend package manager]:parameter' \
62 '--local-pkgs-path=[Path for local pkgs(rpms) to be installed]:path' \
63 '--runtime=[Specify runtime mode, avaiable: bootstrap, native]: :(bootstrap native)' \
64 '--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]:parameter' \
65 '--copy-kernel[Copy kernel files from image /boot directory to the image output directory.]' \
66 '--install-pkgs=[Specify what type of packages to be installed, valid: source, debuginfo, debugsource]: :(source debuginfo debugsource)' \
67 '--check-pkgs=[Check if given packages would be installed, packages should be separated by comma]' \
68 '--tmpfs[Setup tmpdir as tmpfs to accelerate, experimental feature, use it if you have more than 4G memory]' \
69 '1: :_mic_create_entities' \
70 '*::create-arg:->create-args' \
77 {-h,--help}'[show this help message and exit]' \
78 '--logfile=[Path of logfile]:path' \
79 '-c[Specify config file for mic]:file' \
80 '-k[Cache directory to store the downloaded]: :_files -/' \
81 '-o[Output directory]: :_files -/' \
82 '-A[Specify repo architecture]:parameter' \
83 '--release=[Generate a release of RID with all necessary files, when @BUILD_ID@ is contained in kickstart file, it will be replaced by RID]:parameter' \
84 '--record-pkgs=[Record the info of installed packages, multiple values can be specified which joined by \",\", valid values: \"name\", \"content\", \"license\", \"vcs\"]: :_mic_create_filters -s ,' \
85 '--pkgmgr=[Specify backend package manager]:parameter' \
86 '--local-pkgs-path=[Path for local pkgs(rpms) to be installed]:path' \
87 '--runtime=[Specify runtime mode, avaiable: bootstrap, native]: :(bootstrap native)' \
88 '--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]:parameter' \
89 '--copy-kernel[Copy kernel files from image /boot directory to the image output directory.]' \
90 '--install-pkgs=[Specify what type of packages to be installed, valid: source, debuginfo, debugsource]: :(source debuginfo debugsource)' \
91 '--check-pkgs=[Check if given packages would be installed, packages should be separated by comma]' \
92 '--tmpfs[Setup tmpdir as tmpfs to accelerate, experimental feature, use it if you have more than 4G memory]' \
103 '--include-src[Generate a image with source rpms included]' \
119 '--shrink[Whether to shrink loop images to minimal size]' \
120 "--compress-image=[Compress all loop images with \'gz\' or \'bz2\']: :(gz bz2)" \
121 "--compress-disk-image=[Same with --compress-image]: :(gz bz2)" \
127 "--fstab-entry=[Set fstab entry, \'name\' means using device names, \'uuid\' means using filesystem uuid]: :(name uuid)" \
128 '--generate-bmap[also generate the block map file]' \
129 '--compress-image=[Compress all raw images before package]: :(gz bz2)' \
130 '--compress-disk-image=[Same with --compress-image]: :(gz bz2)' \
135 '1: :_mic_create_entities' \
154 (( $+functions[_mic_cmds] )) ||
156 local commands; commands=(
157 'chroot:chroot into an image'
158 'convert:convert image format'
159 'create:create an image'
160 'help:give detailed help on a specific sub-command'
162 _describe -t commands 'command' commands "$@"
165 (( $+functions[_mic_create_entities] )) ||
166 _mic_create_entities() {
167 local entities; entities=(
168 'auto:auto detect image type from magic header'
170 'help:give detailed help on a specific sub-command'
171 'livecd:create livecd image'
172 'liveusb:create liveusb image'
173 'loop:create loop image'
174 'raw:create raw image'
176 _describe -t entities 'entity' entities "$@"
179 (( $+functions[_mic_create_filters] )) ||
180 _mic_create_filters() {
181 local filters; filters=(name content license vcs)
182 _values $@ 'filter' "${filters[@]}"
187 # vim: ft=zsh sw=2 ts=2 et