1#compdef make-kpkg
2
3local context state line
4typeset -A opt_args
5
6_arguments \
7   '--help[display help message]' \
8   '--revision[change Debian revision number]:number:' \
9   '--append-to-version[specify additional kernel sub-version]:suffix:' \
10   '--added-modules[specify add-on modules]:module list:->addedmodules' \
11   '--added-patches[specify additional patches]:patches list' \
12   '--arch[specify architecture for cross-compilation]:architecture' \
13   '--cross-compile[specify target string]:target' \
14   '--subarch[specify subarchitecture]:subarchitecture:' \
15   '--arch-in-name[include architecture in kernel image name]' \
16   '--pgpsign[sign changes file]:name' \
17   '--config[specify configuration target]:target:(oldconfig config menuconfig xconfig old menu x)' \
18   '--targets[list known targets]' \
19   '--noexec[pass -n option to make]' \
20   '--verbose[show top level make commands]' \
21   '--initrd[create image suitable for initrd]' \
22   '(--bzimage)--zimage[make zImage instead of bzImage]' \
23   '(--zimage)--bzimage[make bzImage instead of zImage]' \
24   '--mkimage[command that produces an initrd image given a directory]:command:' \
25   '--rootcmd[specify command for gaining root access]:root command:(sudo fakeroot)' \
26   '--stem:package name stem:(kernel linux)' \
27   '--us[unsigned source]' \
28   '--uc[unsigned changelog]' \
29   '*:target:(( \
30        clean\:"clean the kernel source directory" \
31        buildpackage\:"runs the targets clean and binary" \
32        binary\:"all kernel packages" \
33        binary-indep\:"arch independent packages" \
34        binary-arch\:"arch dependent packages" \
35        kernel-source\:"package of the kernel sources" \
36        kernel-headers\:"package of the header files included in the kernel" \
37        kernel-manual\:"package of the manual pages included in the kernel" \
38        kernel-doc\:"package of the documentation included in the kernel" \
39        kernel-image\:"package of the kernel image" \
40        build\:"compiles the kernel" \
41        modules\:"build all add-on modules" \
42        modules-config\:"configure all add-on modules" \
43        modules-image\:"build all add-on modules, but wirhou source and diff files" \
44        modules-clean\:"clean add-on modules" \
45        configure\:"configure the kernel" \
46        debian\:"creates the debian/ directory" \
47        libc-kheaders\:"create the kernel headers package needed by libc" \
48        ))' && return 0
49
50case "$state" in
51  (addedmodules)
52    compset -P '*,'
53    _alternative \
54      'moddirs:module dirs:_files -/ -S ,' \
55      'modules:loc module dirs:_files -/ -W ${MODULE_LOC:-/usr/src/modules} -S ,'
56  ;;
57esac
58