Add --entry-type=type1|type2 option to kernel-install.

Both kernel-core and kernel-uki-virt call kernel-install upon removal. Need an additional argument to avoid complete removal for both traditional kernel and UKI.

Signed-off-by: Li Tian <litian@redhat.com>
This commit is contained in:
Li Tian
2025-07-10 18:07:23 +02:00
committed by Zbigniew Jędrzejewski-Szmek
parent 33a5cc768c
commit b6d4997683
7 changed files with 62 additions and 1 deletions
+14
View File
@@ -21,6 +21,15 @@ _kernel_install() {
local comps
local MACHINE_ID
local cur=${COMP_WORDS[COMP_CWORD]}
local prev=${COMP_WORDS[COMP_CWORD-1]}
local entry_types="type1 type2 all"
case "$prev" in
--entry-type)
COMPREPLY=( $(compgen -W "$entry_types" -- "$cur") )
return 0
;;
esac
case $COMP_CWORD in
1)
@@ -42,6 +51,11 @@ _kernel_install() {
;;
esac
if [[ "${COMP_WORDS[1]}" == "remove" ]] && [[ $cur == -* ]]; then
COMPREPLY=( $(compgen -W '--entry-type' -- "$cur") )
return 0
fi
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
return 0
}