update-kernel: Add undocumented '--reinstall' option

This will pass `--reinstall' to `apt-get install'.

Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
This commit is contained in:
Виталий Чикунов 2022-04-07 10:29:47 +03:00
parent 390e0d427a
commit 4fab0940fa

View File

@ -89,7 +89,7 @@ ufver() {
}
#parse command line options
TEMP=$(getopt -n "$PROG" -o a,i,l,f,y,t:,r:,v,n,h -l interactive,list,all,force,type:,release:,verbose,dry-run,help -- "$@") || show_help
TEMP=$(getopt -n "$PROG" -o a,i,l,f,y,t:,r:,v,n,h -l interactive,list,all,force,type:,release:,verbose,reinstall,dry-run,help -- "$@") || show_help
eval set -- "$TEMP"
while :; do
@ -110,6 +110,8 @@ while :; do
;;
-v|--verbose) verbose=1
;;
--reinstall) reinstall=$1
;;
-n|--dry-run) dryrun="--download-only"
;;
-h|--help) show_help
@ -476,7 +478,7 @@ fi
# now install everything at once
# shellcheck disable=SC2086
V apt-get install -o APT::Install::Virtual=true -y $dryrun "kernel-image-$kernel_flavour#$kmaxver" $modules_to_install \
V apt-get install -o APT::Install::Virtual=true -y $reinstall $dryrun "kernel-image-$kernel_flavour#$kmaxver" $modules_to_install \
|| fatal "failed to install kernel-image-$kernel_flavour-$kmaxver with modules"
# proper reboot will sync, but make sure it's synced in case user press reset button