|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
From 7f10373aa0b75725edb66917fc31a17c65750a7c Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
From: Tom Gundersen <teg@jklm.no>
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
Date: Thu, 6 Feb 2014 18:15:47 +0100
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
Subject: [PATCH] zsh-completions: kernel-install - only show existing kernels
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
for 'remove'
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
When we remove a kernel, we don't remove the modules, so don't look at the modules directory to find installed kernels.
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
shell-completion/zsh/_kernel-install | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
diff --git a/shell-completion/zsh/_kernel-install b/shell-completion/zsh/_kernel-install
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
index 0655188..4fdd3a4 100644
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
--- a/shell-completion/zsh/_kernel-install
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
+++ b/shell-completion/zsh/_kernel-install
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
@@ -12,7 +12,7 @@ _kernels(){
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
read _MACHINE_ID < /etc/machine-id
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
_kernel=( /lib/modules/[0-9]* )
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
if [[ "$cmd" == "remove" && -n "$_MACHINE_ID" ]]; then
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
- _kernel=( /lib/modules/[0-9]* "/boot/$_MACHINE_ID"/[0-9]* )
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
+ _kernel=( "/boot/$_MACHINE_ID"/[0-9]* )
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
fi
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
_kernel=( ${_kernel##*/} )
|
|
Zbigniew Jędrzejewski-Szmek |
ca73a2 |
_describe "installed kernels" _kernel
|