chiark / gitweb /
zsh-completions: kernel-install - only show existing kernels for 'remove'
authorTom Gundersen <teg@jklm.no>
Thu, 6 Feb 2014 17:15:47 +0000 (18:15 +0100)
committerTom Gundersen <teg@jklm.no>
Fri, 7 Feb 2014 14:48:35 +0000 (15:48 +0100)
When we remove a kernel, we don't remove the modules, so don't look at the modules directory to find installed kernels.

shell-completion/zsh/_kernel-install

index 0655188..4fdd3a4 100644 (file)
@@ -12,7 +12,7 @@ _kernels(){
     read _MACHINE_ID < /etc/machine-id
     _kernel=( /lib/modules/[0-9]* )
     if [[ "$cmd" == "remove" && -n "$_MACHINE_ID" ]]; then
-        _kernel=( /lib/modules/[0-9]* "/boot/$_MACHINE_ID"/[0-9]* )
+        _kernel=( "/boot/$_MACHINE_ID"/[0-9]* )
     fi
     _kernel=( ${_kernel##*/} )
     _describe "installed kernels" _kernel