kernel-install: silently ignore unexpected arguments for 'remove' command

The shell script version of kernel-install silently ignored unexpected
arguments, but C version refused that. Unfortunately, Fedora's kernel
script specifies kernel file even for 'remove' command. Let's accept
extra arguments and silently ignore them to keep backward compatibility.

Fixes #28448.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2223794.
This commit is contained in:
Yu Watanabe
2023-07-19 07:24:36 +02:00
committed by Daan De Meyer
parent e30c6e913c
commit 149aedb89b
2 changed files with 18 additions and 2 deletions
+12
View File
@@ -71,6 +71,18 @@ test ! -e "$entry"
test ! -e "$BOOT_ROOT/the-token/1.1.1/linux"
test ! -e "$BOOT_ROOT/the-token/1.1.1/initrd"
# Test again with too many arguments for 'remove' command. See #28448.
"$kernel_install" -v add 1.1.1 "$D/sources/linux" "$D/sources/initrd"
test -f "$entry"
test -f "$BOOT_ROOT/the-token/1.1.1/linux"
test -f "$BOOT_ROOT/the-token/1.1.1/initrd"
"$kernel_install" -v remove 1.1.1 hoge foo bar
test ! -e "$entry"
test ! -e "$BOOT_ROOT/the-token/1.1.1/linux"
test ! -e "$BOOT_ROOT/the-token/1.1.1/initrd"
# Invoke kernel-install as installkernel
ln -s --relative -v "$kernel_install" "$D/sources/installkernel"
"$D/sources/installkernel" -v 1.1.2 "$D/sources/linux" System.map /somedirignored